/**
  * Constructor
  *
  * @param int $a_node
  * @param object $a_access_handler
  * @param int $a_id
  * @param int $a_old_nr
  * @param bool $a_enable_notes
  * @param bool $a_may_contribute
  * @return ilBlogPostingGUI
  */
 function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true)
 {
     global $tpl, $lng;
     $lng->loadLanguageModule("blog");
     $this->node_id = $a_node_id;
     $this->access_handler = $a_access_handler;
     $this->enable_public_notes = (bool) $a_enable_public_notes;
     parent::__construct("blp", $a_id, $a_old_nr);
     // #11151
     $this->may_contribute = (bool) $a_may_contribute;
     $this->setEnableEditing($a_may_contribute);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // #11190
     $blga_set = new ilSetting("blga");
     $this->setPreventHTMLUnmasking((bool) $blga_set->get("mask", false));
     $this->setEnabledMaps(true);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledWikiLinks(false);
     $this->setEnabledPCTabs(true);
     $this->setEnabledActivation(true);
 }
 protected function exportActiveIDs()
 {
     global $ilDB, $ilSetting;
     include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
     $assessmentSetting = new ilSetting("assessment");
     $user_criteria = $assessmentSetting->get("user_criteria");
     if (strlen($user_criteria) == 0) {
         $user_criteria = 'usr_id';
     }
     if ($this->anonymized) {
         $result = $ilDB->queryF("SELECT * FROM tst_active WHERE test_fi = %s", array('integer'), array($this->test_id));
     } else {
         $result = $ilDB->queryF("SELECT tst_active.*, usr_data." . $user_criteria . " FROM tst_active, usr_data WHERE tst_active.test_fi = %s AND tst_active.user_fi = usr_data.usr_id", array('integer'), array($this->test_id));
     }
     $this->xmlStartTag("tst_active", NULL);
     while ($row = $ilDB->fetchAssoc($result)) {
         $attrs = array('active_id' => $row['active_id'], 'user_fi' => $row['user_fi'], 'anonymous_id' => $row['anonymous_id'], 'test_fi' => $row['test_fi'], 'lastindex' => $row['lastindex'], 'tries' => $row['tries'], 'submitted' => $row['submitted'], 'submittimestamp' => $row['submittimestamp'], 'tstamp' => $row['tstamp']);
         $attrs['fullname'] = ilObjTestAccess::_getParticipantData($row['active_id']);
         if (!$this->anonymized) {
             $attrs['user_criteria'] = $user_criteria;
             $attrs[$user_criteria] = $row[$user_criteria];
         }
         array_push($this->active_ids, $row['active_id']);
         $this->xmlElement("row", $attrs);
     }
     $this->xmlEndTag("tst_active");
 }
 /**
  * Init
  */
 function init()
 {
     global $ilSetting, $rbacsystem;
     $prfa_set = new ilSetting("prfa");
     $this->setPreventHTMLUnmasking(!(bool) $prfa_set->get("mask", false));
     $this->setEnableInternalLinks(false);
     $this->setEnablePCType("Profile", true);
     if (!$ilSetting->get('disable_wsp_certificates')) {
         $this->setEnablePCType("Verification", true);
     }
     $skmg_set = new ilSetting("skmg");
     if ($skmg_set->get("enable_skmg")) {
         $this->setEnablePCType("Skills", true);
     }
     include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
     $settings = ilCalendarSettings::_getInstance();
     if ($settings->isEnabled() && $rbacsystem->checkAccess('add_consultation_hours', $settings->getCalendarSettingsId()) && $settings->areConsultationHoursEnabled()) {
         $this->setEnablePCType("ConsultationHours", true);
     }
     $prfa_set = new ilSetting("prfa");
     if ($prfa_set->get("mycrs", true)) {
         $this->setEnablePCType("MyCourses", true);
     }
     // patch optes begin (no trunk)
     $mset = new ilSetting("mobs");
     if ($mset->get("mep_activate_pages")) {
         $this->setEnablePCType("ContentInclude", true);
     }
     // patch optes end (no trunk)
 }
 /**
  * Get node icon
  *
  * @param array $a_node node array
  * @return string icon path
  */
 function getNodeIcon($a_node)
 {
     if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
         $icon = ilUtil::getImagePath("icon_lm.svg");
     } else {
         $a_name = "icon_" . $a_node["type"] . ".svg";
         if ($a_node["type"] == "pg") {
             include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
             $lm_set = new ilSetting("lm");
             $active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(), $lm_set->get("time_scheduled_page_activation"));
             // is page scheduled?
             $img_sc = $lm_set->get("time_scheduled_page_activation") && ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()) ? "_sc" : "";
             $a_name = "icon_pg" . $img_sc . ".svg";
             if (!$active) {
                 $a_name = "icon_pg_d" . $img_sc . ".svg";
             } else {
                 include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
                 $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_node["child"], $this->lm->getType());
                 if ($contains_dis) {
                     $a_name = "icon_pg_del" . $img_sc . ".svg";
                 }
             }
         }
         $icon = ilUtil::getImagePath($a_name);
     }
     return $icon;
 }
 /**
  * Constructor
  */
 function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true)
 {
     global $tpl, $ilSetting;
     $this->portfolio_id = (int) $a_portfolio_id;
     $this->enable_comments = (bool) $a_enable_comments;
     parent::__construct("prtf", $a_id, $a_old_nr);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // #11190
     $prfa_set = new ilSetting("prfa");
     $this->setPreventHTMLUnmasking((bool) $prfa_set->get("mask", false));
     // $this->setEnabledMaps(true);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledPCTabs(true);
     $this->setEnabledProfile(true);
     if (!$ilSetting->get('disable_wsp_certificates')) {
         $this->setEnabledVerification(true);
     }
     /* embedding blog postings currently disabled 
     		if(!$ilSetting->get('disable_wsp_blogs'))
     		{
     			$this->setEnabledBlog(true);
     		}		
     		*/
     $skmg_set = new ilSetting("skmg");
     if ($skmg_set->get("enable_skmg")) {
         $this->setEnabledSkills(true);
     }
 }
 /**
  * Private constructor
  */
 private function __construct()
 {
     $this->settings = new ilSetting("fileupload");
     $this->dndUploadEnabled = $this->settings->get("dnd_upload_enabled", true) == true;
     $this->repositoryDndUploadEnabled = $this->settings->get("repository_dnd_upload_enabled", true) == true;
     $this->concurrentUploads = $this->settings->get("concurrent_upload_count", self::CONCURRENT_UPLOADS_DEFAULT);
 }
 /**
  * Prepares and displays settings form.
  * @param ilPropertyFormGUI $settingsForm
  */
 public function general(ilPropertyFormGUI $settingsForm = null)
 {
     /**
      * @var $lng    ilLanguage
      * @var $tpl    ilTemplate
      * @var $ilCtrl ilCtrl
      */
     global $lng, $tpl, $ilCtrl;
     if (!ilChatroom::checkUserPermissions(array('read', 'write'), $this->gui->ref_id)) {
         $ilCtrl->setParameterByClass('ilrepositorygui', 'ref_id', ROOT_FOLDER_ID);
         $ilCtrl->redirectByClass('ilrepositorygui', '');
     }
     $chatSettings = new ilSetting('chatroom');
     if (!$chatSettings->get('chat_enabled')) {
         ilUtil::sendInfo($lng->txt('server_disabled'), true);
     }
     $this->gui->switchToVisibleMode();
     $formFactory = new ilChatroomFormFactory();
     if (!$settingsForm) {
         $settingsForm = $formFactory->getSettingsForm();
     }
     $room = ilChatRoom::byObjectId($this->gui->object->getId());
     $settings = array('title' => $this->gui->object->getTitle(), 'desc' => $this->gui->object->getDescription());
     if ($room) {
         ilChatroomFormFactory::applyValues($settingsForm, array_merge($settings, $room->getSettings()));
     } else {
         ilChatroomFormFactory::applyValues($settingsForm, $settings);
     }
     $settingsForm->setTitle($lng->txt('settings_title'));
     $settingsForm->addCommandButton('settings-saveGeneral', $lng->txt('save'));
     $settingsForm->setFormAction($ilCtrl->getFormAction($this->gui, 'settings-saveGeneral'));
     $tpl->setVariable('ADM_CONTENT', $settingsForm->getHtml());
 }
 /**
  * @return string
  */
 public function getHTML()
 {
     global $tpl, $ilTabs, $ilCtrl, $lng;
     $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
 }
 /**
  * get image path (may be overwritten by derived classes)
  */
 function getImage($a_name, $a_type = "", $a_id = "")
 {
     // overwrite chapter icons with lp info?
     if (!$this->offlineMode() && $a_type == "st") {
         $icon = $this->checkLPIcon($a_id);
         if ($icon) {
             return $icon;
         }
     }
     include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
     if ($a_type == "pg") {
         include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
         $lm_set = new ilSetting("lm");
         $active = ilLMPage::_lookupActive($a_id, $this->lm_obj->getType(), $lm_set->get("time_scheduled_page_activation"));
         // is page scheduled?
         $img_sc = $lm_set->get("time_scheduled_page_activation") && ilLMPage::_isScheduledActivation($a_id, $this->lm_obj->getType()) ? "_sc" : "";
         $a_name = "icon_pg" . $img_sc . "_s.png";
         if (!$active) {
             $a_name = "icon_pg_d" . $img_sc . "_s.png";
         } else {
             $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_id, $this->lm_obj->getType());
             if ($contains_dis) {
                 $a_name = "icon_pg_del" . $img_sc . "_s.png";
             }
         }
     }
     return ilUtil::getImagePath($a_name, false, "output", $this->offlineMode());
 }
 /**
  * Static getter. Returns true, if disk quota summary mails are active.
  *
  * Summary mails are active if the variable "summary_mail_enabled"
  * is set in ilSetting('disk_quota')
  *
  * @return	boolean	value
  */
 public static function _isSummaryMailActive()
 {
     if (self::$isSummaryMailActive == null) {
         $settings = new ilSetting('disk_quota');
         self::$isSummaryMailActive = self::_isActive() && (int) $settings->get('summary_mail_enabled') == 1;
     }
     return self::$isSummaryMailActive;
 }
