Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
cron_job_future_status_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/system/cron/cron_job/cron_job_edit_fns.inc';
19 
32 {
33 
34 
40  function __construct()
41  {
42  parent::__construct();
43 
44  }//end constructor
45 
46 
61  public function paintInLineBackend(Cron_Job_Future_Status $asset, Backend_Outputter $o, $prefix, $when='', $cascade=FALSE, $form_extra_elements='', Array $exclude_status=Array())
62  {
63  echo translate('set_status_to');
64 
65  $descs = $asset->_getAllStatiiDescs();
66  foreach ($exclude_status as $status) {
67  unset($descs[$status]);
68  }
69 
70  if ($asset->writeAccess('attributes')) {
71  combo_box($prefix.'_status', $descs, FALSE, $asset->attr('status'), NULL, $form_extra_elements);
72  } else {
73  echo $descs[$asset->attr('status')];
74  }
75 
76  echo '&nbsp;'.strtolower(translate('at')).'&nbsp;';
77  $this->_paintWhenBox($asset, $o, $prefix, $when, $form_extra_elements);
78 
79  echo '&nbsp;';
80  check_box($prefix.'_change_status_all_children', '1', $cascade);
81  echo translate('cascade_status_change');
82 
83  return TRUE;
84 
85  }//end paintInLineBackend()
86 
87 
98  public function processInLineBackend(Cron_Job_Future_Status $asset, Backend_Outputter $o, $prefix)
99  {
100  if (!empty($_POST[$prefix.'_status']) && $asset->setAttrValue('status', $_POST[$prefix.'_status'])) {
101  $dependants_only = (isset($_POST[$prefix.'_change_status_all_children']) && $_POST[$prefix.'_change_status_all_children']) ? FALSE : TRUE;
102  if ($when = $this->_processWhenBox($asset, $o, $prefix)) {
103  return ($asset->setAttrValue('when', $when) && $asset->setAttrValue('dependants_only', $dependants_only));
104  } else {
105  trigger_localised_error('CRON0046', E_USER_NOTICE);
106  }
107  }
108 
109  return FALSE;
110 
111  }//end processInLineBackend()
112 
113 
114 }//end class
115 
116 ?>