當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。