b2evolution PHP Cross Reference Blogging Systems

Source: /inc/cron/views/_cronjob.form.php - 84 lines - 3020 bytes - Text - Print

Description: This file implements the UI view for the cron job form.

   1  <?php
   2  /**
   3   * This file implements the UI view for the cron job form.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * }}
  21   *
  22   * @package admin
  23   *
  24   * @version $Id: _cronjob.form.php 6136 2014-03-08 07:59:48Z manuel $
  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  global $localtimenow, $cron_job_names, $edited_Cronjob;
  29  
  30  // Determine if we are creating or updating...
  31  global $action;
  32  $creating = is_create_action( $action );
  33  
  34  $Form = new Form( NULL, 'cronjob' );
  35  
  36  $Form->global_icon( T_('Cancel!'), 'close', regenerate_url( 'action' ) );
  37  
  38  $Form->begin_form( 'fform', $creating ? T_('New scheduled job') : T_('Edit scheduled job') );
  39  
  40      $Form->add_crumb( 'crontask' );
  41      $Form->hiddens_by_key( get_memorized( 'action' ) );
  42      $Form->hidden( 'action', $creating ? 'create' : 'update' );
  43  
  44      $Form->begin_fieldset( T_('Job details').get_manual_link('scheduler_job_form') );
  45  
  46          if( $creating && $action != 'copy' )
  47          {    // New cronjob
  48              $Form->select_input_array( 'cjob_type', get_param( 'cjob_type' ), $cron_job_names, T_('Job type') );
  49          }
  50          else
  51          {    // Edit cronjob
  52              if( $action == 'edit' )
  53              {
  54                  $Form->info( T_('Job #'), $edited_Cronjob->ID );
  55              }
  56  
  57              $Form->text_input( 'cjob_name', $edited_Cronjob->name, 25, T_('Job name'), '', array( 'maxlength' => 255, 'required' => true ) );
  58          }
  59  
  60          $Form->date_input( 'cjob_date', date2mysql( $edited_Cronjob->start_timestamp ), T_('Schedule date'), array(
  61                               'required' => true ) );
  62  
  63          $Form->time_input( 'cjob_time', date2mysql( $edited_Cronjob->start_timestamp ), T_('Schedule time'), array(
  64                               'required' => true ) );
  65  
  66          $Form->duration_input( 'cjob_repeat_after', $edited_Cronjob->repeat_after, T_('Repeat every'), 'days', 'minutes', array( 'minutes_step' => 1 ) );
  67  
  68      $Form->end_fieldset();
  69  
  70      if( !$creating )
  71      {    // We can edit only pending cron jobs, Show this field just for info
  72          $Form->begin_fieldset( T_('Execution details').get_manual_link('scheduler_execution_info') );
  73  
  74              $Form->info( T_('Status'), 'pending' );
  75  
  76          $Form->end_fieldset();
  77      }
  78  
  79  $Form->end_form( array(
  80              array( 'submit', 'submit', $creating ? T_('Create') : T_('Update'), 'SaveButton' ),
  81              array( 'reset', '', T_('Reset'), 'ResetButton' ),
  82          ) );
  83  
  84  ?>

title

Description

title

Description

title

Description

title

title

Body