/**
  * 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;
 }
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  * 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;
 }