本文整理汇总了PHP中CMS::admin方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::admin方法的具体用法?PHP CMS::admin怎么用?PHP CMS::admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::admin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* @param array $config
*/
static function initialize($config = array())
{
foreach ($config as $key => $value) {
self::${$key} = $value;
}
CMS::$admin = self::$path;
//if (!self::$jquery) self::$jquery = CMS::stdfile_url('scripts/jquery-1.4.2.js');
if (!self::$jquery) {
self::$jquery = '/tao/scripts/jquery.js';
}
self::$site = CMS::$defsite;
}
示例2: user_is_admin
public function user_is_admin()
{
if (CMS::admin()) {
return true;
}
if (!WS::env()->auth->user) {
return false;
}
if (!WS::env()->auth->user) {
return false;
}
$ga = $this->group_admins();
if ($ga && WS::env()->auth->user->check_access($ga)) {
return true;
}
return false;
}
示例3: page_navigator
public function page_navigator($view, $pagenum, $numpages, $url)
{
$app = CMS::app_path('views/helpers');
$lib = CMS::tao_view('helpers');
$templates = array();
if (CMS::admin()) {
$templates[] = "{$app}/page-navigator-admin.phtml";
$templates[] = "{$lib}/page-navigator-admin.phtml";
} else {
$templates[] = "{$app}/page-navigator-site.phtml";
$templates[] = "{$app}/page-navigator.phtml";
}
$templates[] = "{$lib}/page-navigator.phtml";
foreach ($templates as $template) {
if (IO_FS::exists($template)) {
break;
}
}
self::$pn_url = $url;
self::$pn_current = $pagenum;
return $view->partial($template, array('tpl' => $url, 'page' => $pagenum, 'numpages' => $numpages));
}
示例4: user
public function user()
{
if (Core::is_cli()) {
return 'cli';
}
if (CMS::admin()) {
return 'admin-' . WS::env()->admin_auth->user->login;
}
if (WS::env()->auth->user) {
return WS::env()->auth->user->id;
}
return false;
}
示例5: site_lang
/**
* Возвращает язык текущего сайта (для многосайтовых конфигураций) или админа
*
* @return string
*/
static function site_lang()
{
if (self::$forced_lang) {
return self::$forced_lang;
}
if (CMS::admin()) {
return CMS_Admin::$lang;
}
$data = self::$sites[self::$site];
if (!isset($data)) {
return self::$default_lang;
}
if (!isset($data['lang'])) {
return self::$default_lang;
}
return $data['lang'];
}
示例6: path
protected function path($name = false)
{
$path = self::$dir;
$site = CMS::admin() ? CMS_Admin::site() : CMS::site();
if ($site != '__') {
$path .= "/{$site}";
}
if ($name) {
$name = trim(str_replace('.', '/', $name));
$path .= "/{$name}";
}
return $path;
}
示例7: auth_parms
protected static function auth_parms($mp, $client)
{
$auth_parms = array();
if ($mp) {
if (is_string($mp)) {
$mp = explode(',', $mp);
}
if (Core_Types::is_iterable($mp)) {
foreach ($mp as $_mp) {
$_mp = trim($_mp);
if ($_mp != '') {
$_v = true;
if ($m = Core_Regexps::match_with_results('{^([^=]+)=(.+)$}', $_mp)) {
$_mp = trim($m[1]);
$_v = trim($m[2]);
}
if ($_mp == 'lang') {
CMS::site_set_lang($_v);
}
if ($_mp == 'admin_sites') {
$_asites = explode('|', $_v);
$_v = array();
$_las = '__';
foreach ($_asites as $_asite) {
$_asite = trim($_asite);
if ($_asite != '') {
$_v[$_asite] = $_asite;
$_las = $_asite;
}
}
if (CMS::admin()) {
if (!isset($_v[CMS_Admin::site()])) {
header("location: /cms-actions/subsite/{$_las}");
die;
}
}
}
CMS::$globals[$_mp] = $_v;
$auth_parms[$_mp] = $_v;
}
}
}
if ($client) {
CMS::$globals['full'] = false;
}
}
return $auth_parms;
}