assign_tpl_vars() public method

Build navigation structure
public assign_tpl_vars ( $module_url )
 /**
  * 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();
 }
Beispiel #2
0
    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);
    }
Beispiel #3
0
* @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());
Beispiel #4
0
$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;
Beispiel #5
0
    $module->set_display('main', 'forum_view', false);
    $module->set_display('logs', 'forum_logs', false);
}
if (!$user_id && $username == '') {
    $module->set_display('notes', 'user_notes', false);
    $module->set_display('warn', 'warn_user', false);
}
/**
* This event allows you to set display option for custom MCP modules
*
* @event core.modify_mcp_modules_display_option
* @var	p_master	module			Module system class
* @var	string		mode			MCP mode
* @var	int			user_id			User id
* @var	int			forum_id		Forum id
* @var	int			topic_id		Topic id
* @var	int			post_id			Post id
* @var	string		username		User name
* @var	int			id				Parent module id
* @since 3.1.0-b2
*/
$vars = array('module', 'mode', 'user_id', 'forum_id', 'topic_id', 'post_id', 'username', 'id');
extract($src_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("{$src_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("{$src_root_path}mcp.{$phpEx}", 'i=main'), 'U_MCP_FORUM' => $forum_id ? append_sid("{$src_root_path}mcp.{$phpEx}", "i=main&amp;mode=forum_view&amp;f={$forum_id}") : '', 'U_MCP_TOPIC' => $forum_id && $topic_id ? append_sid("{$src_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("{$src_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());