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


PHP core::s方法代码示例

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


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

示例1: load

 public static function load()
 {
     self::$modules = new stdClass();
     $sql = new SQLObject();
     if ($sql->query("SELECT filename,core,seq FROM " . $sql->table('modules') . " WHERE (active = 1 AND core = 1) ORDER BY seq ASC")) {
         $core = $sql->fetch();
         if ($sql->query("SELECT filename,core,seq FROM " . $sql->table('modules') . " WHERE (active = 1 AND core = 0) ORDER BY seq ASC")) {
             $modules = array_merge($core, $sql->fetch());
             foreach ($modules as $module) {
                 if ((int) $module->core == 1) {
                     $path = './app/modules/' . $module->filename;
                 } else {
                     $path = './modules/' . $module->filename;
                 }
                 $GLOBALS['MODULE_NAME'] = str_replace('-', '_', preg_replace('#^([a-z-_]+)\\.mod\\.php$#is', '$1', $module->filename));
                 if (include_once $path) {
                     core::s('syslog')->success('Modules', '__construct()', $path);
                     if (defined('IN_ACP') && IN_ACP && isset($_GET['c'], $_GET['module']) && $_GET['c'] == 'config' && $_GET['module'] == $GLOBALS['MODULE_NAME'] && method_exists($this->modules[$GLOBALS['MODULE_NAME']], '_module_config_load')) {
                         core::s('tpl')->addTpl('config-' . $GLOBALS['MODULE_NAME']);
                         $this->modules[$GLOBALS['MODULE_NAME']]->_module_config_load();
                     }
                 } else {
                     core::s('syslog')->error('Modules', '__construct()', $path, 'Cannot load the module!');
                 }
             }
         }
     }
 }
开发者ID:jankuca,项目名称:smog-cms,代码行数:28,代码来源:modules.layer.php

示例2: load

 public static function load($filename)
 {
     if (file_exists(self::$dirpath . $filename . '.lang.php')) {
         include_once self::$dirpath . $filename . '.lang.php';
         core::s('syslog')->success('Langs', '__construct()', self::$dirpath . $filename . '.lang.php');
     } else {
         core::s('syslog')->error('Langs', '__construct()', self::$dirpath . $filename . '.lang.php', 'File does not exist!');
     }
 }
开发者ID:jankuca,项目名称:smog-cms,代码行数:9,代码来源:langs.layer.php

示例3:

<?php

core::s('tpl')->assignVar(array('L_MODULE_MENU' => 'Menu', 'L_MODULE_MENU_DESCRIPTION' => 'Správa položek hlavního menu webu. Modul zároveň vytváří menu v administraci.'));
开发者ID:jankuca,项目名称:smog-cms,代码行数:3,代码来源:menu.lang.php

示例4:

<?php

core::s('tpl')->assignVar(array('L_CODE' => 'Kód', 'L_TYPE' => 'Typ', 'L_AFFECTED_MODULES' => 'Ovlivněné moduly', 'L_PACK' => 'Balík', 'L_DOWNLOAD_TIMES' => 'Staženo', 'L_SEPARATE_BY_ENTER' => 'Oddělujte enterem.', 'L_WITHOUT_EXTENSIONS' => 'Bez přípon.', 'L_PACK_AS_ZIP' => 'Zabalte balík jako archiv <strong>zip</strong>.', 'L_UPDATES_GLOBAL_LAST_ADDED_UPDATES' => 'Poslední přidané aktualizace', 'L_UPDATES_GLOBAL_ADD_UPDATE' => 'Přidat aktualizaci', 'L_UPDATES_GLOBAL_UPDATE_IMPORTANT_SECURITY' => 'Důležitá bezpečnostní aktualizace', 'L_UPDATES_GLOBAL_UPDATE_IMPORTANT' => 'Důležitá aktualizace', 'L_UPDATES_GLOBAL_UPDATE_COMMON' => 'Běžná aktualizace', 'L_UPDATES_GLOBAL_WARNING_GLOBAL_CHANGE' => 'Pozor! Toto je kompletně globální akce, která ovlivní všechny nainstalované systémy GeeCMS, splňující zadané požadavky!', 'L_UPDATES_GLOBAL_WARNING_COOKIES_JAVASCRIPT' => 'Pro tuto akci musíte mít povolené cookies a zapnutý JavaScript.'));
开发者ID:jankuca,项目名称:smog-cms,代码行数:3,代码来源:updates_global.lang.php

