本文整理汇总了PHP中TPL::modify方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::modify方法的具体用法?PHP TPL::modify怎么用?PHP TPL::modify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::modify方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->menu = new stdClass();
$this->menu->acp = new stdClass();
$this->menu->acp->main = new MenuObject('MENU_ACP_MAIN');
$this->menu->acp->modules = new MenuObject('MENU_ACP_MODULES');
$this->menu->acp->sub = new MenuObject('MENU_ACP_SUB');
$this->menu->sys = new stdClass();
$this->menu->sys->main = new MenuObject('MENU_SYS_MAIN');
if (defined('IN_SYS') && IN_SYS) {
} elseif (defined('IN_ACP') && IN_ACP) {
$this->menu->acp->modules->addItem('./acp.php?c=menu', '{L_MODULE_MENU}', array('ACTIVE' => isset($_GET['c']) && $_GET['c'] == 'menu'));
TPL::modify('
Modules::$modules->menu->menu->acp->main->make();
Modules::$modules->menu->menu->acp->modules->make();
if(!Modules::$modules->menu->menu->acp->sub->numItems()) self::cond(\'MENU_ACP_SUB\',false);
else self::assignCond(\'MENU_ACP_SUB\',true);
Modules::$modules->menu->menu->acp->sub->make();', false);
//echo('in menu module - on line 42 :D :: http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] != '' ? '?'.$_SERVER['QUERY_STRING'] : ''));
}
}
示例2: module_text
<?php
class module_text
{
}
Modules::$modules->text = new module_text();
if (defined('IN_SYS') && IN_SYS) {
TPL::modify('
preg_match_all(\'#{TEXT:([a-zA-Z0-9-_]+)}#s\',self::$output,$arr);
if(count($arr[1]))
{
$cfg = core::s(\'cfg\');
$sql = new SQLObject();
$query = "SELECT text_key,text_value FROM " . $sql->table(\'text\') . " WHERE ((text_lang = \'\' OR text_lang = \'" . $cfg[\'etc\'][\'core\'][\'site_lang\'] . "\') AND (";
for($i = 0; $i < count($arr[1]); $i++)
{
$query .= "text_key = \'" . $arr[1][$i] . "\'";
if($i != count($arr[1]) - 1) $query .= " OR ";
else $query .= "))";
}
if($sql->query($query))
foreach($sql->fetch() as $text) self::$output = str_replace(\'{TEXT:\' . $text->text_key . \'}\',$text->text_value,self::$output);
}', true);
}
if (defined('IN_ACP') && IN_ACP) {
Modules::$modules->menu->menu->acp->modules->addItem('./acp.php?c=' . $MODULE_NAME, '{L_MODULE_TEXT}', array('ACTIVE' => isset($_GET['c']) && $_GET['c'] == $MODULE_NAME));
}
示例3: array
<?php
TPL::addTpl('header');
TPL::modify('TPL::addTpl(\'side\');');
TPL::modify('TPL::addTpl(\'footer\');');
/*
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/accounts/o8/id');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml'));
#curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
echo(curl_exec($ch));
// close cURL resource, and free up system resources
curl_close($ch);
*/
示例4: strlen
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));
}
TPL::assignAsLoop('MODULE_CONFIG:SITE_STYLE', $f_styles);
}
}
Modules::$modules->{$GLOBALS['MODULE_NAME']} = new module_core();
Langs::load('core');
if (defined('IN_SYS') && IN_SYS || defined('IN_ACP') && IN_ACP) {
TPL::addTpl('header');
if (!isset($_GET['c'])) {
TPL::addTpl('homepage');
}
TPL::modify('self::addTpl(\'footer\');self::$output .= self::$loadedTpls[\'footer\'];');
}
if (defined('IN_ACP') && IN_ACP) {
Modules::$modules->menu->menu->acp->main->addItem('./acp.php', '{L_ACP_HOME}', array('ACTIVE' => !isset($_GET['c'])));
Modules::$modules->menu->menu->acp->main->addItem('./', '{L_INDEX}', array('ACTIVE' => false));
if (permission('core', 'modules', 'show')) {
Modules::$modules->menu->menu->acp->main->addItem('./acp.php?c=modules', '{L_MODULES}', array('ACTIVE' => isset($_GET['c']) && $_GET['c'] == 'modules'));
}
if (permission('core', 'config', 'edit')) {
Modules::$modules->menu->menu->acp->main->addItem('./acp.php?c=config&module=core', '{L_SITE_CONFIG}', array('ACTIVE' => isset($_GET['c'], $_GET['module']) && $_GET['c'] == 'config' && $_GET['module'] == 'core'));
}
if (!isset($_GET['c'])) {
TPL::add('SITE_TITLE', '{SITE_HEADER} / {L_ACP}');
} else {
switch ($_GET['c']) {
/* case('config'):
示例5:
<?php
if (!isset($_GET['c'])) {
TPL::modify('TPL::addTpl(\'index\');');
}
示例6: switch
core::s('tpl')->setSiteTitle('{L_USERS_ADD_USER}');
break;
}
}
break;
case 'groups':
if (!isset($_GET['mode'])) {
Modules::$modules->auth->groups_getGrouplist();
TPL::modify('
self::addTpl(\'auth-users-grouplist\');');
core::s('tpl')->setSiteTitle('{L_USERS_GROUPS}');
} else {
switch ($_GET['mode']) {
case 'add':
Modules::$modules->auth->getPermissionsAvailable(true);
TPL::modify('
self::addTpl(\'auth-users-add-group\');');
core::s('tpl')->setSiteTitle('{L_USERS} – {L_USERS_ADD_USER}');
TPL::add('USERS_ADD_GROUP_FROM_ACTION', './action.php?c=users&section=groups&mode=add');
break;
}
}
break;
}
}
break;
}
}
}
if (defined('IN_ACTION') && IN_ACTION) {
if (isset($_GET['c']) && $_GET['c'] == 'users') {
if (isset($_GET['section'])) {