Exemplo n.º 1
0
 /**
  * Tag handler for printing code lists
  *
  * @param array $params
  * @param array $children
  */
 public function tag_CodeList($params, $children)
 {
     $manager = CodeManager::getInstance();
     $conditions = array();
     $items = $manager->getItems($manager->getFieldNames(), $conditions, array('id'));
     $template = new TemplateHandler('list_item.xml', $this->path . 'templates/');
     $template->setMappedModule($this->name);
     if (count($items) > 0) {
         foreach ($items as $item) {
             $params = array('id' => $item->id, 'code' => $item->code, 'url' => $item->url, 'item_change' => url_MakeHyperlink($this->getLanguageConstant('change'), window_Open('codes_change', 400, $this->getLanguageConstant('title_codes_change'), false, false, url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'codes_change'), array('id', $item->id)))), 'item_delete' => url_MakeHyperlink($this->getLanguageConstant('delete'), window_Open('codes_delete', 400, $this->getLanguageConstant('title_codes_delete'), false, false, url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'codes_delete'), array('id', $item->id)))), 'item_open' => url_MakeHyperlink($this->getLanguageConstant('open'), $item->url, '', '', '_blank'));
             $template->restoreXML();
             $template->setLocalParams($params);
             $template->parse();
         }
     }
 }