/** * Init service settings form * @param ilPropertyFormGUI $form * @param type $services */ public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services) { global $ilSetting; if (in_array(self::CALENDAR_VISIBILITY, $services)) { include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isEnabled()) { // Container tools (calendar, news, ... activation) $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY); $cal->setValue(1); include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php'; $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id)); $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar')); $form->addItem($cal); } } if (in_array(self::NEWS_VISIBILITY, $services)) { if ($ilSetting->get('block_activated_news')) { // Container tools (calendar, news, ... activation) $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY); $news->setValue(1); $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true))); $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news')); $form->addItem($news); } } return $form; }
/** * Get selectable taxonomies for current object * * @return array */ protected function getSelectableTaxonomies() { global $objDefinition, $tree; if ($objDefinition->isRBACObject($this->md_obj_type)) { $res = array(); // see ilTaxonomyBlockGUI::getActiveTaxonomies() // get all active taxonomies of parent objects foreach ($tree->getPathFull((int) $_REQUEST["ref_id"]) as $node) { // currently only active for categories if ($node["type"] == "cat") { include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; include_once "Services/Container/classes/class.ilContainer.php"; if (ilContainer::_lookupContainerSetting($node["obj_id"], ilObjectServiceSettingsGUI::TAXONOMIES, false)) { include_once "Services/Taxonomy/classes/class.ilObjTaxonomy.php"; $tax_ids = ilObjTaxonomy::getUsageOfObject($node["obj_id"]); if (sizeof($tax_ids)) { $res = array_merge($res, $tax_ids); } } } } if (sizeof($res)) { return $res; } } }
/** * * @param bool * @return bool */ function getInfoScreenStatus() { include_once "./Services/Container/classes/class.ilContainer.php"; include_once "./Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; if (ilContainer::_lookupContainerSetting($this->obj_id, ilObjectServiceSettingsGUI::INFO_TAB_VISIBILITY, true)) { return $this->info_screen_enabled; } return false; }
public static function isActive($a_parent_ref_id, $a_parent_obj_id, $a_parent_obj_type) { global $ilUser; // we currently only check for the parent object setting // might change later on (parent containers) include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; $valid = ilContainer::_lookupContainerSetting($a_parent_obj_id, ilObjectServiceSettingsGUI::TAG_CLOUD, false); if ($valid) { $tags_set = new ilSetting("tags"); if (!$tags_set->get("enable_all_users", false) && $ilUser->getId() == ANONYMOUS_USER_ID) { $valid = false; } } return $valid; }
/** * Constructor * @access public */ function ilObjCategoryGUI($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true) { //global $ilCtrl; // CONTROL OPTIONS //$this->ctrl =& $ilCtrl; //$this->ctrl->saveParameter($this,array("ref_id","cmdClass")); $GLOBALS['lng']->loadLanguageModule('cat'); $this->type = "cat"; $this->ilContainerGUI($a_data, (int) $a_id, $a_call_by_reference, false); if (is_object($this->object)) { include_once "./Services/Container/classes/class.ilContainer.php"; include_once "./Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; $this->info_screen_enabled = ilContainer::_lookupContainerSetting($this->object->getId(), ilObjectServiceSettingsGUI::INFO_TAB_VISIBILITY, true); } }
protected static function getActiveTaxonomiesForParentRefId($a_parent_ref_id) { global $tree; if (!isset(self::$valid_tax_map[$a_parent_ref_id])) { include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; include_once "Services/Taxonomy/classes/class.ilObjTaxonomy.php"; include_once "Modules/Category/classes/class.ilObjCategoryGUI.php"; $prefix = ilObjCategoryGUI::CONTAINER_SETTING_TAXBLOCK; $all_valid = array(); foreach ($tree->getPathFull($a_parent_ref_id) as $node) { if ($node["type"] == "cat") { $node_valid = array(); if (ilContainer::_lookupContainerSetting($node["obj_id"], ilObjectServiceSettingsGUI::TAXONOMIES, false)) { $all_valid = array_merge($all_valid, ilObjTaxonomy::getUsageOfObject($node["obj_id"])); $active = array(); foreach (ilContainer::_getContainerSettings($node["obj_id"]) as $keyword => $value) { if (substr($keyword, 0, strlen($prefix)) == $prefix && (bool) $value) { $active[] = substr($keyword, strlen($prefix)); } } $node_valid = array_intersect($all_valid, $active); } if (sizeof($node_valid)) { foreach ($node_valid as $idx => $node_id) { // #15268 - deleted taxonomy? if (ilObject::_lookupType($node_id) != "tax") { unset($node_valid[$idx]); } } } self::$valid_tax_map[$node["ref_id"]] = $node_valid; } } } return sizeof(self::$valid_tax_map[$a_parent_ref_id]); }
/** * Get icon for repository item. * * @param int object id * @param string size (big, small, tiny) * @param string object type * @param boolean true: offline, false: online */ public static function _getIcon($a_obj_id = "", $a_size = "big", $a_type = "", $a_offline = false) { global $ilSetting, $objDefinition; if ($a_obj_id == "" && $a_type == "") { return ""; } if ($a_type == "") { $a_type = ilObject::_lookupType($a_obj_id); } if ($a_size == "") { $a_size = "big"; } if ($ilSetting->get("custom_icons") && in_array($a_type, array("cat", "grp", "crs", "root"))) { require_once "./Services/Container/classes/class.ilContainer.php"; if (ilContainer::_lookupContainerSetting($a_obj_id, "icon_" . $a_size)) { $cont_dir = ilContainer::_getContainerDirectory($a_obj_id); // png version? (introduced with ILIAS 4.3) $file_name = $cont_dir . "/icon_" . $a_size . ".png"; if (is_file($file_name)) { return $file_name; } // gif version? (prior to ILIAS 4.3) $file_name = $cont_dir . "/icon_" . $a_size . ".gif"; if (is_file($file_name)) { return $file_name; } } } switch ($a_size) { case "small": $suff = ""; break; case "tiny": $suff = "_s"; break; default: $suff = "_b"; break; } if (!$a_offline) { if ($objDefinition->isPluginTypeName($a_type)) { include_once "./Services/Repository/classes/class.ilRepositoryObjectPlugin.php"; return ilRepositoryObjectPlugin::_getIcon($a_type, $a_size); } return ilUtil::getImagePath("icon_" . $a_type . $suff . ".png"); } else { return "./images/icon_" . $a_type . $suff . ".png"; } }
/** * Init style properties form */ function initStylePropertiesForm() { global $ilCtrl, $lng, $ilTabs, $ilSetting, $tpl; $tpl->setTreeFlatIcon("", ""); $ilTabs->clearTargets(); $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { $ilTabs->setBackTarget($lng->txt("cntr_back_to_old_editor"), $ilCtrl->getLinkTarget($this, "switchToOldEditor"), "_top"); } else { $ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=" . $this->object->getType() . "_" . $this->object->getRefId(), "_top"); } include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; $page_gui = new ilContainerPageGUI($this->object->getId()); $style_id = $this->object->getStyleSheetId(); if (ilObject::_lookupType($style_id) == "sty") { $page_gui->setStyleId($style_id); } else { $style_id = 0; } $page_gui->setTabHook($this, "addPageTabs"); $ilCtrl->getHTML($page_gui); $ilTabs->setTabActive("obj_sty"); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $lng->loadLanguageModule("style"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $fixed_style = $ilSetting->get("fixed_content_style_id"); // $style_id = $this->object->getStyleSheetId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($lng->txt("wiki_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $this->form->addItem($st); } else { $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); if ($style_id > 0) { // individual style if (!ilObjStyleSheet::_lookupStandard($style_id)) { $st = new ilNonEditableValueGUI($lng->txt("style_current_style")); $st->setValue(ilObject::_lookupTitle($style_id)); $this->form->addItem($st); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit")); // delete command $this->form->addCommandButton("editStyle", $lng->txt("style_edit_style")); $this->form->addCommandButton("deleteStyle", $lng->txt("style_delete_style")); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete")); } } if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) { $style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true); $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $this->form->addItem($style_sel); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create")); $this->form->addCommandButton("saveStyleSettings", $lng->txt("save")); $this->form->addCommandButton("createStyle", $lng->txt("sty_create_ind_style")); } } $this->form->setTitle($lng->txt("obj_sty")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * Check if auto rating is active for parent group/course * * @param string $a_type * @param int $a_ref_id * @return bool */ public static function hasAutoRating($a_type, $a_ref_id) { global $tree; if (!$a_ref_id || !in_array($a_type, array("file", "lm", "wiki"))) { return false; } // find parent container $parent_ref_id = $tree->checkForParentType($a_ref_id, "grp"); if (!$parent_ref_id) { $parent_ref_id = $tree->checkForParentType($a_ref_id, "crs"); } if ($parent_ref_id) { include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; // get auto rate setting $parent_obj_id = ilObject::_lookupObjId($parent_ref_id); return ilContainer::_lookupContainerSetting($parent_obj_id, ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS, false); } return false; }
/** * Get tabs */ function getTabs(&$tabs_gui) { global $rbacsystem, $lng, $ilHelp, $ilAccess; if ($this->ctrl->getCmd() == "editPageContent") { return; } #$this->ctrl->setParameter($this,"ref_id",$this->ref_id); $ilHelp->setScreenIdComponent("cat"); if ($rbacsystem->checkAccess('read', $this->ref_id)) { $force_active = $_GET["cmd"] == "" || $_GET["cmd"] == "render" ? true : false; $tabs_gui->addTab("view_content", $lng->txt("content"), $this->ctrl->getLinkTarget($this, "")); //BEGIN ChangeEvent add info tab to category object if ($this->info_screen_enabled) { $force_active = $this->ctrl->getNextClass() == "ilinfoscreengui" || strtolower($_GET["cmdClass"]) == "ilnotegui" ? true : false; $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTargetByClass(array("ilobjcategorygui", "ilinfoscreengui"), "showSummary"), array("showSummary", "", "infoScreen"), "", "", $force_active); } //END ChangeEvent add info tab to category object } if ($rbacsystem->checkAccess('write', $this->ref_id)) { $force_active = $_GET["cmd"] == "edit" ? true : false; $tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this), "", $force_active); include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; if (ilContainer::_lookupContainerSetting($this->object->getId(), ilObjectServiceSettingsGUI::TAXONOMIES, false)) { $tabs_gui->addTarget("obj_tool_setting_taxonomies", $this->ctrl->getLinkTarget($this, "editTaxonomySettings"), "editTaxonomySettings", get_class($this)); } } include_once './Services/User/classes/class.ilUserAccountSettings.php'; if (ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled() and $rbacsystem->checkAccess('cat_administrate_users', $this->ref_id)) { $tabs_gui->addTarget("administrate_users", $this->ctrl->getLinkTarget($this, "listUsers"), "listUsers", get_class($this)); } if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) { $tabs_gui->addTarget('export', $this->ctrl->getLinkTargetByClass('ilexportgui', ''), 'export', 'ilexportgui'); } // parent tabs (all container: edit_permission, clipboard, trash parent::getTabs($tabs_gui); }
function initEditForm() { $this->setEditTabs(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("repository")); $this->initSortingForm($form, array(ilContainer::SORT_TITLE, ilContainer::SORT_CREATION, ilcontainer::SORT_MANUAL)); $this->showCustomIconsEditing(1, $form, false); $hide = new ilCheckboxInputGUI($this->lng->txt("cntr_hide_title_and_icon"), "hide_header_icon_and_title"); $hide->setChecked(ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title")); $form->addItem($hide); $form->addCommandButton("update", $this->lng->txt("save")); $form->addCommandButton("addTranslation", $this->lng->txt("add_translation")); return $form; }
/** * lookup icon path * * @param int $a_id container object id * @param string $a_size "big" | "small" */ function _lookupIconPath($a_id, $a_size = "big") { if ($a_size == "") { $a_size = "big"; } $size = $a_size; if (ilContainer::_lookupContainerSetting($a_id, "icon_custom")) { $cont_dir = ilContainer::_getContainerDirectory($a_id); $file_name = $cont_dir . "/icon_custom.svg"; if (is_file($file_name)) { return $file_name; } } return ""; }
/** * insert all commands into html code * * @access private * @param object $a_tpl template object * @param int $a_ref_id item reference id */ function insertCommands($a_use_asynch = false, $a_get_asynch_commands = false, $a_asynch_url = "", $a_header_actions = false) { global $lng, $ilUser; if (!$this->getCommandsStatus()) { return; } include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $this->current_selection_list = new ilAdvancedSelectionListGUI(); $this->current_selection_list->setAsynch($a_use_asynch && !$a_get_asynch_commands); $this->current_selection_list->setAsynchUrl($a_asynch_url); if ($a_header_actions) { $this->current_selection_list->setListTitle("<span class='hidden-xs'>" . $lng->txt("actions") . "</span>"); } else { $this->current_selection_list->setListTitle(""); } $this->current_selection_list->setId("act_" . $this->getUniqueItemId(false)); $this->current_selection_list->setSelectionHeaderClass("small"); $this->current_selection_list->setItemLinkClass("xsmall"); $this->current_selection_list->setLinksMode("il_ContainerItemCommand2"); $this->current_selection_list->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK); $this->current_selection_list->setUseImages(false); $this->current_selection_list->setAdditionalToggleElement($this->getUniqueItemId(true), "ilContainerListItemOuterHighlight"); include_once 'Services/Payment/classes/class.ilPaymentObject.php'; $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", $this->ref_id); // only standard command? $only_default = false; if ($a_use_asynch && !$a_get_asynch_commands) { $only_default = true; } $this->default_command = false; $this->prevent_duplicate_commands = array(); // we only allow the following commands inside the header actions $valid_header_commands = array("mount_webfolder"); $commands = $this->getCommands($this->ref_id, $this->obj_id); foreach ($commands as $command) { if ($a_header_actions && !in_array($command["cmd"], $valid_header_commands)) { continue; } if ($command["granted"] == true) { if (!$command["default"] === true) { if (!$this->std_cmd_only && !$only_default) { // workaround for repository frameset $command["link"] = $this->appendRepositoryFrameParameter($command["link"]); $cmd_link = $command["link"]; $txt = $command["lang_var"] == "" ? $command["txt"] : $this->lng->txt($command["lang_var"]); $this->insertCommand($cmd_link, $txt, $command["frame"], $command["img"], $command["cmd"]); } } else { $this->default_command = $this->createDefaultCommand($command); //$this->default_command = $command; } } elseif ($command["default"] === true) { $items =& $command["access_info"]; foreach ($items as $item) { if ($item["type"] == IL_NO_LICENSE) { $this->addCustomProperty($this->lng->txt("license"), $item["text"], true); $this->enableProperties(true); break; } } } } if (!$only_default) { // custom commands if (is_array($this->cust_commands)) { foreach ($this->cust_commands as $command) { $this->insertCommand($command["link"], $this->lng->txt($command["lang_var"]), $command["frame"], "", $command["cmd"], $command["onclick"]); } } // info screen commmand if ($this->getInfoScreenStatus()) { $this->insertInfoScreenCommand(); } if (!$this->isMode(IL_LIST_AS_TRIGGER)) { // edit timings if ($this->timings_enabled) { $this->insertTimingsCommand(); } // delete if ($this->delete_enabled) { $this->insertDeleteCommand(); } // link if ($this->link_enabled) { $this->insertLinkCommand(); } // cut if ($this->cut_enabled) { $this->insertCutCommand(); } // copy if ($this->copy_enabled) { $this->insertCopyCommand(); } // cut/copy from workspace to repository if ($this->repository_transfer_enabled) { $this->insertCutCommand(true); $this->insertCopyCommand(true); } // subscribe if ($this->subscribe_enabled) { $this->insertSubscribeCommand(); } // multi download if ($this->multi_download_enabled && $a_header_actions) { $this->insertMultiDownloadCommand(); } // BEGIN PATCH Lucene search if ($this->cut_enabled or $this->link_enabled) { $this->insertPasteCommand(); } // END PATCH Lucene Search if (IS_PAYMENT_ENABLED) { $this->insertPayment(); } } } // common social commands (comment, notes, tags) if (!$only_default && !$this->isMode(IL_LIST_AS_TRIGGER)) { $this->insertCommonSocialCommands($a_header_actions); } if (!$a_header_actions) { $this->ctrl->clearParametersByClass($this->gui_class_name); } // fix bug #12417 // there is one case, where no action menu should be displayed: // public area, category, no info tab // todo: make this faster and remove type specific implementation if possible if ($a_use_asynch && !$a_get_asynch_commands && !$a_header_actions) { if ($ilUser->getId() == ANONYMOUS_USER_ID && $this->type == "cat") { include_once "./Services/Container/classes/class.ilContainer.php"; include_once "./Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; if (!ilContainer::_lookupContainerSetting($this->obj_id, ilObjectServiceSettingsGUI::INFO_TAB_VISIBILITY, true)) { return; } } } if ($a_use_asynch && $a_get_asynch_commands) { return $this->current_selection_list->getHTML(true); } return $this->current_selection_list->getHTML(); }
/** * Init service settings form * @param ilPropertyFormGUI $form * @param type $services */ public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services) { global $ilSetting; // info tab if (in_array(self::INFO_TAB_VISIBILITY, $services)) { $info = new ilCheckboxInputGUI('', self::INFO_TAB_VISIBILITY); $info->setValue(1); $info->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::INFO_TAB_VISIBILITY, true)); $info->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_info_tab')); $form->addItem($info); } // calendar if (in_array(self::CALENDAR_VISIBILITY, $services)) { include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isEnabled()) { // Container tools (calendar, news, ... activation) $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY); $cal->setValue(1); include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php'; $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id)); $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar')); $form->addItem($cal); } } // news if (in_array(self::NEWS_VISIBILITY, $services)) { if ($ilSetting->get('block_activated_news')) { // Container tools (calendar, news, ... activation) $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY); $news->setValue(1); $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true))); $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news')); $form->addItem($news); } } // auto rating if (in_array(self::AUTO_RATING_NEW_OBJECTS, $services)) { $GLOBALS['lng']->loadLanguageModule("rating"); // auto rating for new objects $rate = new ilCheckboxInputGUI('', self::AUTO_RATING_NEW_OBJECTS); $rate->setValue(1); $rate->setOptionTitle($GLOBALS['lng']->txt('rating_new_objects_auto')); $rate->setInfo($GLOBALS['lng']->txt('rating_new_objects_auto_info')); $rate->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::AUTO_RATING_NEW_OBJECTS, false)); $form->addItem($rate); } return $form; }
/** * * @param type $a_obj_id */ public static function lookupCalendarActivated($a_obj_id) { if (!ilCalendarSettings::_getInstance()->isEnabled()) { return false; } $type = ilObject::_lookupType($a_obj_id); // lookup global setting $gl_activated = false; switch ($type) { case 'crs': $gl_activated = ilCalendarSettings::_getInstance()->isCourseCalendarEnabled(); break; case 'grp': $gl_activated = ilCalendarSettings::_getInstance()->isGroupCalendarEnabled(); break; default: return false; } // look individual object setting include_once './Services/Container/classes/class.ilContainer.php'; return ilContainer::_lookupContainerSetting($a_obj_id, 'cont_show_calendar', $gl_activated); }
function initEditForm() { $this->setEditTabs(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("repository")); // sorting include_once 'Services/Container/classes/class.ilContainerSortingSettings.php'; $settings = new ilContainerSortingSettings($this->object->getId()); $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting"); $sort_title = new ilRadioOption($this->lng->txt('sorting_title_header'), ilContainer::SORT_TITLE); $sort_title->setInfo($this->lng->txt('sorting_info_title')); $sort->addOption($sort_title); $sort_manual = new ilRadioOption($this->lng->txt('sorting_manual_header'), ilContainer::SORT_MANUAL); $sort_manual->setInfo($this->lng->txt('sorting_info_manual')); $sort->addOption($sort_manual); $sort->setValue($settings->getSortMode()); $form->addItem($sort); $this->showCustomIconsEditing(1, $form, false); $hide = new ilCheckboxInputGUI($this->lng->txt("cntr_hide_title_and_icon"), "hide_header_icon_and_title"); $hide->setChecked(ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title")); $form->addItem($hide); $form->addCommandButton("update", $this->lng->txt("save")); $form->addCommandButton("addTranslation", $this->lng->txt("add_translation")); return $form; }
/** * Check whether a block type is globally activated */ protected function isGloballyActivated($a_type) { global $ilSetting; if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) { if ($a_type == 'pdbookm') { if (!$ilSetting->get("disable_bookmarks")) { return true; } return false; } else { if ($a_type == 'pdnotes') { if (!$ilSetting->get("disable_notes")) { return true; } return false; } elseif ($a_type == 'news') { include_once 'Services/Container/classes/class.ilContainer.php'; return $ilSetting->get('block_activated_news') && ilContainer::_lookupContainerSetting($GLOBALS['ilCtrl']->getContextObjId(), 'cont_show_news', true); } else { if ($ilSetting->get("block_activated_" . $a_type)) { return true; } elseif ($a_type == 'cal') { include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; return ilCalendarSettings::lookupCalendarActivated($GLOBALS['ilCtrl']->getContextObjId()); } elseif ($a_type == 'pdcal') { include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; return ilCalendarSettings::_getInstance()->isEnabled(); } } } return false; } return true; }
/** * lookup icon path * * @param int $a_id container object id * @param string $a_size "big" | "small" */ function _lookupIconPath($a_id, $a_size = "big") { if ($a_size == "") { $a_size = "big"; } $size = $a_size; if (ilContainer::_lookupContainerSetting($a_id, "icon_" . $size)) { $cont_dir = ilContainer::_getContainerDirectory($a_id); // png version? (introduced with ILIAS 4.3) $file_name = $cont_dir . "/icon_" . $a_size . ".png"; if (is_file($file_name)) { return $file_name; } // gif version? (prior to ILIAS 4.3) $file_name = $cont_dir . "/icon_" . $a_size . ".gif"; if (is_file($file_name)) { return $file_name; } } return ""; }