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


PHP Settings::saveSettings方法代码示例

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


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

示例1: saveSettings

function saveSettings()
{
    global $error;
    global $obj_smarty;
    // add the checkbox fields here
    $arr_submit = array(array('show_description_field', 'string', false, 'off'), array('show_location_field', 'string', false, 'off'), array('show_phone_field', 'string', false, 'off'), array('show_url_field', 'string', false, 'off'), array('show_am_pm', 'string', false, 'off'), array('show_delete_confirm_dialog', 'string', false, 'off'), array('truncate_title', 'string', false, 'off'), array('show_notallowed_messages', 'string', false, 'off'), array('show_weeknumbers', 'string', false, 'off'), array('show_public_and_private_separately', 'string', false, 'off'));
    $int_user_id = $_POST['user_id'];
    foreach ($_POST as $key => $param) {
        if (!empty($key) && $key != 'save-settings' && $key != 'user_id') {
            $arr_submit[] = array($key, 'string', false, $param);
            $_REQUEST[$key] = $param;
        }
    }
    unset($_REQUEST['params']);
    $frm_submitted = validate_var($arr_submit);
    $arr_user = User::getUser();
    if (!$error) {
        if ($int_user_id == $arr_user['user_id']) {
            unset($frm_submitted['user_id']);
            Settings::saveSettings($frm_submitted, '', $arr_user['user_id']);
            $obj_smarty->assign('save_settings_success', 'Saved succesfully');
            //header('location: '.FULLCAL_URL.'/admin/settings');
            //exit;
        } else {
            $obj_smarty->assign('save_settings_error', 'NO rights to do that');
        }
    } else {
        $obj_smarty->assign('save_settings_error', $error);
    }
    $obj_smarty->assign('active', 'settings');
    $obj_smarty->assign('settings', Settings::getSettings($arr_user['user_id']));
    $obj_smarty->display(FULLCAL_DIR . '/view/user_panel.tpl');
    exit;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:34,代码来源:index.php

示例2: saveSettings

function saveSettings()
{
    global $error;
    User::checkLoggedIn();
    global $error;
    $arr_submit = array(array('language', 'string', false, ''), array('other_language', 'string', false, ''), array('default_view', 'string', false, ''), array('timezone', 'string', false, ''), array('user_id', 'int', true, ''));
    $frm_submitted = validate_var($arr_submit);
    if (!$error) {
        $arr_user = User::getUser();
        if ($frm_submitted['user_id'] == $arr_user['user_id']) {
            unset($frm_submitted['user_id']);
            Settings::saveSettings($frm_submitted, '', $arr_user['user_id']);
        } else {
            echo json_encode(array('success' => false, 'error' => 'NO rights to do that'));
            exit;
        }
    } else {
        echo json_encode(array('success' => false, 'error' => $error));
        exit;
    }
    echo json_encode(array('success' => true));
    exit;
    //$obj_smarty->assign('active', 'settings');
    //$obj_smarty->assign('settings', Settings::getSettings($arr_user['user_id']));
    //$obj_smarty->display(FULLCAL_DIR.'/view/user_panel.tpl');
    //exit;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:27,代码来源:index.php

示例3: saveSettings

 public function saveSettings($arSettings)
 {
     $this->_Settings->saveSettings($arSettings);
 }
开发者ID:OpenBX,项目名称:obx.core,代码行数:4,代码来源:tab.php

示例4: getPostValue

 // Create tables
 $dbi->createTables($dbTableDefs);
 // Get language
 $language = getPostValue("language");
 if (empty($language)) {
     $language = "en";
 }
 // Save page settings
 $settings = new Settings();
 $settings->title = $_POST["title"];
 $settings->adminMail = $_POST["email"];
 $settings->theme = "cmis";
 $settings->subtheme = "blue";
 $settings->iconTheme = "default";
 $settings->language = $language;
 $settings->saveSettings(false);
 // Define pageLanguage
 define("pageLanguage", $settings->language);
 define("pageTitle", $settings->title);
 define("pageAdminMail", $settings->adminMail);
 // Create new user
 $result = $dbi->query("SELECT id FROM " . userTableName . " WHERE username=" . $dbi->quote($_POST["username"]));
 if ($result->rows()) {
     list($userId) = $result->fetchrow_array();
     $dbi->query("UPDATE " . dbPrefix . "user SET password=" . $dbi->quote(md5(trim($_POST["password"]))) . ",administrator=1,webmaster=1,activated=1 WHERE id=" . $dbi->quote($userId));
     $dbi->query("UPDATE " . dbPrefix . "userData SET name=" . $dbi->quote($_POST["name"]) . ",email=" . $dbi->quote($_POST["email"]) . " WHERE id=" . $dbi->quote($userId));
 } else {
     $dbi->query("INSERT INTO " . dbPrefix . "user(username,password,administrator,webmaster,activated) VALUES(" . $dbi->quote($_POST["username"]) . "," . $dbi->quote(md5(trim($_POST["password"]))) . ",'1','1','1')");
     $userId = $dbi->getInsertId();
     $dbi->query("INSERT INTO " . dbPrefix . "userData (id,name,email) VALUES(" . $dbi->quote($userId) . "," . $dbi->quote($_POST["name"]) . "," . $dbi->quote($_POST["email"]) . ")");
 }
开发者ID:gkathir15,项目名称:catmis,代码行数:31,代码来源:complete.php


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