/** * TODO * */ function disp_form() { global $ctrl, $action, $edited_name_maxlen, $form_below_list; // Determine if we are creating or updating... $creating = is_create_action($action); $Form =& new Form(NULL, 'form'); if (!$form_below_list) { // We need to display a link to cancel editing: $Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action')); } $Form->begin_form('fform', $creating ? T_('New element') : T_('Element')); $Form->hidden('action', $creating ? 'create' : 'update'); $Form->hidden('ctrl', $ctrl); $Form->hiddens_by_key(get_memorized('action, ctrl')); $Form->text_input($this->dbprefix . 'name', $this->name, $edited_name_maxlen, T_('name'), '', array('required' => true)); if (!$creating) { $Form->hidden($this->dbIDname, $this->ID); } if ($creating) { $Form->end_form(array(array('submit', 'submit', T_('Record'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton'))); } else { $Form->end_form(array(array('submit', 'submit', T_('Update'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton'))); } }
* This file is part of the evoCore framework - {@link http://evocore.net/} * See also {@link https://github.com/b2evolution/b2evolution}. * * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license} * * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/} * * @package admin */ if (!defined('EVO_MAIN_INIT')) { die('Please, do not access this page directly.'); } global $localtimenow, $edited_Cronjob; // Determine if we are creating or updating... global $action; $creating = is_create_action($action); $Form = new Form(NULL, 'cronjob'); $Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action')); $Form->begin_form('fform', $creating ? T_('New scheduled job') : T_('Edit scheduled job')); $Form->add_crumb('crontask'); $Form->hiddens_by_key(get_memorized('action')); $Form->hidden('action', $creating ? 'create' : 'update'); $Form->begin_fieldset(T_('Job details') . get_manual_link('scheduled-job-form')); if ($creating && $action != 'copy') { // New cronjob $cron_jobs_names = get_cron_jobs_config('name'); // Exclude these cron jobs from manual creating unset($cron_jobs_names['send-post-notifications']); unset($cron_jobs_names['send-comment-notifications']); $Form->select_input_array('cjob_type', get_param('cjob_type'), $cron_jobs_names, T_('Job type')); } else {
/** * Display buttons to update a post * * @param object Form * @param object edited Item */ function echo_item_status_buttons($Form, $edited_Item) { global $next_action, $action, $Blog; // Get those statuses which are not allowed for the current User to create posts in this blog $exclude_statuses = array_merge(get_restricted_statuses($Blog->ID, 'blog_post!', 'create'), array('trash')); // Get allowed visibility statuses $status_options = get_visibility_statuses('button-titles', $exclude_statuses); $status_icon_options = get_visibility_statuses('icons', $exclude_statuses); $next_action = is_create_action($action) ? 'create' : 'update'; $Form->hidden('post_status', $edited_Item->status); echo '<div class="btn-group dropup post_status_dropdown">'; echo '<button type="submit" class="btn btn-status-' . $edited_Item->status . '" name="actionArray[' . $next_action . ']">' . '<span>' . $status_options[$edited_Item->status] . '</span>' . '</button>' . '<button type="button" class="btn btn-status-' . $edited_Item->status . ' dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="post_status_dropdown">' . '<span class="caret"></span>' . '</button>'; echo '<ul class="dropdown-menu" role="menu" aria-labelledby="post_status_dropdown">'; foreach ($status_options as $status_key => $status_title) { echo '<li rel="' . $status_key . '" role="presentation"><a href="#" role="menuitem" tabindex="-1">' . $status_icon_options[$status_key] . ' <span>' . $status_title . '</span></a></li>'; } echo '</ul>'; echo '</div>'; }