當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Options::groupAdd方法代碼示例

本文整理匯總了PHP中Options::groupAdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Options::groupAdd方法的具體用法?PHP Options::groupAdd怎麽用?PHP Options::groupAdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Options的用法示例。


在下文中一共展示了Options::groupAdd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: filesize

$fileSize = filesize('includes/options.inc.php');
// Get the options from the db, will by default have a false value
$dbTimeStamp = Options::get('modified');
$dbFileSize = Options::get('filesize');
// Force the filesize and modification date to strings to be able to compare it with the DB
settype($lastEdit, 'string');
settype($fileSize, 'string');
$optionsUpdate = false;
// Update version based on the date and / or filesize. This will also work if the db is empty
if ($dbTimeStamp !== $lastEdit or $dbFileSize !== $fileSize) {
    $optionsUpdate = true;
    Options::groupAdd('Website Settings', 'basic website information');
    Options::groupAdd('META Data', 'control the Meta Data for the website');
    Options::groupAdd('Email Templates', 'variables used in Email Templates');
    Options::groupAdd('Miscellaneous', 'general settings page, not editible');
    Options::groupAdd('User Settings', "options visible in the user's settings page");
    // Set the timestamp and filesize
    Options::add('modified', $lastEdit, 'hidden', 'Miscellaneous');
    // Do not modify these, they need to be static
    Options::add('filesize', $fileSize, 'hidden', 'Miscellaneous');
    // Do not modify these, they need to be static
    // These would be the options you want to set, it will first
    // Site
    Options::addOnce('siteName', 'http://www.mysite.co.za', 'input', 'Website Settings');
    Options::addOnce('siteLogo', 'assets/img/logo.png', 'input', 'Website Settings');
    Options::addOnce('siteIcon', 'assets/img/icon.png', 'input', 'Website Settings');
    Options::addOnce('prettyName', '<small>www.</small>MySite<small>.co.za</small>', 'input', 'Website Settings');
    // Email Templates
    Options::addOnce('emailName', 'www.MySite.co.za', 'input', 'Email Templates');
    Options::addOnce('emailInfo', 'info@mysite.co.za', 'input', 'Email Templates');
    Options::addOnce('emailAdmin', 'drpain@mweb.co.za', 'input', 'Email Templates');
開發者ID:repsycle,項目名稱:baseline,代碼行數:31,代碼來源:options.inc.php

示例2: filesize

$lastEdit = $lastEdit['mtime'];
$fileSize = filesize('includes/options.inc.php');
// Get the options from the db, will by default have a false value
$dbTimeStamp = get_option('modified');
$dbFileSize = get_option('filesize');
// Force the filesize and modification date to strings to be able to compare it with the DB
settype($lastEdit, 'string');
settype($fileSize, 'string');
$optionsUpdate = false;
// Update version based on the date and / or filesize. This will also work if the db is empty
if ($dbTimeStamp !== $lastEdit or $dbFileSize !== $fileSize) {
    $optionsUpdate = true;
    Options::groupAdd('Website Settings', 'basic website information');
    Options::groupAdd('META Data', 'control the Meta Data for the website');
    Options::groupAdd('Email Templates', 'variables used in Email Templates');
    Options::groupAdd('Miscellaneous', 'general settings page');
    // Set the timestamp and filesize
    Options::add('modified', $lastEdit, 'hidden');
    // Do not modify these, they need to be static
    Options::add('filesize', $fileSize, 'hidden');
    // Do not modify these, they need to be static
    // These would be the options you want to set, it will first
    // Site
    Options::add('siteName', 'http://www.mysite.co.za', 'input', 'Website Settings');
    Options::add('siteLogo', 'assets/img/logo.png', 'input', 'Website Settings');
    Options::add('siteIcon', 'assets/img/icon.png', 'input', 'Website Settings');
    Options::add('prettyName', '<small>www.</small>MySite<small>.co.za</small>', 'input', 'Website Settings');
    // Email Templates
    Options::add('emailName', 'www.MySite.co.za', 'input', 'Email Templates');
    Options::add('emailInfo', 'info@mysite.co.za', 'input', 'Email Templates');
    Options::add('emailAdmin', 'drpain@mweb.co.za', 'input', 'Email Templates');
開發者ID:ninjahza,項目名稱:baseline,代碼行數:31,代碼來源:options.inc.php

示例3: groupSet

 public static function groupSet($group, $desc = '')
 {
     return Options::groupAdd($group, $desc);
 }
開發者ID:ninjahza,項目名稱:baseline,代碼行數:4,代碼來源:class.options.php

示例4: array

                // Set the option to the new value
                Options::set($dateOption, $timestamp);
                $changes = true;
            }
        }
    }
    if (isset($_POST['action']) && $_POST['action'] == 'update') {
        Options::set($_POST['option'], Options::get($_POST['option']), $_POST['type'], $_POST['group']);
        $changes = true;
    }
    if (isset($_POST['action']) && $_POST['action'] == 'add') {
        Options::set($_POST['option_name'], $_POST['option_value'], $_POST['type'], $_POST['group']);
        $changes = true;
    }
    if (isset($_POST['action']) && $_POST['action'] == 'group_add') {
        Options::groupAdd($_POST['group_name'], $_POST['group_desc']);
        $changes = true;
    }
    if (isset($_POST['action']) && $_POST['action'] == 'group_remove') {
        Options::groupRemove($_POST['group']);
        $changes = true;
    }
    if (isset($_POST['action']) && $_POST['action'] == 'remove') {
        Options::remove($_POST['option']);
        $changes = true;
    }
}
$title = "Admin <small>take control</small>";
Template::setBaseDir('./assets/tmpl');
$html = Template::loadTemplate('layout', array('header' => Template::loadTemplate('header', array('title' => $title, 'user' => $user, 'admin' => $isadmin, 'msg' => $msg, 'selected' => 'admin')), 'content' => Template::loadTemplate('admin', array('changes' => $changes)), 'footer' => Template::loadTemplate('footer', array('time_start' => $time_start))));
echo $html;
開發者ID:repsycle,項目名稱:baseline,代碼行數:31,代碼來源:admin.php


注:本文中的Options::groupAdd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。