Beispiel #11
0
 /**
  * Constructor
  * @access	public
  * @param	integer	reference_id or object_id
  * @param	boolean	treat the id as reference_id (true) or object_id (false)
  */
 function ilObjMediaCast($a_id = 0, $a_call_by_reference = true)
 {
     $this->type = "mcst";
     $this->ilObject($a_id, $a_call_by_reference);
     $mcst_set = new ilSetting("mcst");
     $this->setDefaultAccess($mcst_set->get("defaultaccess") == "users" ? 0 : 1);
     $this->setOrder(self::ORDER_CREATION_DATE_DESC);
 }
 public function run()
 {
     global $lng, $ilDB;
     $status = ilCronJobResult::STATUS_NO_ACTION;
     $status_details = null;
     $setting = new ilSetting("cron");
     $last_run = $setting->get(get_class($this));
     // #10284 - we already did send today, do nothing
     if ($last_run == date("Y-m-d")) {
         // #14005
         $status_details = "Did already run today.";
     } else {
         // gather objects and participants with notification setting
         $objects = array();
         $set = $ilDB->query("SELECT usr_id,keyword FROM usr_pref" . " WHERE " . $ilDB->like("keyword", "text", "grpcrs_ntf_%") . " AND value = " . $ilDB->quote("1", "text"));
         while ($row = $ilDB->fetchAssoc($set)) {
             $ref_id = substr($row["keyword"], 11);
             $type = ilObject::_lookupType($ref_id, true);
             if ($type) {
                 $objects[$type][$ref_id][] = $row["usr_id"];
             }
         }
         $counter = 0;
         if (sizeof($objects)) {
             $old_lng = $lng;
             include_once "Services/News/classes/class.ilNewsItem.php";
             foreach ($objects as $type => $ref_ids) {
                 // type is not needed for now
                 foreach ($ref_ids as $ref_id => $user_ids) {
                     // gather news per object
                     $news_item = new ilNewsItem();
                     if ($news_item->checkNewsExistsForGroupCourse($ref_id)) {
                         foreach ($user_ids as $user_id) {
                             // gather news for user
                             $user_news = $news_item->getNewsForRefId($ref_id, false, false, 1, false, false, false, false, $user_id);
                             if ($user_news) {
                                 $this->sendMail($user_id, $ref_id, $user_news);
                                 $counter++;
                             }
                         }
                     }
                 }
             }
             $lng = $old_lng;
         }
         // save last run
         $setting->set(get_class($this), date("Y-m-d"));
         if ($counter) {
             $status = ilCronJobResult::STATUS_OK;
         }
     }
     $result = new ilCronJobResult();
     $result->setStatus($status);
     if ($status_details) {
         $result->setMessage($status_details);
     }
     return $result;
 }
 /**
  * Init
  */
 function init()
 {
     $this->setEnablePCType("Map", true);
     $this->setEnableInternalLinks(false);
     $this->setPreventHTMLUnmasking(false);
     $this->setEnableActivation(true);
     $blga_set = new ilSetting("blga");
     $this->setPreventHTMLUnmasking((bool) $blga_set->get("mask", false));
 }
 /**
  * @return string
  */
 public function getHTML()
 {
     ilYuiUtil::initJson();
     $chatSetting = new ilSetting('chatroom');
     if ($this->getCurrentDetailLevel() == 0 || !$chatSetting->get('chat_enabled', 0) || !(bool) @ilChatroomServerConnector::checkServerConnection()) {
         return '';
     } else {
         return parent::getHTML();
     }
 }
