Changeset 1955:b0bef03695c0 for plugins/maintenance/inc
- Timestamp:
- 09/19/13 01:08:39 (12 years ago)
- Branch:
- default
- Children:
- 1956:d272c079e6e5, 1964:bfde9296c3c5
- Location:
- plugins/maintenance/inc
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/maintenance/inc/class.dc.maintenance.php
r1940 r1955 27 27 private $core; 28 28 private $tasks = array(); 29 private $tabs = array(); 29 30 private $groups = array(); 30 31 … … 41 42 42 43 $tasks = new ArrayObject(); 44 $tabs = new ArrayObject(); 43 45 $groups = new ArrayObject(); 44 46 45 47 # --BEHAVIOR-- dcMaintenanceRegister 46 $core->callBehavior('dcMaintenanceRegister', $core, $tasks, $groups );47 48 $this->init($tasks, $groups );48 $core->callBehavior('dcMaintenanceRegister', $core, $tasks, $groups, $tabs); 49 50 $this->init($tasks, $groups, $tabs); 49 51 } 50 52 … … 54 56 * @param tasks <b>arrayObject</b> Array of task to register 55 57 * @param groups <b>arrayObject</b> Array of groups to add 56 */ 57 public function init($tasks, $groups) 58 * @param tabs <b>arrayObject</b> Array of tabs to add 59 */ 60 public function init($tasks, $groups, $tabs) 58 61 { 59 62 $this->tasks = $this->groups = array(); … … 79 82 $this->groups[(string) $id] = (string) $name; 80 83 } 84 85 foreach($tabs as $id => $name) 86 { 87 $this->tabs[(string) $id] = (string) $name; 88 } 89 } 90 91 /** 92 * Get a tab name. 93 * 94 * @param id <b>string</b> Tab ID 95 * @return <b>mixed</b> tab name or null if not exists 96 */ 97 public function getTab($id) 98 { 99 return array_key_exists($id, $this->tabs) ? $this->tabs[$id] : null; 100 } 101 102 /** 103 * Get tabs. 104 * 105 * @return <b>array</b> Array of tabs ID and name 106 */ 107 public function getTabs() 108 { 109 return $this->tabs; 81 110 } 82 111 -
plugins/maintenance/inc/class.dc.maintenance.task.php
r1940 r1955 28 28 protected $id; 29 29 protected $name; 30 protected $tab = 'maintenance'; 30 31 protected $group = 'other'; 31 32 … … 115 116 116 117 /** 118 * Get task tab. 119 * 120 * @return <b>mixed</b> Task tab ID or null 121 */ 122 public function tab() 123 { 124 return $this->tab; 125 } 126 127 /** 117 128 * Get task group. 118 129 * … … 211 222 return null; 212 223 } 224 225 /** 226 * Log task execution. 227 * 228 * Sometimes we need to log task execution 229 * direct from task itself. 230 * 231 */ 232 protected function log() 233 { 234 $maintenance = new dcMaintenance($this->core); 235 $maintenance->setLog($this->id); 236 } 213 237 }
Note: See TracChangeset
for help on using the changeset viewer.