public function saveObject() { if (!$this->checkInput()) { return false; } $this->bibl_setting->setName($this->getInput("name")); $this->bibl_setting->setUrl($this->getInput("url")); $this->bibl_setting->setImg($this->getInput("img")); $this->bibl_setting->setShowInList($this->getInput("show_in_list")); switch ($this->action) { case 'create': $this->bibl_setting->create(); break; case 'update': $this->bibl_setting->update(); break; } return true; }
/** * @param array $a_set */ public function fillRow($a_set) { $il_obj_entry = ilBibliographicEntry::getInstance($this->parent_obj->object->getFiletype(), $a_set['entry_id']); $this->tpl->setVariable('SINGLE_ENTRY', $il_obj_entry->getOverwiew()); //Detail-Link $this->ctrl->setParameter($this->parent_obj, ilObjBibliographicGUI::P_ENTRY_ID, $a_set['entry_id']); $this->tpl->setVariable('DETAIL_LINK', $this->ctrl->getLinkTarget($this->parent_obj, 'showDetails')); // generate/render links to libraries $settings = ilBibliographicSetting::getAll(); $arr_library_link = array(); foreach ($settings as $set) { if ($set->getShowInList()) { $arr_library_link[] = $set->getButton($this->parent_obj->object, $il_obj_entry); } } if (count($arr_library_link)) { $this->tpl->setVariable('LIBRARY_LINK', implode('<br/>', $arr_library_link)); } }
/** * Init Table with library entries * * @access protected */ protected function initTable() { $table = new ilObjBibliographicAdminTableGUI($this, 'library'); $settings = ilBibliographicSetting::getAll(); $result = array(); foreach ($settings as $set) { $result[] = array("id" => $set->getId(), "name" => $set->getName(), "url" => $set->getBaseUrl(), "img" => $set->getImageUrl()); } $table->setData($result); return $table; }
/** * @return string */ public function getHTML() { global $tpl, $ilTabs, $ilCtrl, $lng, $ilHelp; /** * @var $ilHelp ilHelpGUI */ $ilHelp->setScreenIdComponent('bibl'); $form = new ilPropertyFormGUI(); $ilTabs->clearTargets(); $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, 'showContent')); $form->setTitle($lng->txt('detail_view')); // add link button if a link is defined in the settings $set = new ilSetting("bibl"); $link = $set->get(strtolower($this->bibl_obj->getFiletype())); if (!empty($link)) { $form->addCommandButton('autoLink', 'Link'); } $attributes = $this->entry->getAttributes(); //translate array key in order to sort by those keys foreach ($attributes as $key => $attribute) { //Check if there is a specific language entry if ($lng->exists($key)) { $strDescTranslated = $lng->txt($key); } else { $arrKey = explode("_", $key); $is_standard_field = false; switch ($arrKey[0]) { case 'bib': $is_standard_field = ilBibTex::isStandardField($arrKey[2]); break; case 'ris': $is_standard_field = ilRis::isStandardField($arrKey[2]); break; } // var_dump($is_standard_field); // FSX if ($is_standard_field) { $strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]); } else { $strDescTranslated = $arrKey[2]; } } unset($attributes[$key]); $attributes[$strDescTranslated] = $attribute; } // sort attributes alphabetically by their array-key ksort($attributes, SORT_STRING); // render attributes to html foreach ($attributes as $key => $attribute) { $ci = new ilCustomInputGUI($key); $ci->setHtml($attribute); $form->addItem($ci); } // generate/render links to libraries $settings = ilBibliographicSetting::getAll(); foreach ($settings as $set) { $ci = new ilCustomInputGUI($set->getName()); $ci->setHtml($set->getButton($this->bibl_obj, $this->entry)); $form->addItem($ci); } $tpl->setPermanentLink("bibl", $this->bibl_obj->getRefId(), "_" . $_GET[ilObjBibliographicGUI::P_ENTRY_ID]); // set content and title return $form->getHTML(); //Permanent Link }