示例5: _module_config_load

 public function _module_config_load()
 {
     $cfg = core::s('cfg');
     TPL::add('SITE_TITLE', '{L_SITE_CONFIG} &mdash; {SITE_HEADER} / {L_ACP}');
     $sql = new SQLObject();
     if ($sql->query("\r\nSELECT module,name,value,type\r\nFROM " . $sql->table('config') . "\r\nWHERE (module = 'core')")) {
         foreach ($sql->fetch() as $item) {
             switch ($item->type) {
                 case 'integer':
                     $value = (int) $item->value;
                     break;
                 case 'string':
                     $value = (string) $item->value;
                     break;
                 case 'float':
                     $value = (double) $item->value;
                     break;
                 case 'timestamp':
                     $value = strtotime((string) $item->value);
                     break;
                 case 'boolean':
                     if ((int) $item->value == 0) {
                         $value = false;
                     } else {
                         $value = true;
                     }
                     TPL::cond('MODULE_CONFIG:' . strtoupper($item->name), $value);
                     break;
                 default:
                     $value = $item->value;
                     break;
             }
             TPL::add('MODULE_CONFIG:' . strtoupper($item->name), $value);
         }
     }
     $dir = dir('./langs/');
     while ($file = $dir->read()) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         $langs[] = $file;
     }
     sort($langs);
     $f_langs = array();
     foreach ($langs as $lang) {
         $f_langs[] = array('LANG_CODENAME' => $lang, 'conds' => array('LANG_ACTIVE' => $lang == $cfg['etc']['core']['site_lang'] ? true : false));
     }
     TPL::assignAsLoop('MODULE_CONFIG:SITE_LANG', $f_langs);
     $f_langs = array();
     foreach ($langs as $lang) {
         $f_langs[] = array('LANG_CODENAME' => $lang, 'conds' => array('LANG_ACTIVE' => $lang == $cfg['etc']['core']['acp_lang'] ? true : false));
     }
     TPL::assignAsLoop('MODULE_CONFIG:ACP_LANG', $f_langs);
     $dir = dir('./styles/');
     while ($file = $dir->read()) {
         if ($file == '.' || $file == '..' || $file == '.acp') {
             continue;
         }
         $styles[] = $file;
     }
     sort($styles);
     $f_styles = array();
     foreach ($styles as $style) {
         $info = array();
         $path = './styles/' . $style . '/style.cfg';
         if (file_exists($path)) {
             $data = simplexml_load_file($path);
             foreach ($data->children() as $item) {
                 switch ($item['name']) {
                     case 'name':
                         $info['name'] = $item['value'];
                         break;
                     case 'author':
                         $info['author'] = $item['value'];
                         break;
                     case 'author_link':
                         $info['author_link'] = $item['value'];
                         break;
                     case 'preview':
                         $preview = true;
                         $info['preview'] = './styles/' . $style . '/' . $item['value'];
                         break;
                 }
             }
         }
         if (!isset($info['name'])) {
             $info['name'] = $style;
         }
         if (!isset($info['author'])) {
             $info['author'] = '{L_UNKNOWN}';
         }
         if (!isset($info['preview'])) {
             $preview = false;
             $info['preview'] = './styles/.acp/media/images/style_preview.png';
         }
         if ($style == $cfg['etc']['core']['site_style']) {
             TPL::add('MODULE_CONFIG:SITE_STYLE_NAME', strlen($info['name']) > 24 ? mb_substr($info['name'], 0, 24, 'UTF-8') . '...' : $info['name']);
         }
         $f_styles[] = array('STYLE_CODENAME' => $style, 'STYLE_NAME' => $info['name'], 'STYLE_AUTHOR' => $info['author'], 'STYLE_AUTHOR_LINK' => $info['author_link'], 'STYLE_PREVIEW' => $info['preview'], 'conds' => array('STYLE_ACTIVE' => $style == $cfg['etc']['core']['site_style'] ? true : false, 'STYLE_AUTHOR_LINK' => isset($info['author_link']) ? true : false, 'STYLE_PREVIEW' => $preview));
     }
//.........这里部分代码省略.........
开发者ID:jankuca,项目名称:smog-cms,代码行数:101,代码来源:core.mod.php

示例6: __construct

     */
    public static $s;
    /**
     * Load configuration variables into this
     * @var	array
     */
    public static $c;
}
// Load config-file
require 'config.php';
global $config;
core::$c = $config;
/**
 * Starts the script
 */
core::$s = new base();
// ------------------------------
define("ROOT", dirname(__FILE__));
define("FILES", dirname(dirname(ROOT)) . "/files");
// ------------------------------
/**
 * The core-script
 */
class base
{
    public $db, $upload;
    /**
     * Unsets the variables used in the script
     */
    public function __construct()
    {
开发者ID:heigren,项目名称:php-upload,代码行数:31,代码来源:core.php

示例7: getPermissionsAvailable

 public function getPermissionsAvailable($empty = false)
 {
     $sql = new SQLObject();
     if ($sql->query("\r\nSELECT p.permission_module_codename AS module_codename, p.permission_name AS codename, p.permission_value AS value, m.name AS module_name\r\nFROM " . $sql->table('modules_permissions') . " AS p\r\nLEFT JOIN " . $sql->table('modules') . " AS m\r\nON p.permission_module_codename||'.mod.php' = m.filename")) {
         $f_permissions_modules = array();
         $f_permissions = array();
         $modules = array();
         foreach ($sql->fetch() as $perm) {
             if (!in_array($perm->module_name, $modules)) {
                 $f_permissions_modules[] = array('PERMISSIONS_MODULE' => $perm->module_name, 'PERMISSIONS_MODULE_CODENAME' => $perm->module_codename);
                 $modules[] = $perm->module_name;
             }
             $f_permissions[$perm->module_codename][] = array('PERMISSIONS_CODENAME' => $perm->codename, 'PERMISSIONS_NAME' => '{L_PERMISSION.' . $perm->module_codename . '.' . $perm->codename . '}');
             $values = explode(';', $perm->value);
             $f_values = array();
             $i = 0;
             foreach ($values as $value) {
                 $f_values[] = array('PERMISSION_NAME' => '{L_PERMISSION.' . $perm->module_codename . '.' . $perm->codename . '.' . $value . '}', 'PERMISSION_VALUE' => $value);
                 $i++;
             }
             core::s('tpl')->assignLoop('GROUP_PERMISSIONS-' . $perm->module_codename . '-' . $perm->codename, $f_values);
         }
         core::s('tpl')->assignLoop('GROUP_PERMISSIONS', $f_permissions_modules);
         foreach ($f_permissions as $module_codename => $loop) {
             core::s('tpl')->assignLoop('GROUP_PERMISSIONS-' . $module_codename, $loop);
         }
     }
 }
开发者ID:jankuca,项目名称:smog-cms,代码行数:28,代码来源:auth.mod.php


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