protected function process_data(&$signal)
 {
     $result = parent::process_data($signal);
     $params = $this->get_task_params();
     $params['fromid'] = $signal->data_pageid($this->default_data_key);
     if (is_null($params['fromid'])) {
         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_pageid.php';
         $task = new Task_MovePageid($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('fromid' => $params['fromid']));
     return $result;
 }
Exemple #2
0
 public function move_pageid($pageid, $to_title, $reason, $noredirect = NULL, $movetalk = NULL, $movesubpages = NULL, $watch = NULL)
 {
     $params = array('pageid' => $pageid, 'reason' => $reason, 'to' => $to_title, 'noredirect' => $noredirect, 'movetalk' => $movetalk, 'movesubpages' => $movesubpages, 'watch' => $watch);
     require_once dirname(__FILE__) . '/../../core/tasks/move_pageid.php';
     $task = new Task_MovePageid($this->core);
     return $task->go($params);
 }