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


PHP Setting::getById方法代码示例

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


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

示例1: deleteSetting

function deleteSetting()
{
    if (!($setting = Setting::getById((int) $_GET['settingId']))) {
        header("Location: index.php?action=listSetting&error=settingNotFound");
        return;
    }
    $setting->delete();
    header("Location: index.php?action=listSetting&success=settingDeleted");
}
开发者ID:sabasco,项目名称:gnscms,代码行数:9,代码来源:deleteSetting.php

示例2: editSetting

function editSetting()
{
    global $lang;
    $page_lang = scandir('inc/lang/' . $_SESSION['language']);
    foreach ($page_lang as $file) {
        if ($file != '.' && $file != '..') {
            $parts = explode(".", $file);
            $page = $parts[0];
            if ($page == 'setting') {
                $page_file = $file;
            }
        }
    }
    include_once 'inc/lang/' . $_SESSION['language'] . '/' . $page_file;
    if ($_SESSION['access']->settings > 1) {
        $results = array();
        $results['pageTitle'] = "Edit Setting";
        $results['formAction'] = "editSetting";
        if (isset($_POST['saveChanges'])) {
            // User has posted the setting edit form: save the setting changes
            if (!($setting = Setting::getById((int) $_POST['settingId']))) {
                header("Location: index.php?error=settingNotFound");
                return;
            }
            $setting->storeFormValues($_POST);
            $setting->update();
            header("Location: index.php?action=listSetting&success=changesSaved");
        } elseif (isset($_POST['cancel'])) {
            // User has cancelled their edits: return to the settings list
            header("Location: index.php?action=listSetting");
        } else {
            // User has not posted the setting edit form yet: display the form
            $results['setting'] = Setting::getById((int) $_GET['settingId']);
            require "inc/layout/editSetting.php";
        }
    } else {
        require "inc/layout/noAccess.php";
    }
}
开发者ID:sabasco,项目名称:gnscms,代码行数:39,代码来源:editSetting.php

示例3: getById

 static function getById($id)
 {
     return Setting::getById(USERDATA_OPTION, $id);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:4,代码来源:UserDataFieldOption.php

示例4: die

 $page->disableDesign();
 $user_id = $this->child;
 $user = User::get($user_id);
 if (!$user) {
     die('ECHKKP');
 }
 echo '<h1>Info:' . $user->name . '</h1>';
 if (UserHandler::isOnline($user_id)) {
     echo 'Last active ' . ago($user->time_last_active) . '<br/>';
     echo 'Otillgänglig för chat?: ' . UserSetting::get($user_id, 'chat_off') . '<br/>';
 } else {
     echo 'Offline<br/>';
 }
 echo 'User level: ' . UserHandler::getUserLevel($user_id) . '<br/>';
 $gender_id = UserSetting::get($user_id, 'gender');
 $gender = Setting::getById(USERDATA_OPTION, $gender_id);
 echo 'Gender: ' . $gender . '<br/>';
 $pres = UserSetting::get($user_id, 'presentation');
 if ($pres) {
     echo 'Presentation: ' . $pres . '<br/>';
 }
 $pic_id = UserSetting::get($user_id, 'picture');
 if ($pic_id) {
     echo 'Profile picture:<br/>';
     $a = new XhtmlComponentA();
     $a->href = getThumbUrl($pic_id, 0, 0);
     $a->content = showThumb($pic_id, 'Profilbild', 150, 150);
     echo $a->render();
 } else {
     $avatar_opt = UserSetting::get($user_id, 'avatar');
     // get pic id from avatar_id
开发者ID:martinlindhe,项目名称:core_dev,代码行数:31,代码来源:tooltip.php


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