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


PHP Options::getList方法代码示例

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


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

示例1: get_options

<form method="post">
    <select name='option' title='Options'>
        <?php 
echo get_options('options', 'key', 'key', @$_POST['option']);
?>
    
    </select> 
    <select name='group' title='Groups of options'>
        <?php 
echo get_options('options_groups', 'group', 'group', @$_POST['group']);
?>
    
    </select>
    <select  name='type' title='Type of variable'>
        <?php 
echo array2options(Options::types(), @$_POST['type']);
?>
    </select>
    <input type='hidden' name='action' value='update' />
    <input type='submit' class='input-large' value='Update' />
</form>

<?php 
if (isset($_POST)) {
    if (isset($_POST['action']) && $_POST['action'] == 'update') {
        Options::set($_POST['option'], Options::get($_POST['option']), $_POST['type'], $_POST['group']);
    }
}
echo "<br />Options: <hr />";
printr(Options::getList(false, 'META Data'));
开发者ID:ninjahza,项目名称:baseline,代码行数:30,代码来源:test.php

示例2: foreach

    
<?php 
$i = 0;
foreach (Options::groups() as $group) {
    $active = '';
    if ($i == 0) {
        $active = " active in";
    }
    $hash = strtolower(str_replace(" ", "", $group['group']));
    $title = $group['desc'];
    $name = $group['group'];
    echo '<div id="' . $hash . '" class="tab-pane fade' . $active . '">
                <div class="well">
                    <h3>' . $name . ' <small>' . $title . '</small></h3>
                    <br />';
    $options = Options::getList(false, $name);
    if (empty($options)) {
        echo "No results found";
    } else {
        foreach ($options as $option => $value) {
            $type = $value['type'];
            $label = camelcase2space($option);
            echo '<label class="control-label" for="' . $option . '">' . $label . '</label>
                    <div class="controls">';
            if ($type == 'input') {
                echo '<input type="text" class="input-xlarge" id="' . $option . '" name="' . $option . '" value="' . $value['value'] . '">';
            }
            if ($type == 'textarea') {
                echo '<textarea class="textarea input-xxlarge" id="' . $option . '" name="' . $option . '">' . $value['value'] . '</textarea>';
            }
            echo "</div>";
开发者ID:ninjahza,项目名称:baseline,代码行数:30,代码来源:admin.php

示例3: foreach

echo $inputValue[1];
?>
">
				</div>
				<div class='hide' id='passwordWarning'> 
					<br />
					<div class="alert alert-error">
						<strong>Warning</strong>
						<br />
						Changing your password will log you out
					</div>
				</div>
			</div>
<!-- Default settings above, now for the dynamic fields -->
<?php 
$options = Options::getList(false, 'User Settings');
if (!empty($options)) {
    foreach ($options as $option => $value) {
        $type = $value['type'];
        // Get the user specific values from the Options_users table
        $val = Options::userGet($userId, $option);
        $label = camelcase2space($option);
        echo '<div class="control-group">' . nl();
        echo '	<label class="control-label" for="' . $option . '">' . $label . '</label>' . nl();
        echo '	<div class="controls">' . nl();
        if ($type == 'input') {
            echo '<input type="text" class="input-xlarge" id="' . $option . '" name="' . $option . '" value="' . $val . '">' . nl();
        }
        if ($type == 'textarea') {
            echo '<textarea class="textarea input-xxlarge" id="' . $option . '" name="' . $option . '">' . $val . '</textarea>' . nl();
        }
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:settings.php

示例4: foreach

}
?>



<div class="modal hide fade" id="myModal" style="display: none;">
    <div class="modal-header">
      <button data-dismiss="modal" class="close" type="button">&times;</button>
      <h3>List of available variables, <small>and their values</small></h3>
    </div>
    <div class="modal-body">
<?php 
foreach (Options::groups() as $group) {
    $title = $group['desc'];
    $name = $group['group'];
    $groupOptions = Options::getList(false, $name);
    if (!empty($groupOptions)) {
        echo '<ul class="unstyled">';
        foreach ($groupOptions as $variable => $value) {
            echo "<li><strong>Options::get('" . $variable . "');</strong> = " . nl2br($value['value']) . "</li>";
        }
        echo '</ul>';
    }
}
?>
       
    </div>
    <div class="modal-footer">
      <a data-dismiss="modal" class="btn" href="#" style="">Close</a>              
    </div>
</div>
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:admin.php

示例5: fix_slashes

    $_REQUEST = fix_slashes($_REQUEST);
    $_COOKIE = fix_slashes($_COOKIE);
}
// Load our config settings
$Config = Config::getConfig();
// Run the options and install functions, this would be if there are no information present in the db
require DOC_ROOT . '/includes/install.inc.php';
// Check for installation and create the tables needed
require DOC_ROOT . '/includes/options.inc.php';
// Get the options from the DB
// Store session info in the database?
if (Config::get('useDBSessions') === true) {
    DBSession::register();
}
// Initialize our session
session_name('spfs');
session_start();
// Initialize current user
$Auth = Auth::getAuth();
// This dynamically creates the options variables except for the User Settings
foreach (Options::getList(false, false, "WHERE `group`!='User Settings'") as $option => $values) {
    ${$option} = $values['value'];
}
// This dynamically creates the User Variables
if ($Auth->loggedIn()) {
    foreach (Options::getList(false, 'User Settings') as $option => $val) {
        ${$option} = Options::userGet($Auth->id, $option);
    }
}
// Object for tracking and displaying error messages
$Error = Error::getError();
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:master.inc.php


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