示例#1
0
 protected function process_data(&$signal)
 {
     $result = parent::process_data($signal);
     $params = $this->get_task_params();
     $params['from'] = $signal->data_title($this->default_data_key);
     if (is_null($params['from'])) {
         return false;
     }
     if (empty($params['to'])) {
         if (empty($this->to_title)) {
             $this->to_title = $signal->data_to_title($this->default_data_key);
         }
         if (empty($this->to_title)) {
             return NULL;
         } else {
             $params['to'] = $this->to_title;
         }
     }
     if (empty($this->to_title)) {
         $result = NULL;
     } else {
         require_once dirname(__FILE__) . '/../../../../core/tasks//move_title.php';
         $task = new Task_MoveTitle($this->core);
         $result = $task->go($params);
     }
     if ($result) {
         $data_element = $signal->data_element($this->default_data_key);
         $data_element['title'] = $this->to_title;
         $signal->set_data_element($this->default_data_key, $data_element);
     }
     $this->set_jobdata($result, array('from' => $params['from']));
     return $result;
 }
示例#2
0
 public function move_title($title, $to_title, $reason, $noredirect = NULL, $movetalk = NULL, $movesubpages = NULL, $watch = NULL)
 {
     $params = array('title' => $title, 'reason' => $reason, 'to' => $to_title, 'noredirect' => $noredirect, 'movetalk' => $movetalk, 'movesubpages' => $movesubpages, 'watch' => $watch);
     require_once dirname(__FILE__) . '/../../core/tasks/move_title.php';
     $task = new Task_MoveTitle($this->core);
     return $task->go($params);
 }