Esempio n. 1
0
 static function createTaskObject($queue_id = FALSE)
 {
     if (!isset(self::$MAESTROTASK)) {
         // instance does not exist, so create it
         $res = db_query("SELECT task_class_name, template_data_id FROM {maestro_queue} WHERE id = :qid", array(':qid' => $queue_id))->fetchObject();
         if ($res) {
             $properties = new stdClass();
             $properties->taskid = $res->template_data_id;
             $properties->queue_id = $queue_id;
             self::$MAESTROTASK = new $res->task_class_name($properties);
         }
     } else {
         return self::$MAESTROTASK;
     }
     return self::$MAESTROTASK;
 }
 public function showInteractiveTask(MaestroTask $task, $taskid)
 {
     /* Common HTML container with an ID set that we will hook onto to show/hide.
      * This lets developer not have to worry about returning a table row with 5 columns
      */
     $prehtmlfragment = '<tr class="maestro_taskconsole_interactivetaskcontent" id="maestro_actionrec' . $taskid . '" style="display:none;"><td colspan="6">';
     $posthtmlfragment = '</td></tr>';
     $retval = $task->showInteractiveTask();
     if ($retval === FALSE) {
         return '';
     } else {
         if (empty($retval)) {
             return $prehtmlfragment . t('empty interactive task - nothing to display for interactive function.') . $posthtmlfragment;
         } else {
             return $prehtmlfragment . $retval . $posthtmlfragment;
         }
     }
 }