本文整理汇总了PHP中Settings::get_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_settings方法的具体用法?PHP Settings::get_settings怎么用?PHP Settings::get_settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_settings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
// Articles
$articles = $this->article_model->get_list(array('order_by' => 'updated DESC'));
// Last 5 articles
$last_articles = array();
$max = count($articles) > 4 ? 5 : count($articles);
if (!empty($articles)) {
for ($i = 0; $i < $max; $i++) {
$last_articles[] = $articles[$i];
}
}
// Get all contexts : links between pages and articles
$page_article = $this->article_model->get_all_context();
// Get pages
$pages = $this->page_model->get_lang_list(false, Settings::get_lang('default'));
// Add page name to each context & feed the linked articles array
$linked_articles = array();
foreach ($page_article as &$pa) {
if (array_search($pa['id_article'], $linked_articles) === FALSE) {
$linked_articles[] = $pa['id_article'];
}
$page = array_values(array_filter($pages, create_function('$row', 'return $row["id_page"] == "' . $pa['id_page'] . '";')));
$pa['page'] = !empty($page) ? $page[0] : array();
}
// Orphan articles
$orphan_articles = array();
foreach ($articles as $article) {
if (array_search($article['id_article'], $linked_articles) === FALSE) {
$orphan_articles[] = $article;
}
}
// Orphan pages
$orphan_pages = $this->page_model->get_lang_list(array('id_menu' => '0', 'order_by' => 'name ASC'), Settings::get_lang('default'));
// Last connected users
// $users = array_filter($this->connect->model->get_users(array('limit'=>'10', 'level > ' => '999'), array($this, '_filter_users'));
$users = $this->connect->model->get_users(array('limit' => '10', 'order_by' => 'last_visit DESC', 'last_visit <>' => ''));
$last_registered_users = $this->connect->model->get_users(array('limit' => '10', 'order_by' => 'join_date DESC'));
// Updates on last articles
foreach ($last_articles as &$article) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $article['updater']) {
$article['updater'] = $user['screen_name'];
}
if ($user['username'] == $article['author']) {
$article['author'] = $user['screen_name'];
}
}
// Article's pages...
$article['pages'] = array_values(array_filter($page_article, create_function('$row', 'return $row["id_article"] == "' . $article['id_article'] . '";')));
}
// Updates on orphan pages
foreach ($orphan_pages as &$page) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $page['updater']) {
$page['updater'] = $user['screen_name'];
}
if ($user['username'] == $page['author']) {
$page['author'] = $user['screen_name'];
}
}
}
// Updates on orphan articles
foreach ($orphan_articles as &$article) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $article['updater']) {
$article['updater'] = $user['screen_name'];
}
if ($user['username'] == $article['author']) {
$article['author'] = $user['screen_name'];
}
}
}
// Flags
$settings = Settings::get_settings();
$flags = array();
foreach ($settings as $key => $setting) {
if (strpos($key, 'flag') !== FALSE && $setting != '') {
$flags[substr($key, -1)] = $setting;
}
}
// Modules
$modules = array();
include APPPATH . 'config/modules.php';
$config_files = glob(MODPATH . '*/config.xml');
// Module data to put to template
$moddata = array();
// Get all modules from folders
if (!empty($config_files)) {
foreach ($config_files as $file) {
$xml = simplexml_load_file($file);
// Module folder
preg_match('/\\/([^\\/]*)\\/config.xml$/i', $file, $matches);
$folder = $matches[1];
$uri = (string) $xml->uri_segment;
// Only add
// - installed modules (in $module var of config/modules.php)
//.........这里部分代码省略.........
示例2: get_todos
public function get_todos()
{
$settings = Settings::get_settings();
log_message('app', print_r($settings, TRUE));
}
示例3: array
$freeform_user_settings = array('pp_limit_value' => _("Post-processing projects limit, -1 means unlimited"));
$username = array_get($_POST, 'username', array_get($_GET, 'username', NULL));
$action = get_enumerated_param($_POST, 'action', NULL, array('update'), TRUE);
$title = _("Manage Site Access Privileges");
output_header($title);
echo "<h1>{$title}</h1>\n";
echo "<p>" . _("This page allows you to grant or revoke various site access permissions for a user and adjust some limits. Round accesses are managed from the user's statistics page.") . "</p>";
show_username_form($username);
if ($username) {
try {
$user = new User($username);
} catch (NonexistentUserException $exception) {
echo "<p class='error'>" . _("Invalid username") . "</p>";
exit;
}
$user_settings =& Settings::get_settings($username);
echo "<hr>";
echo "<h2>{$username} ({$user->real_name})</h2>";
if ($action == "update") {
update_settings($username, $user_settings);
} else {
show_toggles_form($username, $user_settings);
}
}
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function show_username_form($username)
{
echo "<form method='GET'>\n";
echo "<p>" . _("Username") . ": ";
echo "<input name='username' type='text' value='{$username}' size='20'>\n";
echo "</p>";
示例4: get_access_mode
function get_access_mode($username)
{
$userSettings =& Settings::get_settings($username);
return $userSettings->get_value("remote_file_manager");
}
示例5: index
function index()
{
// Articles
$articles = $this->article_model->get_lang_list(array('order_by' => 'updated DESC'), Settings::get_lang('default'));
// Last 10 articles
$last_articles = array();
$max = count($articles) > 9 ? 10 : count($articles);
$count = 0;
if (!empty($articles)) {
foreach ($articles as $article) {
if (Authority::can('access', 'backend/menu/' . $article['id_menu'], NULL, TRUE) && Authority::can('access', 'backend/page/' . $article['id_page'], NULL, TRUE) && Authority::can('access', 'backend/article/' . $article['id_article'], NULL, TRUE)) {
$last_articles[] = $article;
$count++;
if ($count == $max) {
break;
}
}
}
}
// Orphan articles
$orphan_articles = array();
foreach ($articles as $article) {
if (!$article['id_page']) {
$orphan_articles[] = $article;
}
}
// Orphan pages
$orphan_pages = $this->page_model->get_lang_list(array('id_menu' => '0', 'order_by' => 'name ASC'), Settings::get_lang('default'));
// Last connected /registered users
$logged_user_role = User()->get_role();
$users = $this->user_model->get_list_with_role(array('limit' => '10', 'order_by' => 'last_visit DESC', 'last_visit <>' => ''));
$last_registered_users = $this->user_model->get_list_with_role(array('limit' => '10', 'order_by' => 'join_date DESC'));
// Updates on last articles
foreach ($last_articles as &$article) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $article['updater']) {
$article['updater'] = $user['screen_name'];
}
if ($user['username'] == $article['author']) {
$article['author'] = $user['screen_name'];
}
}
$pages = $this->page_model->get_parent_array($article['id_page'], array(), Settings::get_lang('default'));
$breadcrumb = array();
foreach ($pages as $page) {
$breadcrumb[] = !empty($page['title']) ? $page['title'] : $page['name'];
}
$article['breadcrumb'] = implode(' > ', $breadcrumb);
}
// Updates on orphan pages
foreach ($orphan_pages as &$page) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $page['updater']) {
$page['updater'] = $user['screen_name'];
}
if ($user['username'] == $page['author']) {
$page['author'] = $user['screen_name'];
}
}
}
// Updates on orphan articles
foreach ($orphan_articles as &$article) {
// User name update
foreach ($users as $user) {
if ($user['username'] == $article['updater']) {
$article['updater'] = $user['screen_name'];
}
if ($user['username'] == $article['author']) {
$article['author'] = $user['screen_name'];
}
}
}
// Flags
$settings = Settings::get_settings();
$flags = array();
foreach ($settings as $key => $setting) {
if (strpos($key, 'flag') !== FALSE && $setting != '') {
$flags[substr($key, -1)] = $setting;
}
}
// Put installed module list to template
$installed_modules = Modules()->get_installed_modules();
$modules = array();
foreach ($installed_modules as $module) {
if ($module['has_admin'] && Authority::can('access', 'module/' . $module['key'])) {
$modules[] = $module;
}
}
$this->template['modules'] = $modules;
$this->template['flags'] = $flags;
$this->template['last_articles'] = $last_articles;
$this->template['orphan_pages'] = $orphan_pages;
$this->template['orphan_articles'] = $orphan_articles;
$this->template['users'] = $users;
$this->template['last_registered_users'] = $last_registered_users;
$this->output('desktop/dashboard');
}
示例6: json_encode
/**
* Ionize Content Management system
* Javascript Settings Class
*
* Put in the Settings object all Ionize Settings
* so they will be available to javascript
*
* @package Ionize
* @author Partikule
* @copyright Copyright (c) 2013, Partikule
* @category Javascript
* @since Version 1.0
* @link http://www.partikule.net
*
*/
$settings = json_encode(Settings::get_settings());
?>
var Settings = {
'setting' : JSON.decode(<?php
echo json_encode($settings);
?>
, true)
}
Object.append(Settings, {
get: function(key)
{
return this.setting[key];
}
});