当前位置: 首页>>代码示例>>PHP>>正文


PHP ilSetting::set方法代码示例

本文整理汇总了PHP中ilSetting::set方法的典型用法代码示例。如果您正苦于以下问题:PHP ilSetting::set方法的具体用法?PHP ilSetting::set怎么用?PHP ilSetting::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilSetting的用法示例。


在下文中一共展示了ilSetting::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLikeDeletion

 /**
  * @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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:13,代码来源:ilSettingTest.php

示例2: run

 public function run()
 {
     global $lng, $ilDB;
     $status = ilCronJobResult::STATUS_NO_ACTION;
     $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"];
         }
     }
     $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);
     return $result;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:52,代码来源:class.ilMembershipCronNotifications.php

示例3: __callStatic

 /**
  * @param string $name
  * @param array  $arguments
  * @return bool
  * @throws BadMethodCallException
  */
 public static function __callStatic($name, array $arguments = array())
 {
     if (strpos($name, 'isActiveFor') === 0 || strpos($name, 'setActiveFor') === 0) {
         $settings = new ilSetting('cptch');
         $supported_contexts = self::getSupportedContexts();
         $method_parts = explode('_', strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name)));
         $requested_context = strtolower($method_parts[count($method_parts) - 1]);
         if (!isset($requested_context, self::$context_map)) {
             throw new BadMethodCallException('Method ' . $name . ' called for a non existing context.');
         }
         if ('set' == $method_parts[0]) {
             $settings->set('activate_captcha_anonym_' . $supported_contexts[$requested_context], (int) $arguments[0]);
             return;
         } else {
             return self::checkFreetype() && (bool) $settings->get('activate_captcha_anonym_' . $supported_contexts[$requested_context], false);
         }
     } else {
         throw new BadMethodCallException('Call to an undefined static method ' . $name . ' in class ' . __CLASS__ . '.');
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilCaptchaUtil.php

示例4: saveClientSettings

 /**
  * Saves client settings fetched from $_POST
  *
  * @global ilCtrl2 $ilCtrl
  * @global ilLanguage $lng
  */
 public function saveClientSettings()
 {
     global $ilCtrl, $lng;
     require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
     $factory = new ilChatroomFormFactory();
     $form = $factory->getClientSettingsForm();
     if (!$form->checkInput()) {
         $form->setValuesByPost();
         return $this->clientsettings($form);
     }
     $settings = array('hash' => $_POST['name'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'user' => $_POST['user'], 'password' => $_POST['password'], 'client' => CLIENT_ID, 'enable_osd' => (bool) $_POST['enable_osd'], 'osd_intervall' => (int) $_POST['osd_intervall'], 'chat_enabled' => (bool) $_POST['chat_enabled'] && (bool) $this->commonSettings->get('soap_user_administration'), 'enable_smilies' => (bool) $_POST['enable_smilies'], 'play_invitation_sound' => (bool) $_POST['play_invitation_sound']);
     $notificationSettings = new ilSetting('notifications');
     $notificationSettings->set('osd_polling_intervall', (int) $_POST['osd_intervall']);
     $notificationSettings->set('enable_osd', (bool) $_POST['enable_osd']);
     $chatSettings = new ilSetting('chatroom');
     $chatSettings->set('chat_enabled', $settings['chat_enabled']);
     $chatSettings->set('play_invitation_sound', (bool) $_POST['play_invitation_sound']);
     require_once 'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
     $adminSettings = new ilChatroomAdmin($this->gui->object->getId());
     $adminSettings->saveClientSettings((object) $settings);
     $this->writeClientSettingsToFile($settings);
     ilUtil::sendSuccess($lng->txt('settings_has_been_saved'), true);
     $ilCtrl->redirect($this->gui, 'view-clientsettings');
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:30,代码来源:class.ilChatroomViewTask.php

示例5: array

if ($ilDB->tableColumnExists('svy_qst_sc', 'other_answer_label')) {
    $ilDB->dropTableColumn('svy_qst_sc', 'other_answer_label');
}
?>
<#2946>
<?php 
$ilDB->addIndex('svy_category', array('other'), 'i2');
?>
<#2947>
<?php 
$feed_set = new ilSetting('feed');
$pxy_host = $feed_set->get('proxy');
$pxy_port = $feed_set->get('proxy_port');
$setting = new ilSetting();
if (strlen($pxy_host) && strlen($pxy_port)) {
    $setting->set('proxy_host', $pxy_host);
    $setting->set('proxy_port', $pxy_port);
    $setting->set('proxy_status', 1);
} else {
    $setting->set('proxy_host', '');
    $setting->set('proxy_port', '');
    $setting->set('proxy_status', 0);
}
$feed_set->delete('proxy');
$feed_set->delete('proxy_port');
?>
<#2948>
<?php 
// FILE ENDS HERE, DO NOT ADD ANY ADDITIONAL STEPS
//
//         USE dbupdate_03.php INSTEAD
开发者ID:arlendotcn,项目名称:ilias,代码行数:31,代码来源:dbupdate_02.php

示例6: clearRunningStatus

 /**
  * Clear running status
  */
 function clearRunningStatus()
 {
     include_once './Services/Administration/classes/class.ilSetting.php';
     $set = new ilSetting("common", true);
     $set->set("db_update_running", 0);
     $this->db_update_running = 0;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:10,代码来源:class.ilDBUpdate.php

示例7: saveGeneralSettingsObject

 function saveGeneralSettingsObject()
 {
     require_once 'Services/Notifications/classes/class.ilNotificationAdminSettingsForm.php';
     #require_once 'Services/Administration/classes/class.ilSetting.php';
     $settings = new ilSetting('notifications');
     $form = ilNotificationAdminSettingsForm::getGeneralSettingsForm();
     $form->setValuesByPost();
     if (!$form->checkInput()) {
         $this->showGeneralSettingsObject($form);
     } else {
         /**
          * @todo dirty...
          * 
          * push all notifiation settings to the form to enable custom
          * settings per channel
          */
         $values = $form->store_values;
         //array('enable_osd', 'osd_polling_intervall', 'enable_mail');
         // handle custom channel settings
         foreach ($values as $v) {
             $settings->set($v, $_POST[$v]);
         }
         foreach ($_REQUEST['notifications'] as $type => $value) {
             ilNotificationDatabaseHandler::setConfigTypeForChannel($type, $value);
         }
         $this->showGeneralSettingsObject();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:28,代码来源:class.ilObjNotificationAdminGUI.php

示例8: write

 /**
  * write object data into db
  * @param	boolean
  */
 private function write()
 {
     global $ilClientIniFile;
     // Clear any old error messages
     $ilClientIniFile->error(null);
     if (!$ilClientIniFile->groupExists('file_access')) {
         $ilClientIniFile->addGroup('file_access');
     }
     $ilClientIniFile->setVariable('file_access', 'webdav_enabled', $this->webdavEnabled ? '1' : '0');
     $ilClientIniFile->setVariable('file_access', 'webdav_actions_visible', $this->webdavActionsVisible ? '1' : '0');
     $ilClientIniFile->setVariable('file_access', 'download_with_uploaded_filename', $this->downloadWithUploadedFilename ? '1' : '0');
     $ilClientIniFile->write();
     if ($ilClientIniFile->getError()) {
         global $ilErr;
         $ilErr->raiseError($ilClientIniFile->getError(), $ilErr->WARNING);
     }
     require_once 'Services/Administration/classes/class.ilSetting.php';
     $settings = new ilSetting('file_access');
     $settings->set('inline_file_extensions', $this->inlineFileExtensions);
     $settings->set('custom_webfolder_instructions_enabled', $this->customWebfolderInstructionsEnabled ? '1' : '0');
     $settings->set('custom_webfolder_instructions', $this->customWebfolderInstructions);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilObjFileAccessSettings.php

示例9: saveSettings

 /**
  * Save settings
  */
 public function saveSettings()
 {
     global $ilCtrl;
     $this->checkPermission("write");
     $form = $this->initFormSettings();
     if ($form->checkInput()) {
         $banner = (bool) $form->getInput("banner");
         $blga_set = new ilSetting("blga");
         $blga_set->set("banner", $banner);
         $blga_set->set("banner_width", (int) $form->getInput("width"));
         $blga_set->set("banner_height", (int) $form->getInput("height"));
         $blga_set->set("mask", (bool) $form->getInput("mask"));
         ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
         $ilCtrl->redirect($this, "editSettings");
     }
     $form->setValuesByPost();
     $this->editSettings($form);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:21,代码来源:class.ilObjBlogAdministrationGUI.php

示例10: saveSettings

 /**
  * Save personal desktop settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $pd_set = new ilSetting("pd");
     ilCalendarSettings::_getInstance()->setEnabled($_POST["enable_calendar"]);
     ilCalendarSettings::_getInstance()->save();
     #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
     $ilSetting->set("disable_bookmarks", (int) ($_POST["enable_bookmarks"] ? 0 : 1));
     $ilSetting->set("disable_contacts", (int) ($_POST["enable_contacts"] ? 0 : 1));
     $ilSetting->set("disable_contacts_require_mail", (int) ($_POST["enable_contacts_require_mail"] ? 0 : 1));
     $ilSetting->set("disable_notes", (int) ($_POST["enable_notes"] ? 0 : 1));
     $ilSetting->set("disable_comments", (int) ($_POST["enable_comments"] ? 0 : 1));
     $ilSetting->set("comments_del_user", (int) ($_POST["comm_del_user"] ? 1 : 0));
     $ilSetting->set("comments_del_tutor", (int) ($_POST["comm_del_tutor"] ? 1 : 0));
     $ilSetting->set("block_activated_chatviewer", (int) $_POST["block_activated_chatviewer"]);
     $ilSetting->set("block_activated_pdusers", $_POST["block_activated_pdusers"]);
     $pd_set->set("enable_block_moving", $_POST["enable_block_moving"]);
     $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
     $pd_set->set("osi_host", $_POST["osi_host"]);
     // Validate personal desktop view
     if (!(int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         ilUtil::sendFailure($this->lng->txt('pd_view_select_at_least_one'), true);
         $ilCtrl->redirect($this, 'view');
     }
     // Enable 'My Offers' (default personal items)
     $ilSetting->set('disable_my_offers', (int) ($_POST['enable_my_offers'] ? 0 : 1));
     // Enable 'My Memberships'
     $ilSetting->set('disable_my_memberships', (int) ($_POST['enable_my_memberships'] ? 0 : 1));
     if ((int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         $_POST['personal_items_default_view'] = 0;
     } else {
         if (!(int) $_POST['enable_my_offers'] && (int) $_POST['enable_my_memberships']) {
             $_POST['personal_items_default_view'] = 1;
         } else {
             if (!isset($_POST['personal_items_default_view'])) {
                 $_POST['personal_items_default_view'] = $ilSetting->get('personal_items_default_view');
             }
         }
     }
     // Default view of personal items
     $ilSetting->set('personal_items_default_view', (int) $_POST['personal_items_default_view']);
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:47,代码来源:class.ilObjPersonalDesktopSettingsGUI.php

示例11: ilSetting

 /**
  * Set the manual scoring settings
  *
  * @param array $type_ids An array containing the database ids of the question types which could be scored manually
  */
 function _setManualScoring($type_ids)
 {
     $setting = new ilSetting("assessment");
     if (!is_array($type_ids) || count($type_ids) == 0) {
         $setting->delete("assessment_manual_scoring");
     } else {
         $setting->set("assessment_manual_scoring", implode($type_ids, ","));
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:14,代码来源:class.ilObjAssessmentFolder.php

示例12: saveSettings

 /**
  * Save settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $this->checkPermission("write");
     $frma_set = new ilSetting("frma");
     $frma_set->set("forum_overview", ilUtil::stripSlashes($_POST["forum_overview"]));
     if (isset($_POST['anonymous_fora'])) {
         $ilSetting->set('enable_anonymous_fora', 1);
     } else {
         $ilSetting->set('enable_anonymous_fora', 0);
     }
     if (isset($_POST['fora_statistics'])) {
         $ilSetting->set('enable_fora_statistics', 1);
     } else {
         $ilSetting->set('enable_fora_statistics', 0);
     }
     $ilSetting->set('forum_notification', ilUtil::stripSlashes($_POST["forum_notification"]));
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:23,代码来源:class.ilObjForumAdministrationGUI.php

示例13: setScormDebug

 function setScormDebug($a_key, $a_val)
 {
     global $ilDB;
     if ($a_val != "1") {
         $ilDB->query("UPDATE sahs_lm SET debug = 'n'");
     }
     $setreturn = ilSetting::set($a_key, $a_val);
     return $setreturn;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:9,代码来源:class.ilSetting.php

示例14: save

 public function save()
 {
     $form_settings = new ilSetting("certificate");
     $form_settings->set("pageformat", $_POST["pageformat"]);
     $form_settings->set("active", $_POST["active"]);
     ilUtil::sendSuccess($this->lng->txt("settings_saved"));
     $this->settings();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:8,代码来源:class.ilObjCertificateSettingsGUI.php

示例15: saveSettings

 /**
  * Save news and external webfeeds settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $pd_set = new ilSetting("pd");
     ilCalendarSettings::_getInstance()->setEnabled($_POST["enable_calendar"]);
     ilCalendarSettings::_getInstance()->save();
     #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
     $ilSetting->set("disable_bookmarks", (int) ($_POST["enable_bookmarks"] ? 0 : 1));
     $ilSetting->set("disable_contacts", (int) ($_POST["enable_contacts"] ? 0 : 1));
     $ilSetting->set("disable_contacts_require_mail", (int) ($_POST["enable_contacts_require_mail"] ? 0 : 1));
     $ilSetting->set("disable_notes", (int) ($_POST["enable_notes"] ? 0 : 1));
     $ilSetting->set("disable_comments", (int) ($_POST["enable_comments"] ? 0 : 1));
     $ilSetting->set("block_activated_chatviewer", (int) $_POST["block_activated_chatviewer"]);
     $ilSetting->set("block_activated_pdusers", $_POST["block_activated_pdusers"]);
     $pd_set->set("enable_block_moving", $_POST["enable_block_moving"]);
     $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
     $pd_set->set("osi_host", $_POST["osi_host"]);
     // Validate personal desktop view
     if (!(int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         ilUtil::sendFailure($this->lng->txt('pd_view_select_at_least_one'), true);
         $ilCtrl->redirect($this, 'view');
     }
     // Enable 'My Offers' (default personal items)
     $ilSetting->set('disable_my_offers', (int) ($_POST['enable_my_offers'] ? 0 : 1));
     // Enable 'My Memberships'
     $ilSetting->set('disable_my_memberships', (int) ($_POST['enable_my_memberships'] ? 0 : 1));
     if ((int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         $_POST['personal_items_default_view'] = 0;
     } else {
         if (!(int) $_POST['enable_my_offers'] && (int) $_POST['enable_my_memberships']) {
             $_POST['personal_items_default_view'] = 1;
         } else {
             if (!isset($_POST['personal_items_default_view'])) {
                 $_POST['personal_items_default_view'] = $ilSetting->get('personal_items_default_view');
             }
         }
     }
     // Default view of personal items
     $ilSetting->set('personal_items_default_view', (int) $_POST['personal_items_default_view']);
     // without personal workspace we have to disable to sub-items
     if (!$_POST["wsp"]) {
         $_POST["blog"] = 0;
         $_POST["file"] = 0;
         $_POST["cert"] = 0;
         $_POST["link"] = 0;
     }
     $ilSetting->set('disable_personal_workspace', (int) ($_POST['wsp'] ? 0 : 1));
     $ilSetting->set('disable_wsp_blogs', (int) ($_POST['blog'] ? 0 : 1));
     $ilSetting->set('disable_wsp_files', (int) ($_POST['file'] ? 0 : 1));
     $ilSetting->set('disable_wsp_certificates', (int) ($_POST['cert'] ? 0 : 1));
     $ilSetting->set('disable_wsp_links', (int) ($_POST['link'] ? 0 : 1));
     $ilSetting->set('user_portfolios', (int) ($_POST['prtf'] ? 1 : 0));
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:58,代码来源:class.ilObjPersonalDesktopSettingsGUI.php


注:本文中的ilSetting::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。