コード例 #1
0
ファイル: activity_tracker.php プロジェクト: tareqy/Caracal
 /**
  * Handle drawing list of activities.
  *
  * @param array $tag_params
  * @param array $children
  */
 public function tag_ActivityList($tag_params, $children)
 {
     $manager = ActivityManager::getInstance();
     $conditions = array();
     // get items from database
     $items = $manager->getItems($manager->getFieldNames(), $conditions);
     // load template
     $template = $this->loadTemplate($tag_params, 'list_item.xml');
     // parse template
     if (count($items) > 0) {
         foreach ($items as $item) {
             $params = array('id' => $item->id, 'activity' => $item->activity, 'function' => $item->function, 'timeout' => $item->timeout, 'ignore_address' => $item->ignore_address, 'ignore_address_char' => $item->ignore_address ? CHAR_CHECKED : CHAR_UNCHECKED, 'item_change' => url_MakeHyperlink($this->getLanguageConstant('change'), window_Open('activities_change', 400, $this->getLanguageConstant('title_activity_change'), false, false, url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'change'), array('id', $item->id)))), 'item_delete' => url_MakeHyperlink($this->getLanguageConstant('delete'), window_Open('activities_delete', 400, $this->getLanguageConstant('title_activity_delete'), false, false, url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'delete'), array('id', $item->id)))));
             $template->restoreXML();
             $template->setLocalParams($params);
             $template->parse();
         }
     }
 }