Beispiel #15
0
 /**
  * Constructor
  *
  * @param
  * @return
  */
 function __construct()
 {
     global $ilSetting;
     $news_set = new ilSetting("news");
     $news_set->get("acc_cache_mins");
     parent::__construct("ServicesNews", "News", true);
     $this->setExpiresAfter($news_set->get("acc_cache_mins") * 60);
     if ((int) $news_set->get("acc_cache_mins") == 0) {
         self::$disabled = true;
     }
 }
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     // user
     if ($a_set["user_id"] > 0) {
         $this->tpl->setCurrentBlock("user_info");
         $user_obj = new ilObjUser($a_set["user_id"]);
         $this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
         $this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
         $this->tpl->parseCurrentBlock();
     }
     // access
     if ($enable_internal_rss) {
         $this->tpl->setCurrentBlock("access");
         $this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
         if ($a_set["visibility"] == NEWS_PUBLIC || $a_set["priority"] == 0 && ilBlockSetting::_lookup("news", "public_notifications", 0, $a_set["context_obj_id"])) {
             $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
         } else {
             $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
         }
         $this->tpl->parseCurrentBlock();
     }
     // last update
     if ($a_set["creation_date"] != $a_set["update_date"]) {
         $this->tpl->setCurrentBlock("ni_update");
         $this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
         $this->tpl->setVariable("VAL_LAST_UPDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME)));
         $this->tpl->parseCurrentBlock();
     }
     // creation date
     $this->tpl->setVariable("VAL_CREATION_DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["creation_date"], IL_CAL_DATETIME)));
     $this->tpl->setVariable("TXT_CREATED", $lng->txt("created"));
     // title
     $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
     // content
     if ($a_set["content"] != "") {
         $this->tpl->setCurrentBlock("content");
         $this->tpl->setVariable("VAL_CONTENT", ilUtil::shortenText($a_set["content"], 80, true, true), true);
         $this->tpl->parseCurrentBlock();
     }
     $perm_ref_id = $this->perm_ref_id > 0 ? $this->perm_ref_id : $a_set["ref_id"];
     if ($ilAccess->checkAccess("write", "", $perm_ref_id)) {
         $this->tpl->setCurrentBlock("edit");
         $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
         $ilCtrl->setParameterByClass("ilnewsitemgui", "news_item_id", $a_set["id"]);
         $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNewsItem"));
         $this->tpl->parseCurrentBlock();
     }
     // context
     $this->tpl->setVariable("CONTEXT", $lng->txt("obj_" . $a_set["context_obj_type"]) . ":<br />" . ilObject::_lookupTitle($a_set["context_obj_id"]));
     $this->tpl->setVariable("VAL_ID", $a_set["id"]);
 }
 /**
  * Builds $config and $commandparts arrays to assign them as parameters
  * when calling $this->buildTabs and $this->activateTab.
  * @param string     $command
  */
 public function getAdminTabsForCommand($command)
 {
     /**
      * @var $ilTabs ilTabsGUI
      * @var $ilCtrl ilCtrl
      * @var $ilDB   ilDB
      */
     global $ilTabs, $ilCtrl, $ilDB;
     $command = $this->convertLowerCamelCaseToUnderscoreCaseConversion($command);
     $stopCommands = array('create');
     if (in_array($command, $stopCommands)) {
         return;
     }
     $settings = new ilSetting('chatroom');
     $public_room_ref = $settings->get('public_room_ref');
     $query = 'SELECT ref_id FROM object_reference INNER JOIN object_data ON object_data.obj_id = object_reference.obj_id WHERE type = ' . $ilDB->quote('chta', 'text');
     $rset = $ilDB->query($query);
     $data = $ilDB->fetchAssoc($rset);
     $admin_ref = $data['ref_id'];
     $ilCtrl->setParameterByClass('ilObjChatroomAdminGUI', 'ref_id', $admin_ref);
     $config = array('view' => array('lng' => 'settings', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomAdminGUI', 'view-clientsettings'), 'permission' => 'read', 'subtabs' => array('clientsettings' => array('lng' => 'client_settings', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomAdminGUI', 'view-clientsettings'), 'permission' => 'read'), 'serversettings' => array('lng' => 'server_settings', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomAdminGUI', 'view-serversettings'), 'permission' => 'read'))), 'smiley' => array('lng' => 'smiley', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomAdminGUI', 'smiley'), 'permission' => 'read'));
     $ilCtrl->setParameterByClass('ilObjChatroomGUI', 'ref_id', $public_room_ref);
     $config['settings'] = array('lng' => 'public_chat_settings', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomGUI', 'settings-general'), 'permission' => 'write', 'subtabs' => array('settings' => array('lng' => 'settings', 'link' => $ilCtrl->getLinkTarget($this->gui, 'settings-general'), 'permission' => 'write'), 'ban' => array('lng' => 'bans', 'link' => $ilCtrl->getLinkTargetByClass('ilObjChatroomGUI', 'ban-show'), 'permission' => 'moderate')));
     $ilCtrl->setParameterByClass('ilPermissionGUI', 'ref_id', $public_room_ref);
     $config['perm'] = array('lng' => 'public_chat_permissions', 'link' => $ilCtrl->getLinkTargetByClass('ilPermissionGUI', 'perm'), 'permission' => 'write');
     $ilCtrl->clearParametersByClass('ilPermissionGUI');
     $ilCtrl->setParameterByClass('ilPermissionGUI', 'ref_id', $admin_ref);
     $config['perm_settings'] = array('lng' => 'perm_settings', 'link' => $ilCtrl->getLinkTargetByClass('ilpermissiongui', 'perm'), 'permission' => 'write');
     $ilCtrl->clearParametersByClass('ilPermissionGUI');
     $commandParts = explode('_', $command, 2);
     if ($command == 'ban_show') {
         $commandParts[0] = 'settings';
         $commandParts[1] = 'ban';
     } else {
         if ($command == 'settings_general') {
             $commandParts[0] = 'settings';
             $commandParts[1] = 'settings';
         } else {
             if ($ilCtrl->getCmdClass() == 'ilpermissiongui' && $_REQUEST['ref_id'] == $public_room_ref) {
                 $commandParts[0] = 'perm';
                 $ilCtrl->setParameterByClass('ilPermissionGUI', 'ref_id', $public_room_ref);
             } else {
                 if ($ilCtrl->getCmdClass() == 'ilpermissiongui' && $_REQUEST['ref_id'] == $admin_ref) {
                     $commandParts[0] = 'perm_settings';
                     $ilCtrl->setParameterByClass('ilPermissionGUI', 'ref_id', $admin_ref);
                 }
             }
         }
     }
     $this->buildTabs($ilTabs, $config, $commandParts);
     $this->activateTab($commandParts, $config);
 }
 /**
  * Get the directory with uploaded files
  *
  * The directory is configured as cont_upload_dir in the settings table.
  * The directory must exist and have read permissions.
  * Currently the user must have admin permissions in ILIAS.
  * Later there may be different directories for different users/roles.
  *
  * @return   string      full path of upload directory on the server or empty
  * @access   static
  */
 static function _getUploadDirectory()
 {
     global $rbacsystem;
     if (!$rbacsystem->checkAccess('write', SYSTEM_FOLDER_ID)) {
         return '';
     }
     $lm_set = new ilSetting("lm");
     $upload_dir = $lm_set->get("cont_upload_dir");
     if (is_dir($upload_dir) and is_readable($upload_dir)) {
         return $upload_dir;
     } else {
         return '';
     }
 }
 /**
  * Check, if licencing is enabled
  * This check is called from the ilAccessHandler class.
  *
  * @return   boolean     licensing enabled (true/false)
  */
 static function _isEnabled()
 {
     static $enabled;
     if (isset($enabled)) {
         return $enabled;
     }
     $lic_set = new ilSetting("license");
     if ($lic_set->get("license_counter")) {
         $enabled = true;
         return true;
     } else {
         $enabled = false;
         return false;
     }
 }
 /**
  *
  * Constructor
  * 
  * @access	public
  *
  */
 public function __construct()
 {
     $dqs = new ilSetting('disk_quota');
     $rcpt = $dqs->get('summary_rcpt');
     $rcpt = explode(',', $rcpt);
     $loginnames = array();
     foreach ($rcpt as $loginname) {
         $loginname = trim($loginname);
         if (ilObjUser::_lookupId($loginname)) {
             $loginnames[] = $loginname;
         }
     }
     $this->setRecipients($loginnames);
     parent::__construct();
 }
 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;
 }
 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
 {
     global $ilUser, $rbacsystem;
     if (self::$chat_enabled === null) {
         $chatSetting = new ilSetting('chatroom');
         self::$chat_enabled = (bool) $chatSetting->get('chat_enabled');
     }
     if ($a_user_id == "") {
         $a_user_id = $ilUser->getId();
     }
     if ($rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
         return true;
     }
     return self::$chat_enabled;
 }
 /**
  * Build export file
  *
  * @param
  * @return
  */
 function buildExportFile()
 {
     global $ilias;
     // create export file
     include_once "./Services/Export/classes/class.ilExport.php";
     ilExport::_createExportDirectory($this->object->getId(), "html", "prtf");
     $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf");
     $this->subdir = $this->object->getType() . "_" . $this->object->getId();
     $this->export_dir = $exp_dir . "/" . $this->subdir;
     // initialize temporary target directory
     ilUtil::delDir($this->export_dir);
     ilUtil::makeDir($this->export_dir);
     // system style html exporter
     include_once "./Services/Style/classes/class.ilSystemStyleHTMLExport.php";
     $this->sys_style_html_export = new ilSystemStyleHTMLExport($this->export_dir);
     // $this->sys_style_html_export->addImage("icon_prtf_b.png");
     $this->sys_style_html_export->export();
     // init co page html exporter
     include_once "./Services/COPage/classes/class.ilCOPageHTMLExport.php";
     $this->co_page_html_export = new ilCOPageHTMLExport($this->export_dir);
     /* $this->co_page_html_export->setContentStyleId(
     			$this->object->getStyleSheetId()); */
     $this->co_page_html_export->createDirectories();
     $this->co_page_html_export->exportStyles();
     $this->co_page_html_export->exportSupportScripts();
     // banner / profile picture
     $prfa_set = new ilSetting("prfa");
     if ($prfa_set->get("banner")) {
         $banner = $this->object->getImageFullPath();
         copy($banner, $this->export_dir . "/" . basename($banner));
     }
     $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "big");
     if ($ppic) {
         $ppic = array_shift(explode("?", $ppic));
         copy($ppic, $this->export_dir . "/" . basename($ppic));
     }
     // export pages
     $this->exportHTMLPages();
     // zip everything
     if (true) {
         // zip it all
         $date = time();
         $zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf") . "/" . $date . "__" . IL_INST_ID . "__" . $this->object->getType() . "_" . $this->object->getId() . ".zip";
         ilUtil::zip($this->export_dir, $zip_file);
         ilUtil::delDir($this->export_dir);
     }
     return $zip_file;
 }
 /**
  * List skills
  */
 function listSkills()
 {
     global $tpl, $ilToolbar, $ilCtrl, $lng, $ilTabs;
     $skmg_set = new ilSetting("skmg");
     $enable_skmg = $skmg_set->get("enable_skmg");
     if (!$enable_skmg) {
         ilUtil::sendInfo($lng->txt("skmg_skill_management_deactivated"));
     }
     $this->getParentGUI()->showTree(false, $this, "listSkills");
     $ilTabs->activateTab("skills");
     include_once "./Services/Skill/classes/class.ilSkillCategoryGUI.php";
     ilSkillCategoryGUI::addCreationButtons();
     include_once "./Services/Skill/classes/class.ilSkillCatTableGUI.php";
     $table = new ilSkillCatTableGUI($this, "listSkills", (int) $_GET["obj_id"], ilSkillCatTableGUI::MODE_SCAT);
     $tpl->setContent($table->getHTML());
 }
 /**
  * @param srCertificate $certificate
  */
 public function __construct(srCertificate $certificate)
 {
     parent::__construct($certificate);
     $this->setEmail(ilSetting::_lookupValue('common', 'admin_email'));
     $this->setSubject($this->pl->txt('disk_space_warning_mail_subject'));
     $this->setBody(sprintf($this->pl->txt('disk_space_warning_mail_message'), disk_free_space($this->certificate->getCertificatePath())));
 }
