本文整理汇总了PHP中p_master::assign_tpl_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP p_master::assign_tpl_vars方法的具体用法?PHP p_master::assign_tpl_vars怎么用?PHP p_master::assign_tpl_vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类p_master
的用法示例。
在下文中一共展示了p_master::assign_tpl_vars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main module handler.
*
* @param string $short_name Module short name
* @param string $mode Module mode
* @return null
*/
public function main($short_name, $mode)
{
try {
$this->controller->base($mode, $this->u_action);
} catch (\Exception $e) {
$message = $e->getMessage() . '<br /><br />' . $this->user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
meta_refresh(3, $this->u_action);
trigger_error($message);
}
$style_path = $this->ext_root . 'styles/' . rawurlencode($this->user->style['style_path']) . '/';
$u_ucp = append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext);
$this->template->assign_vars(array('S_ACTION' => $this->u_action, 'TITANIA_THEME_PATH' => $style_path . 'theme/'));
$this->p_master->assign_tpl_vars($u_ucp);
$this->template->set_filenames(array('body' => '@phpbb_titania/ucp/subscriptions.html'));
page_header($this->user->lang['SUBSCRIPTION_TITANIA']);
page_footer();
}
示例2: _module_zebra
while ($row = $db->sql_fetchrow($result)) {
$which = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'online' : 'offline';
$template->assign_block_vars("friends_{$which}", array('USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'])));
}
$db->sql_freeresult($result);
}
// Do not display subscribed topics/forums if not allowed
if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) {
$module->set_display('main', 'subscribed', false);
}
// Select the active module
$module->set_active($id, $mode);
// Load and execute the relevant module
$module->load_active();
// Assign data to the template engine for the list of modules
$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.{$phpEx}"));
// Generate the page, do not display/query online list
$module->display($module->get_page_title(), false);
/**
* Function for assigning a template var if the zebra module got included
*/
function _module_zebra($mode, &$module_row)
{
global $template;
$template->assign_var('S_ZEBRA_ENABLED', true);
if ($mode == 'friends') {
$template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true);
}
if ($mode == 'foes') {
$template->assign_var('S_ZEBRA_FOES_ENABLED', true);
}
示例3: array
* @since 3.1.0-b2
*/
$vars = array(
'module',
'mode',
'user_id',
'forum_id',
'topic_id',
'post_id',
'username',
'id',
);
extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars)));
// Load and execute the relevant module
$module->load_active();
// Assign data to the template engine for the list of modules
$module->assign_tpl_vars(append_sid("{$phpbb_root_path}mcp.$phpEx"));
// Generate urls for letting the moderation control panel being accessed in different modes
$template->assign_vars(array(
'U_MCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main'),
'U_MCP_FORUM' => ($forum_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=forum_view&f=$forum_id") : '',
'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&t=$topic_id") : '',
'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&t=$topic_id&p=$post_id") : '',
));
// Generate the page, do not display/query online list
$module->display($module->get_page_title());
示例4: adm_page_header
$module_id = request_var('i', '');
$mode = request_var('mode', '');
// Set custom template for admin area
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
// the acp template is never stored in the database
$user->theme['template_storedb'] = false;
// Instantiate new module
$module = new p_master();
// Instantiate module system and generate list of available modules
$module->list_modules('acp');
// Select the active module
$module->set_active($module_id, $mode);
// Assign data to the template engine for the list of modules
// We do this before loading the active module for correct menu display in trigger_error
$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.{$phpEx}"));
// Load and execute the relevant module
$module->load_active();
// Generate the page
adm_page_header($module->get_page_title());
$template->set_filenames(array('body' => $module->get_tpl_name()));
adm_page_footer();
/**
* Header for acp pages
*/
function adm_page_header($page_title)
{
global $config, $db, $user, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
if (defined('HEADER_INC')) {
return;