Adding a page-header in the template

skala
Julio Montoya 13 years ago
parent 5a00d447e0
commit d30ebe4c19
  1. 4
      main/admin/index.php
  2. 25
      main/inc/lib/display.lib.php
  3. 6
      main/inc/lib/social.lib.php
  4. 1
      main/inc/lib/template.lib.php
  5. 7
      main/template/default/layout/footer.tpl
  6. 11
      main/template/default/layout/layout_1_col.tpl
  7. 3
      main/template/default/layout/layout_2_col.tpl
  8. 4
      main/template/default/layout/main_header.tpl
  9. 16
      main/template/default/layout/page_body.tpl
  10. 1
      main/template/default/layout/show_header.tpl
  11. 14
      whoisonline.php

@ -107,8 +107,8 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'course_add.php', 'label' => get_lang('AddCourse'));
} else {
$items[] = array('url'=>'course_request_review.php', 'label' => get_lang('ReviewCourseRequests'));
$items[] = array('url'=>'course_request_accepted.php', 'label' => get_lang('ReviewCourseRequests'));
$items[] = array('url'=>'course_request_rejected.php', 'label' => get_lang('ReviewCourseRequests'));
$items[] = array('url'=>'course_request_accepted.php', 'label' => get_lang('AcceptedCourseRequests'));
$items[] = array('url'=>'course_request_rejected.php', 'label' => get_lang('RejectedCourseRequests'));
}
$items[] = array('url'=>'course_export.php', 'label' => get_lang('ExportCourses'));

@ -48,21 +48,36 @@ class Display {
* @param string The name of the page (will be showed in the page title)
* @param string Optional help file name
*/
public static function display_header($tool_name ='', $help = null) {
public static function display_header($tool_name ='', $help = null, $page_header = null) {
$nameTools = $tool_name;
/*
global $_plugins, $lp_theme_css, $mycoursetheme, $user_theme, $platform_theme;
global $httpHeadXtra, $htmlHeadXtra, $htmlIncHeadXtra, $_course, $_user, $text_dir, $plugins, $_user, $_cid, $interbreadcrumb, $charset, $language_file, $noPHP_SELF;
global $menu_navigation;
global $htmlCSSXtra;
global $htmlCSSXtra; */
self::$global_template = new Template($tool_name);
self::$global_template->set_help($help);
if (!empty(self::$preview_style)) {
self::$global_template->preview_theme = self::$preview_style;
self::$global_template->set_theme();
}
if (!empty($page_header)) {
self::$global_template->assign('header', $page_header);
}
echo self::$global_template->show_header_template();
}
/*
*
public static function assign_template_variable($variable, $content) {
if (isset(self::$global_template)) {
self::$global_template->assign($variable, $content);
} else {
//Dev message
echo 'You need to called the display_header first';
exit;
}
}*/
/**
* Displays the reduced page header (without banner)
@ -81,12 +96,10 @@ class Display {
/**
* Display the page footer
*/
public static function display_footer () {
public static function display_footer() {
global $_plugins, $global_tpl;
echo self::$global_template ->show_footer_template();
}
/**
* Displays the tool introduction of a tool.

@ -839,10 +839,8 @@ class SocialManager extends UserManager {
$status = get_status_from_code($user_object->status);
$interbreadcrumb[] = array('url' => 'whoisonline.php', 'name' => get_lang('UsersOnLineList'));
Display::display_header($alt);
echo '<div class="actions-title">';
echo $alt;
echo '</div><br />';
Display::display_header($alt, null, $alt);
echo '<div>';
echo '<div style="margin:0 auto; width:350px; border:1px;">';

@ -26,6 +26,7 @@ class Template extends Smarty {
function __construct($title = '', $show_header = true, $show_footer = true, $show_learnpath = false) {
parent::__construct();
$this->title = $title;
//$this->assign('header', $title);
$this->show_learnpath = $show_learnpath;
//Smarty 3 configuration
$this->setTemplateDir(api_get_path(SYS_CODE_PATH).'template/');

@ -1,6 +1,5 @@
<div id="footer"> <!-- start of #footer section -->
<div class="container">
<div class="container">
<div class="copyright">
{if $administrator_name }
<div class="admin_name">
@ -50,6 +49,4 @@ $(document).ready( function() {
});
</script>
{/literal}
{$execution_stats}
{$execution_stats}

@ -9,15 +9,8 @@
{* 1 column *}
{block name=body}
<div class="span12">
{* Actions *}
{if (!empty($actions) ) }
<div class="actions">
{$actions}
</div>
{/if}
{* Notifications*}
{$message}
{include file="default/layout/page_body.tpl"}
<section id="main_content">
{* Main content *}
{$content}

@ -14,8 +14,7 @@
{include file="default/layout/sniff.tpl"}
{/if}
<div class="span9">
<div class="span9">
{* Course plugin block*}
<section id="courses_plugin">
{$plugin_courses_block}

@ -53,5 +53,5 @@
{* breadcrumb *}
{$breadcrumb}
<div class="row">
{/if}
<div class="row">
{/if}

@ -0,0 +1,16 @@
{* Actions *}
{if (!empty($actions)) }
<div class="actions">
{$actions}
</div>
{/if}
{* Page header*}
{if !empty($header) }
<div class="page-header">
<h1>{$header}</h1>
</div>
{/if}
{* Notifications*}
{$message}

@ -5,4 +5,5 @@
{include file="default/layout/main_header.tpl"}
{if $show_header}
<div class="span12">
{include file="default/layout/page_body.tpl"}
{/if}

@ -175,16 +175,19 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
$query = isset($_GET['q']) ? $_GET['q']: null;
$social_right_content .= UserManager::get_search_form($query);
}
}
$social_right_content .= Display::tag('h2', get_lang('UsersOnLineList'));
}
$social_right_content .= SocialManager::display_user_list($user_list);
}
}
if (isset($_GET['id'])) {
//SocialManager::display_individual_user($_GET['id']);
header("Location: ".api_get_path(WEB_CODE_PATH)."social/profile.php?u=?".$_GET['id']);
exit;
if (api_get_setting('allow_social_tool') == 'true') {
header("Location: ".api_get_path(WEB_CODE_PATH)."social/profile.php?u=?".$_GET['id']);
exit;
} else {
SocialManager::display_individual_user($_GET['id']);
}
}
} else {
api_not_allowed();
@ -205,5 +208,6 @@ if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) {
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('header', get_lang('UsersOnLineList'));
$tpl->assign('content', $content);
$tpl->display_one_col_template();

Loading…
Cancel
Save