コード例 #1
0
 /**
  * show record list
  *
  * @access public
  * @param
  * 
  */
 public function showRecords()
 {
     global $ilToolbar;
     $ilToolbar->addButton($this->lng->txt('add'), $this->ctrl->getLinkTarget($this, "createRecord"));
     $this->record_objs = $this->getRecordObjects();
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.show_records.html', 'Services/AdvancedMetaData');
     include_once "./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordTableGUI.php";
     $table_gui = new ilAdvancedMDRecordTableGUI($this, "showRecords");
     $table_gui->setTitle($this->lng->txt("md_record_list_table"));
     $table_gui->parseRecords($this->record_objs);
     $table_gui->addCommandButton("updateRecords", $this->lng->txt("save"));
     //$table_gui->addCommandButton('createRecord',$this->lng->txt('add'));
     $table_gui->addMultiCommand("exportRecords", $this->lng->txt('export'));
     $table_gui->addMultiCommand("confirmDeleteRecords", $this->lng->txt("delete"));
     $table_gui->setSelectAllCheckbox("record_id");
     $this->tpl->setVariable('RECORD_TABLE', $table_gui->getHTML());
     if (!$this->initFormSubstitutions()) {
         return true;
     }
     if (is_object($this->form)) {
         $this->tpl->setVariable('SUBSTITUTION_TABLE', $this->form->getHTML());
     }
     return true;
 }
コード例 #2
0
 /**
  * show record list
  *
  * @access public
  * @param
  * 
  */
 public function showRecords()
 {
     global $ilToolbar;
     $perm = $this->getPermissions()->hasPermissions(ilAdvancedMDPermissionHelper::CONTEXT_MD, $_REQUEST["ref_id"], array(ilAdvancedMDPermissionHelper::ACTION_MD_CREATE_RECORD, ilAdvancedMDPermissionHelper::ACTION_MD_IMPORT_RECORDS));
     if ($perm[ilAdvancedMDPermissionHelper::ACTION_MD_CREATE_RECORD]) {
         include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
         $button = ilLinkButton::getInstance();
         $button->setCaption("add");
         $button->setUrl($this->ctrl->getLinkTarget($this, "createRecord"));
         $ilToolbar->addButtonInstance($button);
         if ($perm[ilAdvancedMDPermissionHelper::ACTION_MD_IMPORT_RECORDS]) {
             $ilToolbar->addSeparator();
         }
     }
     if ($perm[ilAdvancedMDPermissionHelper::ACTION_MD_IMPORT_RECORDS]) {
         include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
         $button = ilLinkButton::getInstance();
         $button->setCaption("import");
         $button->setUrl($this->ctrl->getLinkTarget($this, "importRecords"));
         $ilToolbar->addButtonInstance($button);
     }
     $this->record_objs = $this->getRecordObjects();
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.show_records.html', 'Services/AdvancedMetaData');
     include_once "./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordTableGUI.php";
     $table_gui = new ilAdvancedMDRecordTableGUI($this, "showRecords", $this->getPermissions());
     $table_gui->setTitle($this->lng->txt("md_record_list_table"));
     $table_gui->parseRecords($this->record_objs);
     // permissions?
     $table_gui->addCommandButton("updateRecords", $this->lng->txt("save"));
     //$table_gui->addCommandButton('createRecord',$this->lng->txt('add'));
     $table_gui->addMultiCommand("exportRecords", $this->lng->txt('export'));
     $table_gui->addMultiCommand("confirmDeleteRecords", $this->lng->txt("delete"));
     $table_gui->setSelectAllCheckbox("record_id");
     $this->tpl->setVariable('RECORD_TABLE', $table_gui->getHTML());
     return true;
 }