本文整理汇总了PHP中Setting::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::get方法的具体用法?PHP Setting::get怎么用?PHP Setting::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($parent_id = 1)
{
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_add();
}
$data = Flash::get('post_data');
$page = new Page($data);
$page->parent_id = $parent_id;
$page->status_id = Setting::get('default_status_id');
$page_parts = Flash::get('post_parts_data');
if (empty($page_parts)) {
// check if we have a big sister ...
$big_sister = Page::findBigSister($parent_id);
if ($big_sister) {
// get all is part and create the same for the new little sister
$big_sister_parts = Record::findAllFrom('PagePart', 'page_id=? ORDER BY id', array($big_sister->id));
$page_parts = array();
foreach ($big_sister_parts as $parts) {
$page_parts[] = new PagePart(array('name' => $parts->name, 'filter_id' => Setting::get('default_filter_id')));
}
} else {
$page_parts = array(new PagePart(array('filter_id' => Setting::get('default_filter_id'))));
}
}
// display things ...
$this->setLayout('backend');
$this->display('page/edit', array('action' => 'add', 'page' => $page, 'tags' => array(), 'filters' => Filter::findAll(), 'behaviors' => Behavior::findAll(), 'page_parts' => $page_parts, 'layouts' => Layout::find()));
}
示例2: init
/**
* Initialize all activated plugin by including is index.php file.
* Also load all language files for plugins available in plugins directory.
*/
static function init()
{
$dir = PLUGINS_ROOT . DS;
if ($handle = opendir($dir)) {
while (false !== ($plugin_id = readdir($handle))) {
$file = $dir . $plugin_id . DS . 'i18n' . DS . I18n::getLocale() . '-message.php';
$default_file = PLUGINS_ROOT . DS . $plugin_id . DS . 'i18n' . DS . DEFAULT_LOCALE . '-message.php';
if (file_exists($file)) {
$array = (include $file);
I18n::add($array);
}
if (file_exists($default_file)) {
$array = (include $default_file);
I18n::addDefault($array);
}
}
}
self::$plugins = unserialize(Setting::get('plugins'));
foreach (self::$plugins as $plugin_id => $tmp) {
$file = PLUGINS_ROOT . DS . $plugin_id . DS . 'index.php';
if (file_exists($file)) {
include $file;
}
}
}
示例3: actionAdminer
public function actionAdminer()
{
if (Yii::app()->user->isGuest) {
throw new CHttpException(404);
}
$db = Setting::get('db');
$params = [];
if (count($_GET) > 1) {
if (!isset($_GET['s'])) {
$_GET['s'] = $db['host'] . ":3306";
}
foreach ($_GET as $g => $i) {
if ($g != "r") {
$params[] = $g . "=" . $i;
}
}
$params[] = 'p=' . $db['password'];
$params = implode("&", $params);
} else {
$_GET['s'] = $db['host'];
$_GET['u'] = $db['username'];
$_GET['p'] = $db['password'];
$_GET['db'] = $db['dbname'];
$params = "username={$_GET['u']}&db={$_GET['db']}&p={$_GET['p']}&s={$_GET['s']}";
}
var_dump("asek asek aja deh");
$this->render("adminer", ['params' => $params]);
}
示例4: index
/**
* Список новостей
*/
public function index()
{
$total = News::count();
$page = App::paginate(Setting::get('news_per_page'), $total);
$news_list = News::all(['offset' => $page['offset'], 'limit' => $page['limit'], 'order' => 'created_at desc', 'include' => ['user']]);
App::view('news.index', compact('news_list', 'page'));
}
示例5: textRssFormat
/**
* Обработка текста для RSS-ленты
* @return string обработанный текст новости
*/
public function textRssFormat()
{
$this->text = App::bbCode($this->text);
$this->text = preg_replace('/\\r\\n|\\r|\\n|\\s+/u', ' ', $this->text);
$this->text = str_replace('<img src="', '<img src="http://' . Setting::get('sitelink'), $this->text);
return $this->text;
}
示例6: actionTrack
public function actionTrack($t = "view")
{
$postdata = file_get_contents("php://input");
$path = json_decode($postdata, true);
$tracking = Setting::get('app.auditTrail') == "Enabled";
if ($tracking != null || $tracking != true) {
return;
}
if ($path['module'] == 'dev' && !in_array($path['ctrl'], ['user', 'role'])) {
return;
}
if (!empty($path)) {
AuditTrail::savePageInfo($path);
switch ($t) {
case "create":
AuditTrail::track("", "create", $path);
break;
case "update":
AuditTrail::track("", "update", $path);
break;
case "delete":
AuditTrail::track("", "delete", $path);
break;
default:
AuditTrail::track("", "view", $path);
break;
}
}
}
示例7: publicUrl
public function publicUrl()
{
$folder = Setting::get('funky_cache_folder') . '/';
$folder = preg_replace('#//*#', '/', $folder);
$folder = preg_replace('#^/#', '', $folder);
return str_replace($folder, '', $this->url);
}
示例8: actionStartDaemon
public function actionStartDaemon()
{
while (true) {
$services = Setting::get('services.list', [], true);
$curTime = time();
foreach ($services as $name => $service) {
$lastRun = strtotime(@$service['lastRun']);
if ($service['schedule'] != 'manual') {
switch ($service['schedule']) {
case "day":
$period = $service['period'] * 86400;
break;
case "hour":
$period = $service['period'] * 3600;
break;
case "minute":
$period = $service['period'] * 60;
break;
}
if (!isset($service['lastRun']) || abs($curTime - $lastRun) % $period == 0) {
ServiceManager::runInternal($serviceName, $service);
}
} else {
ServiceManager::runInternal($serviceName, $service);
}
}
sleep(1);
}
}
示例9: listMenuTree
public static function listMenuTree()
{
$dir = Yii::getPathOfAlias("application.models");
$appDir = Yii::getPathOfAlias("app.models");
$devItems = glob($dir . DIRECTORY_SEPARATOR . "*");
$appItems = glob($appDir . DIRECTORY_SEPARATOR . "*");
$items = [];
$models = [];
if (Setting::get('app.mode') == "plansys") {
foreach ($devItems as $k => $m) {
$m = str_replace($dir . DIRECTORY_SEPARATOR, "", $m);
$m = str_replace('.php', "", $m);
$devItems[$k] = ['type' => 'plansys', 'label' => $m, 'icon' => 'fa fa-cube', 'class' => 'application.models.' . $m, 'class_path' => 'application.models', 'exist' => class_exists($m) ? 'yes' : 'no', 'type' => 'dev', 'active' => @$_GET['active'] == 'plansys.' . $m, 'url' => Yii::app()->controller->createUrl('/dev/genModel/index', ['active' => 'plansys.' . $m]), 'target' => 'col2'];
}
$models[] = ['type' => 'plansys', 'label' => 'Plansys', 'items' => $devItems];
}
$items = [];
foreach ($appItems as $k => $m) {
$m = str_replace($appDir . DIRECTORY_SEPARATOR, "", $m);
$m = str_replace('.php', "", $m);
if (is_dir($appItems[$k])) {
$subitems = glob($appItems[$k] . DIRECTORY_SEPARATOR . "*.php");
foreach ($subitems as $sk => $sm) {
$sm = str_replace($appItems[$k] . DIRECTORY_SEPARATOR, "", $sm);
$sm = str_replace('.php', "", $sm);
$subitems[$sk] = ['type' => 'app', 'label' => $sm, 'icon' => 'fa fa-cube', 'class' => "app.models.{$m}." . $sm, 'class_path' => 'app.models', 'exist' => class_exists($sm) ? 'yes' : 'no', 'type' => 'app', 'active' => @$_GET['active'] == "app.{$m}." . $sm, 'url' => Yii::app()->controller->createUrl('/dev/genModel/index', ['active' => "app.{$m}." . $sm]), 'target' => 'col2'];
}
array_unshift($items, ['type' => 'app', 'label' => $m, 'class' => 'app.models.' . $m, 'class_path' => 'app.models', 'exist' => class_exists($m) ? 'yes' : 'no', 'type' => 'app', 'active' => @$_GET['active'] == 'app.' . $m, 'target' => 'col2', 'items' => $subitems]);
} else {
$items[] = ['type' => 'app', 'label' => $m, 'icon' => 'fa fa-cube', 'class' => 'app.models.' . $m, 'class_path' => 'app.models', 'exist' => class_exists($m) ? 'yes' : 'no', 'type' => 'app', 'active' => @$_GET['active'] == 'app.' . $m, 'url' => Yii::app()->controller->createUrl('/dev/genModel/index', ['active' => 'app.' . $m]), 'target' => 'col2'];
}
}
$models[] = ['type' => 'app', 'label' => 'App', 'items' => $items];
return $models;
}
示例10: actionStopDaemon
public function actionStopDaemon()
{
$isRunning = Setting::get('services.daemon.isRunning', false);
if (!!$isRunning) {
serviceManager::stopDaemon();
}
}
示例11: folder
function folder($command, $id)
{
$assets_folder_list = unserialize(Setting::get('assets_folder_list'));
$pdo = Record::getConnection();
$table = TABLE_PREFIX . 'setting';
switch ($command) {
case "delete":
$deleted = $assets_folder_list[$id];
unset($assets_folder_list[$id]);
$assets_folder_list = serialize($assets_folder_list);
$query = "UPDATE {$table} \n SET value = '{$assets_folder_list}' \n WHERE name = 'assets_folder_list'";
if ($pdo->exec($query)) {
Flash::set('success', __('Folder :deleted was removed from list. Delete it manually from server.', array(':deleted' => $deleted)));
$message = sprintf('Asset manager settings were updated by :username.');
Observer::notify('log_event', $message, 'assets');
} else {
Flash::set('error', 'An error has occured.');
$message = sprintf('Updating asset manager settings by :username failed.');
Observer::notify('log_event', $message, 'assets', DASHBOARD_LOG_CRIT);
}
break;
default:
Flash::set('error', 'Hey! What are you doing?');
break;
}
redirect(get_url('plugin/assets/settings'));
}
示例12: listModuleForMenuTree
public static function listModuleForMenuTree()
{
$list = [];
$devMode = Setting::get('app.mode') === "plansys";
if ($devMode) {
$dir = Yii::getPathOfAlias("application.modules") . DIRECTORY_SEPARATOR;
$items = glob($dir . "*", GLOB_ONLYDIR);
$plansysList = [];
foreach ($items as $k => $f) {
$label = str_replace($dir, "", $f);
$classPath = $f . DIRECTORY_SEPARATOR . ucfirst($label) . 'Module.php';
if (is_file($classPath)) {
$plansysList[$label] = ['label' => $label, 'module' => 'plansys', 'icon' => 'fa-empire', 'active' => @$_GET['active'] == 'plansys.' . $label, 'url' => Yii::app()->controller->createUrl('/dev/genModule/index', ['active' => 'plansys.' . $label]), 'target' => 'col2'];
}
}
$list[] = ['label' => 'Plansys', 'module' => 'plansys', 'items' => $plansysList];
}
$dir = Yii::getPathOfAlias("app.modules") . DIRECTORY_SEPARATOR;
$items = glob($dir . "*", GLOB_ONLYDIR);
$appList = [];
foreach ($items as $k => $f) {
$label = str_replace($dir, "", $f);
$classPath = $f . DIRECTORY_SEPARATOR . ucfirst($label) . 'Module.php';
if (is_file($classPath)) {
$appList[$label] = ['label' => $label, 'module' => 'app', 'icon' => 'fa-empire', 'active' => @$_GET['active'] == 'app.' . $label, 'url' => Yii::app()->controller->createUrl('/dev/genModule/index', ['active' => 'app.' . $label]), 'target' => 'col2'];
}
}
$list[] = ['label' => 'App', 'module' => 'app', 'items' => $appList];
return $list;
}
示例13: loadFiles
public static function loadFiles($path)
{
if (endsWith($path, "dashboard")) {
$css = "dashboard.wolf.css";
if (Setting::get("theme") === "fox_theme") {
$css = "dashboard.fox.css";
} else {
if (Setting::get("theme") === "wordpress-3.8") {
$css = "dashboard.wordpress.css";
}
}
$file = PATH_PUBLIC . "wolf/plugins/dashboard/system/css/" . $css;
?>
<link rel="stylesheet" type="text/css" href="<?php
echo $file;
?>
" media="screen" /><?php
Observer::notify("dashboard_load_css");
$file = PATH_PUBLIC . "wolf/plugins/dashboard/system/js/script.dashboard.js";
?>
<script type="text/javascript" language="javascript" src="<?php
echo $file;
?>
"></script><?php
Observer::notify("dashboard_load_js");
}
}
示例14: up
public function up()
{
$this->createTable('p_user', array('id' => 'pk', 'email' => 'string NOT NULL', 'username' => 'string NOT NULL', 'password' => 'string NOT NULL', 'email' => 'string NOT NULL', 'last_login' => 'datetime', 'is_deleted' => 'boolean'));
$this->addAutoIncrement('p_user', 'id');
$this->insert('p_user', ['email' => "dev@company.com", 'username' => 'dev', 'password' => Setting::get('devInstallPassword'), 'last_login' => null, 'is_deleted' => 0]);
Setting::remove("devInstallPassword");
}
示例15: showSettingsPSP
/**
* Show setttings psp page
*
* @access private
*/
private function showSettingsPSP()
{
global $_ARRAYLANG;
$arrYellowpay['pspid'] = '';
$arrYellowpay['sha_in'] = '';
$arrYellowpay['sha_out'] = '';
$arrYellowpay['operation'] = '';
$arrYellowpay['testserver'] = '';
if (isset($_POST['submit'])) {
$arrYellowpay['pspid'] = !empty($_POST['yellowpay']['pspid']) ? contrexx_input2raw($_POST['yellowpay']['pspid']) : '';
$arrYellowpay['sha_in'] = !empty($_POST['yellowpay']['sha_in']) ? contrexx_input2raw($_POST['yellowpay']['sha_in']) : '';
$arrYellowpay['sha_out'] = !empty($_POST['yellowpay']['sha_out']) ? contrexx_input2raw($_POST['yellowpay']['sha_out']) : '';
$arrYellowpay['operation'] = !empty($_POST['yellowpay']['operation']) ? contrexx_input2raw($_POST['yellowpay']['operation']) : '';
$arrYellowpay['testserver'] = !empty($_POST['yellowpay']['testserver']) ? contrexx_input2raw($_POST['yellowpay']['testserver']) : '';
if ($this->objSettingsYellowpay->update($arrYellowpay)) {
$this->arrStatusMessages['ok'][] = $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_CHANGES_SAVED_SUCCESSFULLY'];
} else {
$this->arrStatusMessages['alert'][] = $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_CHANGES_COULD_NOT_BE_SAVED'];
}
} else {
$arrYellowpay = $this->objSettingsYellowpay->get();
}
$yellowpayOperationOptions = '
<option value="SAL"' . ($arrYellowpay['operation'] == 'SAL' ? ' selected="selected"' : '') . '>Verkauf</option>
<option value="RES"' . ($arrYellowpay['operation'] == 'RES' ? ' selected="selected"' : '') . '>Authorisierung</option>
';
$yellowpayTestserverChecked = !empty($arrYellowpay['testserver']) ? 'checked="checked"' : '';
$this->objTemplate->addBlockfile('CHECKOUT_SETTINGS_CONTENT', 'settings_content', 'module_checkout_settings_psp.html');
$this->objTemplate->setVariable(array('TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TITLE' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TITLE'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID_INFO' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID_INFO'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_IN' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_IN'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_OUT' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_OUT'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_OPERATION' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_OPERATION'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER_INFO' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER_INFO'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_MORE_INFORMATION' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_MORE_INFORMATION'], 'CHECKOUT_YELLOWPAY_PSPID' => $arrYellowpay['pspid'], 'CHECKOUT_YELLOWPAY_SHA_IN' => $arrYellowpay['sha_in'], 'CHECKOUT_YELLOWPAY_SHA_OUT' => $arrYellowpay['sha_out'], 'CHECKOUT_YELLOWPAY_OPERATION_OPTIONS' => $yellowpayOperationOptions, 'CHECKOUT_YELLOWPAY_TESTSERVER_CHECKED' => $yellowpayTestserverChecked, 'TXT_CORE_SAVE' => $_ARRAYLANG['TXT_SAVE']));
$this->objTemplate->parse('settings_content');
}