Beispiel #26
0
 /**
  * @group IL_Init
  */
 public function testLikeDeletion()
 {
     $set = new ilSetting("test_module3");
     $set->set("foo", "plus");
     $set->set("fooplus", "bar");
     $set->set("barplus", "foo");
     $set->deleteLike("foo%");
     $value = $set->get("foo") . "-" . $set->get("fooplus") . "-" . $set->get("barplus");
     $this->assertEquals("--foo", $value);
 }
 /**
  * Set Object.
  *
  * @param	int			$a_obj_id			Object ID
  * @param	string		$a_obj_type			Object Type
  * @param	int			$a_sub_obj_id		Subobject ID
  * @param	string		$a_sub_obj_type		Subobject Type
  */
 function setObject($a_obj_id, $a_obj_type, $a_sub_obj_id = 0, $a_sub_obj_type = "")
 {
     global $ilUser;
     $this->obj_id = $a_obj_id;
     $this->obj_type = $a_obj_type;
     $this->sub_obj_id = $a_sub_obj_id;
     $this->sub_obj_type = $a_sub_obj_type;
     $this->setSaveCmd("saveTags");
     $this->setUserId($ilUser->getId());
     $this->setInputFieldName("il_tags");
     $tags_set = new ilSetting("tags");
     $forbidden = $tags_set->get("forbidden_tags");
     if ($forbidden != "") {
         $this->forbidden = unserialize($forbidden);
     } else {
         $this->forbidden = array();
     }
 }
 /**
  * @param srCertificate $certificate
  * @param string $email
  */
 public function __construct(srCertificate $certificate, $email = '')
 {
     parent::__construct($certificate, $email);
     $this->setEmail(ilSetting::_lookupValue('common', 'admin_email'));
     $this->setSubject($this->pl->txt('cert_failed_subject'));
     $parser = srCertificatePlaceholdersParser::getInstance();
     $body = $parser->parse($this->pl->txt('cert_failed_message'), $this->certificate->getPlaceholders());
     $this->setBody($body);
 }
 public function sendNotifications()
 {
     global $ilDB, $lng;
     $setting = new ilSetting("cron");
     $last_run = $setting->get(get_class($this));
     // #10284 - we already did send today, do nothing
     if ($last_run == date("Y-m-d")) {
         return;
     }
     // gather objects and participants with notification setting
     $objects = array();
     $set = $ilDB->query("SELECT usr_id,keyword FROM usr_pref" . " WHERE " . $ilDB->like("keyword", "text", "grpcrs_ntf_%") . " AND value = " . $ilDB->quote("1", "text"));
     while ($row = $ilDB->fetchAssoc($set)) {
         $ref_id = substr($row["keyword"], 11);
         $type = ilObject::_lookupType($ref_id, true);
         if ($type) {
             $objects[$type][$ref_id][] = $row["usr_id"];
         }
     }
     if (sizeof($objects)) {
         $old_lng = $lng;
         include_once "Services/News/classes/class.ilNewsItem.php";
         foreach ($objects as $type => $ref_ids) {
             // type is not needed for now
             foreach ($ref_ids as $ref_id => $user_ids) {
                 // gather news per object
                 $news_item = new ilNewsItem();
                 if ($news_item->checkNewsExistsForGroupCourse($ref_id)) {
                     foreach ($user_ids as $user_id) {
                         // gather news for user
                         $user_news = $news_item->getNewsForRefId($ref_id, false, false, 1, false, false, false, false, $user_id);
                         if ($user_news) {
                             $this->sendMail($user_id, $ref_id, $user_news);
                         }
                     }
                 }
             }
         }
         $lng = $old_lng;
     }
     // save last run
     $setting->set(get_class($this), date("Y-m-d"));
     return true;
 }
 /**
  * Init
  */
 function init()
 {
     $this->setEnablePCType("Map", true);
     $this->setEnablePCType("Tabs", true);
     $this->setPreventHTMLUnmasking(true);
     $this->setEnableInternalLinks(true);
     $this->setEnableAnchors(true);
     $this->setEnableWikiLinks(true);
     $this->setIntLinkFilterWhiteList(true);
     $this->addIntLinkFilter("RepositoryItem");
     $this->addIntLinkFilter("WikiPage");
     $this->setIntLinkHelpDefaultType("RepositoryItem");
     $this->setEnablePCType("AMDPageList", true);
     // patch optes begin (no trunk)
     $mset = new ilSetting("mobs");
     if ($mset->get("mep_activate_pages")) {
         $this->setEnablePCType("ContentInclude", true);
     }
     // patch optes end (no trunk)
 }