當前位置: 首頁>>代碼示例>>PHP>>正文


PHP p_master::assign_tpl_vars方法代碼示例

本文整理匯總了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();
 }
開發者ID:Sajaki,項目名稱:customisation-db,代碼行數:24,代碼來源:subscriptions_module.php

示例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);
    }
開發者ID:puring0815,項目名稱:OpenKore,代碼行數:31,代碼來源:ucp.php

示例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&amp;mode=forum_view&amp;f=$forum_id") : '',
	'U_MCP_TOPIC'	=> ($forum_id && $topic_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;t=$topic_id") : '',
	'U_MCP_POST'	=> ($forum_id && $topic_id && $post_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;t=$topic_id&amp;p=$post_id") : '',
));

// Generate the page, do not display/query online list
$module->display($module->get_page_title());
開發者ID:abhinay100,項目名稱:phpbb2_app,代碼行數:30,代碼來源:mcp.php

示例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;
開發者ID:PetsFundation,項目名稱:Pets,代碼行數:31,代碼來源:index.php


注:本文中的p_master::assign_tpl_vars方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。