]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21119 lang menu and login info now handled by themes
authorPetr Skoda <skodak@moodle.org>
Tue, 29 Dec 2009 17:26:29 +0000 (17:26 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 29 Dec 2009 17:26:29 +0000 (17:26 +0000)
26 files changed:
auth/shibboleth/login.php
calendar/delete.php
calendar/event.php
calendar/export.php
calendar/preferences.php
calendar/view.php
course/info.php
course/view.php
group/assign.php
group/members.php
index.php
lib/deprecatedlib.php
lib/outputcomponents.php
lib/outputrenderers.php
lib/weblib.php
login/index.php
login/signup.php
mod/hotpot/view.php
my/index.php
theme/base/config.php
theme/base/layout/frontpage.php
theme/base/layout/general.php
theme/standard/config.php
theme/standard/layout/frametop.php
theme/standard/layout/home.php
theme/standard/layout/normal.php

index b37d1f9558e162c6855a2af79f55ef122d7479d9..b77f45b2150a3e9131b30e750ae08612cd0f360c 100644 (file)
@@ -21,17 +21,6 @@ httpsrequired();
 /// Define variables used in page
     $site = get_site();
 
-    if (empty($CFG->langmenu)) {
-        $langmenu = "";
-    } else {
-        $currlang = current_language();
-        $langs    = get_list_of_languages();
-        $select = html_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
-        $select->nothinglabel = false;
-        $select->set_label(get_accesshide(get_string('language')));
-        $langmenu = '<div class="langmenu">'.$OUTPUT->select($select).'</div>';
-    }
-
     $loginsite = get_string("loginsite");
 
     $loginurl = (!empty($CFG->alternateloginurl)) ? $CFG->alternateloginurl : '';
@@ -82,7 +71,6 @@ httpsrequired();
     $PAGE->set_title("$site->fullname: $loginsite");
     $PAGE->set_heading($site->fullname);
     $PAGE->set_focuscontrol('idp');
-    $PAGE->set_headingmenu($langmenu);
 
     echo $OUTPUT->header();
     include("index_form.html");
index b42fc294bc33e74b1822f1817d670cdab61c9406..c92ed08db579eb064b3af25a1c5b26795eebfa69 100644 (file)
@@ -95,7 +95,6 @@ $PAGE->navbar->add($strcalendar, $viewcalendarurl);
 $PAGE->navbar->add($title);
 $PAGE->set_title($site->shortname.': '.$strcalendar.': '.$title);
 $PAGE->set_heading($strcalendar);
-$PAGE->set_headingmenu(user_login_string($site));
 
 echo $OUTPUT->header();
 echo $OUTPUT->box_start('eventlist');
index 405a95951c4ddc0ec3c57833f5023e029a5824c0..bcc94083fc5cd6d49032741f6f06a0545b01109d 100644 (file)
@@ -207,7 +207,6 @@ $PAGE->navbar->add($strcalendar, $link);
 $PAGE->navbar->add($title);
 $PAGE->set_title($site->shortname.': '.$strcalendar.': '.$title);
 $PAGE->set_heading($strcalendar);
-$PAGE->set_headingmenu(user_login_string($site));
 
 echo $OUTPUT->header();
 
index e3ef48ce0203ad2bf3ee87f5c6d919f78e64d241..eae5bbcfbcc26154c52f886f0200531b4368c0bc 100644 (file)
@@ -133,7 +133,6 @@ $PAGE->navbar->add($pagetitle);
 
 $PAGE->set_title($site->shortname.': '.$strcalendar.': '.$pagetitle);
 $PAGE->set_heading($strcalendar);
-$PAGE->set_headingmenu(user_login_string($site));
 $PAGE->set_button($prefsbutton);
 $PAGE->set_focuscontrol('eventform.name');
 
index 01a1c2b23ec70f08658d1320e89816a3ebcb1345..935c5b137734860b5d1f3f83beb2ab1b5041b4fd 100644 (file)
@@ -68,7 +68,6 @@ $PAGE->navbar->add($strpreferences, new moodle_url($CFG->wwwroot.'/calendar/view
 
 $PAGE->set_title("$site->shortname: $strcalendar: $strpreferences");
 $PAGE->set_heading($strcalendar);
-$PAGE->set_headingmenu(user_login_string($site));
 
 echo $OUTPUT->header();
 
index b348425f7fdc723dcba2e960de33c55cba4d2426..da79b2812fb19003d43f9e59595e75df182bb9ce 100644 (file)
@@ -152,7 +152,6 @@ $prefsbutton = calendar_preferences_button();
 // Print title and header
 $PAGE->set_title("$site->shortname: $strcalendar: $pagetitle");
 $PAGE->set_heading($strcalendar);
-$PAGE->set_headingmenu(user_login_string($site));
 $PAGE->set_button($prefsbutton);
 
 $PAGE->requires->yui2_lib('animation');
index e30301d59aef2d9173042dddfe9df79689b6a4a3..2065271c06a4a74e718c86e7fc948672745b4603 100644 (file)
@@ -38,7 +38,6 @@
     $PAGE->set_heading('Course info');
     $PAGE->set_course($course);
     $PAGE->navbar->add(get_string('summary'));
-    $PAGE->set_headingmenu(user_login_string());
 
     echo $OUTPUT->header();
     echo $OUTPUT->heading('<a href="view.php?id='.$course->id.'">'.format_string($course->fullname) . '</a><br />(' . format_string($course->shortname) . ')');
index fb7319da74613cbc67da83c175971cac529736b8..3c1f3309cf337be2b7eaf88f5d1f913ce890b812 100644 (file)
     $PAGE->set_title(get_string('course') . ': ' . $course->fullname);
     $PAGE->set_heading($course->fullname);
     $PAGE->set_button($buttons);
-    //TODO: MDL-21123 this should be done in course page layout, not here with this ugly hack!
-    //$PAGE->set_headingmenu(user_login_string($course, $USER));
     echo $OUTPUT->header();
 
     if ($completion->is_enabled() && ajaxenabled()) {
index 78fec568ce3bb1d2d6a6e4e8bff287f1063b5bc8..b8d7b54561593c72e965b86e6886258cdd9aa1df 100644 (file)
@@ -123,7 +123,6 @@ $PAGE->navbar->add($straddgroupstogroupings);
 /// Print header
 $PAGE->set_title("$course->shortname: $strgroups");
 $PAGE->set_heading($course->fullname);
-$PAGE->set_headingmenu(user_login_string($course, $USER));
 echo $OUTPUT->header();
 
 ?>
index 0c0f92885ba98e91a45749c583e78d9c875eea94..8d563c6df903c2f7efe83808f2601e5dbcde4aa4 100644 (file)
@@ -85,7 +85,6 @@ $PAGE->navbar->add($stradduserstogroup);
 /// Print header
 $PAGE->set_title("$course->shortname: $strgroups");
 $PAGE->set_heading($course->fullname);
-$PAGE->set_headingmenu(user_login_string($course, $USER));
 echo $OUTPUT->header();
 ?>
 
index 7827976ab623dadbf278375cd65a4f0280ffd1d8..ea44a8a30edb9a874614c6285d42f5b6983fc63d 100644 (file)
--- a/index.php
+++ b/index.php
     $PAGE->set_pagetype('site-index');
     $PAGE->set_course($SITE);
 
-    if (empty($CFG->langmenu)) {
-        $langmenu = '';
-    } else {
-        $currlang = current_language();
-        $langs = get_list_of_languages();
-
-        $select = html_select::make_popup_form($CFG->wwwroot .'/index.php', 'lang', $langs, 'chooselang', $currlang);
-        $select->nothinglabel = false;
-        $select->set_label(get_accesshide(get_string('language')));
-        //TODO: MDL-21123
-        $langmenu = '<div class="langmenu">'.$OUTPUT->select($select).'</div>';
-    }
     $PAGE->set_other_editing_capability('moodle/course:manageactivities');
     $PAGE->set_url('');
     $PAGE->set_docs_path('');
@@ -88,8 +76,7 @@
     $editing = $PAGE->user_is_editing();
     $PAGE->set_title($SITE->fullname);
     $PAGE->set_heading($SITE->fullname);
-    $PAGE->set_headingmenu($langmenu);
-    echo $OUTPUT->header($langmenu);
+    echo $OUTPUT->header();
 
 /// Print Section
     if ($SITE->numsections > 0) {
index 3ebeecf3960bb2ff2caa9aafa646f85ca69a44c2..675a94fbb85b4decd9cb3d14315f1bb2bab7feda 100644 (file)
@@ -2169,6 +2169,23 @@ function print_footer($course = NULL, $usercourse = NULL, $return = false) {
     }
 }
 
+/**
+ * Returns text to be displayed to the user which reflects their login status
+ *
+ * @global object
+ * @global object
+ * @global object
+ * @global object
+ * @uses CONTEXT_COURSE
+ * @param course $course {@link $COURSE} object containing course information
+ * @param user $user {@link $USER} object containing user information
+ * @return string HTML
+ */
+function user_login_string($course='ignored', $user='ignored') {
+    debugging('user_login_info() has been deprecated. User login info is now handled via themes layouts.');
+    return '';
+}
+
 /**
  * Prints a nice side block with an optional header.  The content can either
  * be a block of HTML or a list of text with optional icons.
index 20a277f6e7ec0fb68187c246a7e728cca2bda598..dc1a6179f61af97b447f6683ec64cdd2436debbc 100644 (file)
@@ -556,10 +556,6 @@ class html_select extends labelled_html_component {
             $selectedurl = $baseurl->out(false, array($name => $selected), false);
         }
 
-        if (!($baseurl instanceof moodle_url)) {
-            $baseurl = new moodle_url($baseurl);
-        }
-
         // Replace real value by formatted URLs
         foreach ($options as $value => $label) {
             $options[$baseurl->out(false, array($name => $value), false)] = $label;
index 56966d4f68a44464884edab2da3803756c1e6b17..ddede978f80c890ac97e646d426062254465f6a8 100644 (file)
@@ -458,8 +458,80 @@ class core_renderer extends renderer_base {
      * @return string HTML fragment.
      */
     public function login_info() {
-        global $USER;
-        return user_login_string($this->page->course, $USER);
+        global $USER, $CFG, $DB;
+    
+        if (during_initial_install()) {
+            return '';
+        }
+    
+        $course = $this->page->course;
+    
+        if (session_is_loggedinas()) {
+            $realuser = session_get_realuser();
+            $fullname = fullname($realuser, true);
+            $realuserinfo = " [<a $CFG->frametarget
+            href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;return=1&amp;sesskey=".sesskey()."\">$fullname</a>] ";
+        } else {
+            $realuserinfo = '';
+        }
+    
+        $loginurl = get_login_url();
+    
+        if (empty($course->id)) {
+            // $course->id is not defined during installation
+            return '';
+        } else if (!empty($USER->id)) {
+            $context = get_context_instance(CONTEXT_COURSE, $course->id);
+    
+            $fullname = fullname($USER, true);
+            $username = "<a $CFG->frametarget href=\"$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id\">$fullname</a>";
+            if (is_mnet_remote_user($USER) and $idprovider = $DB->get_record('mnet_host', array('id'=>$USER->mnethostid))) {
+                $username .= " from <a $CFG->frametarget href=\"{$idprovider->wwwroot}\">{$idprovider->name}</a>";
+            }
+            if (isset($USER->username) && $USER->username == 'guest') {
+                $loggedinas = $realuserinfo.get_string('loggedinasguest').
+                          " (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
+            } else if (!empty($USER->access['rsw'][$context->path])) {
+                $rolename = '';
+                if ($role = $DB->get_record('role', array('id'=>$USER->access['rsw'][$context->path]))) {
+                    $rolename = ': '.format_string($role->name);
+                }
+                $loggedinas = get_string('loggedinas', 'moodle', $username).$rolename.
+                          " (<a $CFG->frametarget
+                          href=\"$CFG->wwwroot/course/view.php?id=$course->id&amp;switchrole=0&amp;sesskey=".sesskey()."\">".get_string('switchrolereturn').'</a>)';
+            } else {
+                $loggedinas = $realuserinfo.get_string('loggedinas', 'moodle', $username).' '.
+                          " (<a $CFG->frametarget href=\"$CFG->wwwroot/login/logout.php?sesskey=".sesskey()."\">".get_string('logout').'</a>)';
+            }
+        } else {
+            $loggedinas = get_string('loggedinnot', 'moodle').
+                          " (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
+        }
+    
+        $loggedinas = '<div class="logininfo">'.$loggedinas.'</div>';
+    
+        if (isset($SESSION->justloggedin)) {
+            unset($SESSION->justloggedin);
+            if (!empty($CFG->displayloginfailures)) {
+                if (!empty($USER->username) and $USER->username != 'guest') {
+                    if ($count = count_login_failures($CFG->displayloginfailures, $USER->username, $USER->lastlogin)) {
+                        $loggedinas .= '&nbsp;<div class="loginfailures">';
+                        if (empty($count->accounts)) {
+                            $loggedinas .= get_string('failedloginattempts', '', $count);
+                        } else {
+                            $loggedinas .= get_string('failedloginattemptsall', '', $count);
+                        }
+                        if (has_capability('coursereport/log:view', get_context_instance(CONTEXT_SYSTEM))) {
+                            $loggedinas .= ' (<a href="'.$CFG->wwwroot.'/course/report/log/index.php'.
+                                                 '?chooselog=1&amp;id=1&amp;modid=site_errors">'.get_string('logs').'</a>)';
+                        }
+                        $loggedinas .= '</div>';
+                    }
+                }
+            }
+        }
+    
+        return $loggedinas;
     }
 
     /**
@@ -668,6 +740,35 @@ class core_renderer extends renderer_base {
         return $this->opencontainers->pop_all_but_last($shouldbenone);
     }
 
+    /**
+     * Returns lang menu or '', this method also checks forcing of languages in courses.
+     * @return string
+     */
+    public function lang_menu() {
+        global $CFG;
+
+        if (empty($CFG->langmenu)) {
+            return '';
+        }
+
+        if ($this->page->course != SITEID and !empty($this->page->course->lang)) {
+            // do not show lang menu if language forced
+            return '';
+        }
+
+        $currlang = current_language();
+        $langs = get_list_of_languages();
+        
+        if (count($langs) < 2) {
+            return '';
+        }
+
+        $select = html_select::make_popup_form($this->page->url, 'lang', $langs, 'chooselang', $currlang);
+        $select->nothinglabel = false;
+        $select->set_label(get_accesshide(get_string('language')));
+        return '<div class="langmenu">'.$this->select($select).'</div>';
+    }
+
     /**
      * Output the row of editing icons for a block, as defined by the controls array.
      * @param array $controls an array like {@link block_contents::$controls}.
@@ -1028,7 +1129,7 @@ class core_renderer extends renderer_base {
      * @param moodle_action_icon $icon A moodle_action_icon object
      * @return string HTML fragment
      */
-    public function action_icon($icon) {
+    public function action_icon(moodle_action_icon $icon) {
         $icon = clone($icon);
         $icon->prepare($this, $this->page, $this->target);
         $imageoutput = $this->image($icon->image);
index b99b5e141343ae5b786715997943d667a61d0cee..0afb83d8afe7299e68ff38d28a643b92d1eee7bc 100644 (file)
@@ -498,6 +498,7 @@ class moodle_url {
         $uri .= $this->host ? $this->host : '';
         $uri .= $this->port ? ':'.$this->port : '';
         $uri .= $this->path ? $this->path : '';
+
         if (!$omitquerystring) {
             $querystring = $this->get_query_string($overrideparams, $escaped);
             if ($querystring) {
@@ -1906,101 +1907,6 @@ function send_headers($contenttype, $cacheable = true) {
     @header('Accept-Ranges: none');
 }
 
-/**
- * Returns text to be displayed to the user which reflects their login status
- *
- * @global object
- * @global object
- * @global object
- * @global object
- * @uses CONTEXT_COURSE
- * @param course $course {@link $COURSE} object containing course information
- * @param user $user {@link $USER} object containing user information
- * @return string HTML
- */
-function user_login_string($course=NULL, $user=NULL) {
-    global $USER, $CFG, $SITE, $DB;
-
-    if (during_initial_install()) {
-        return '';
-    }
-
-    if (empty($user) and !empty($USER->id)) {
-        $user = $USER;
-    }
-
-    if (empty($course)) {
-        $course = $SITE;
-    }
-
-    if (session_is_loggedinas()) {
-        $realuser = session_get_realuser();
-        $fullname = fullname($realuser, true);
-        $realuserinfo = " [<a $CFG->frametarget
-        href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;return=1&amp;sesskey=".sesskey()."\">$fullname</a>] ";
-    } else {
-        $realuserinfo = '';
-    }
-
-    $loginurl = get_login_url();
-
-    if (empty($course->id)) {
-        // $course->id is not defined during installation
-        return '';
-    } else if (!empty($user->id)) {
-        $context = get_context_instance(CONTEXT_COURSE, $course->id);
-
-        $fullname = fullname($user, true);
-        $username = "<a $CFG->frametarget href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=$course->id\">$fullname</a>";
-        if (is_mnet_remote_user($user) and $idprovider = $DB->get_record('mnet_host', array('id'=>$user->mnethostid))) {
-            $username .= " from <a $CFG->frametarget href=\"{$idprovider->wwwroot}\">{$idprovider->name}</a>";
-        }
-        if (isset($user->username) && $user->username == 'guest') {
-            $loggedinas = $realuserinfo.get_string('loggedinasguest').
-                      " (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
-        } else if (!empty($user->access['rsw'][$context->path])) {
-            $rolename = '';
-            if ($role = $DB->get_record('role', array('id'=>$user->access['rsw'][$context->path]))) {
-                $rolename = ': '.format_string($role->name);
-            }
-            $loggedinas = get_string('loggedinas', 'moodle', $username).$rolename.
-                      " (<a $CFG->frametarget
-                      href=\"$CFG->wwwroot/course/view.php?id=$course->id&amp;switchrole=0&amp;sesskey=".sesskey()."\">".get_string('switchrolereturn').'</a>)';
-        } else {
-            $loggedinas = $realuserinfo.get_string('loggedinas', 'moodle', $username).' '.
-                      " (<a $CFG->frametarget href=\"$CFG->wwwroot/login/logout.php?sesskey=".sesskey()."\">".get_string('logout').'</a>)';
-        }
-    } else {
-        $loggedinas = get_string('loggedinnot', 'moodle').
-                      " (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
-    }
-
-    $loggedinas = '<div class="logininfo">'.$loggedinas.'</div>';
-
-    if (isset($SESSION->justloggedin)) {
-        unset($SESSION->justloggedin);
-        if (!empty($CFG->displayloginfailures)) {
-            if (!empty($USER->username) and $USER->username != 'guest') {
-                if ($count = count_login_failures($CFG->displayloginfailures, $USER->username, $USER->lastlogin)) {
-                    $loggedinas .= '&nbsp;<div class="loginfailures">';
-                    if (empty($count->accounts)) {
-                        $loggedinas .= get_string('failedloginattempts', '', $count);
-                    } else {
-                        $loggedinas .= get_string('failedloginattemptsall', '', $count);
-                    }
-                    if (has_capability('coursereport/log:view', get_context_instance(CONTEXT_SYSTEM))) {
-                        $loggedinas .= ' (<a href="'.$CFG->wwwroot.'/course/report/log/index.php'.
-                                             '?chooselog=1&amp;id=1&amp;modid=site_errors">'.get_string('logs').'</a>)';
-                    }
-                    $loggedinas .= '</div>';
-                }
-            }
-        }
-    }
-
-    return $loggedinas;
-}
-
 /**
  * Return the right arrow with text ('next'), and optionally embedded in a link.
  *
index c6ba22dacd556dda721828b4a5aa312a26b48d48..b223ab45e978e8f09e8f058d1a78ad2ed88fe63f 100644 (file)
@@ -61,20 +61,10 @@ httpsrequired();
 
 $PAGE->set_url("$CFG->httpswwwroot/login/index.php");
 
+
 /// Define variables used in page
 $site = get_site();
 
-if (empty($CFG->langmenu)) {
-    $langmenu = "";
-} else {
-    $currlang = current_language();
-    $langs    = get_list_of_languages();
-    $select = html_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
-    $select->nothinglabel = false;
-    $select->set_label(get_accesshide(get_string('language')));
-    $langmenu = $OUTPUT->select($select);
-}
-
 $loginsite = get_string("loginsite");
 $PAGE->navbar->add($loginsite);
 
@@ -221,7 +211,6 @@ if (empty($CFG->usesid) and $testcookies and (get_moodle_cookie() == '')) {    /
             $days2expire = $userauth->password_expire($USER->username);
             $PAGE->set_title("$site->fullname: $loginsite");
             $PAGE->set_heading("$site->fullname");
-            $PAGE->set_headingmenu("<div class=\"langmenu\">$langmenu</div>");
             if (intval($days2expire) > 0 && intval($days2expire) < intval($userauth->config->expiration_warning)) {
                 echo $OUTPUT->header();
                 echo $OUTPUT->confirm(get_string('auth_passwordwillexpire', 'auth', $days2expire), $passwordchangeurl, $urltogo);
@@ -325,7 +314,6 @@ if (!empty($CFG->registerauth) or is_enabled_auth('none') or !empty($CFG->auth_i
 
 $PAGE->set_title("$site->fullname: $loginsite");
 $PAGE->set_heading("$site->fullname");
-$PAGE->set_headingmenu("<div class=\"langmenu\">$langmenu</div>");
 $PAGE->set_focuscontrol($focus);
 
 echo $OUTPUT->header();
index cbcac7c6152dc3c3b3e02ba5c971e3f589988877..f8102be4df19e1bcc80840b46ac035086755ac38 100644 (file)
@@ -69,23 +69,12 @@ if ($mform_signup->is_cancelled()) {
 $newaccount = get_string('newaccount');
 $login      = get_string('login');
 
-if (empty($CFG->langmenu)) {
-    $langmenu = '';
-} else {
-    $currlang = current_language();
-    $langs    = get_list_of_languages();
-    $select = html_select::make_popup_form("$CFG->wwwroot/login/signup.php", 'lang', $langs, 'chooselang', $currlang);
-    $select->nothinglabel = false;
-    $langmenu = $OUTPUT->select($select);
-}
-
 $PAGE->navbar->add($login);
 $PAGE->navbar->add($newaccount);
 $PAGE->set_url(new moodle_url($CFG->wwwroot.'/login/signup.php'));
 $PAGE->set_title($newaccount);
 $PAGE->set_heading($newaccount);
 $PAGE->set_focuscontrol($mform_signup->focus());
-$PAGE->set_headingmenu("<div class=\"langmenu\">$langmenu</div>");
 
 echo $OUTPUT->header();
 $mform_signup->display();
index 33d616d3e7ac6a0a0783e3c8333751d271083213..85524484534c76fb65de150ad4d681d814fadf38 100644 (file)
     $heading = $course->fullname;
 
     $button = '<div style="font-size:0.75em;">'.$button.'</div>';
-    $loggedinas = '<span class="logininfo">'.user_login_string($course, $USER).'</span>';
 
     $PAGE->set_title($title);
     $PAGE->set_heading($heading);
     $PAGE->set_button($button);
-    $PAGE->set_headingmenu($loggedinas);
 
     $time = time();
     $hppassword = optional_param('hppassword', '', PARAM_RAW);
index c1a7f27330ae487d4a58e404f7abdeacab6c430f..46dfad0854d4df0999060c413da97d070611be89 100644 (file)
 
     $header = $SITE->shortname . ': ' . $strmymoodle;
     $PAGE->navbar->add($strmymoodle);
-    $loggedinas = user_login_string();
-
-    if (empty($CFG->langmenu)) {
-        $langmenu = '';
-    } else {
-        $currlang = current_language();
-        $langs = get_list_of_languages();
-        $select = html_select::make_popup_form($CFG->wwwroot .'/my/index.php', 'lang', $langs, 'chooselang', $currlang);
-        $select->nothinglabel = false;
-        $select->set_label(get_accesshide(get_string('language')));
-        $langmenu = $OUTPUT->select($select);
-    }
 
     $PAGE->set_title($strmymoodle);
     $PAGE->set_heading($header);
     $PAGE->set_button($button);
-    $PAGE->set_headingmenu($loggedinas . $langmenu);
     echo $OUTPUT->header();
 
 /// The main overview in the middle of the page
index 44b85a7a80d9a6082bf5ee123c31e85e4ecc3220..8733dc11c3ef02294901215a5ec3fbc7d5618bf6 100644 (file)
@@ -66,6 +66,7 @@ $THEME->layouts = array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-post',
+        'options' => array('langmenu'=>true),
     ),
     'coursecategory' => array(
         'theme' => 'base',
@@ -100,6 +101,7 @@ $THEME->layouts = array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-post',
+        'options' => array('langmenu'=>true),
     ),
     // My public page
     'mypublic' => array(
@@ -112,6 +114,7 @@ $THEME->layouts = array(
         'theme' => 'base',
         'file' => 'general.php',
         'regions' => array(),
+        'options' => array('langmenu'=>true),
     ),
 
     // Pages that appear in pop-up windows - no navigation, no blocks, no header.
index 80c3e20d27e43360e5ff4d59c7fc38fedd218990..fb827d9ada79c0a9fd4b4bc74b7fe789ad867891 100644 (file)
@@ -24,11 +24,9 @@ echo $OUTPUT->doctype() ?>
     <div id="header-home" class="clearfix">
         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
         <div class="headermenu"><?php
-        if ($PAGE->headingmenu) {
-            echo $PAGE->headingmenu;
-        } else {
             echo $OUTPUT->login_info();
-        }
+            echo $OUTPUT->lang_menu();
+            echo $PAGE->headingmenu;
         ?></div>
     </div>
 <!-- END OF HEADER -->
index 3d5db37b53ecda5d2172bd6f75f1e80324aac3ba..a2f3f6935fbdf8ea06e8aeceb4909695e871ae10 100644 (file)
@@ -23,7 +23,13 @@ echo $OUTPUT->doctype() ?>
 <?php if ($PAGE->heading) { ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
-        <div class="headermenu"><?php echo $PAGE->headingmenu ?></div>
+        <div class="headermenu"><?php
+            echo $OUTPUT->login_info();
+            if (!empty($PAGE->layout_options['langmenu'])) {
+                echo $OUTPUT->lang_menu();
+            }
+            echo $PAGE->headingmenu
+         ?></div>
     </div>
 <?php } ?>
 
index 5accb06f2fc1fc38d567b7d5f9a5c11f1ee1a254..7bdd78c509cb52db95cbd86dd4a5ac1ff46e95d4 100644 (file)
@@ -97,6 +97,7 @@ $THEME->layouts = array(
         'file' => 'normal.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-post',
+        'options' => array('langmenu'=>true),
     ),
     'coursecategory' => array(
         'theme' => 'base',
@@ -131,6 +132,7 @@ $THEME->layouts = array(
         'file' => 'normal.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-post',
+        'options' => array('langmenu'=>true),
     ),
     // My public page
     'mypublic' => array(
@@ -143,6 +145,7 @@ $THEME->layouts = array(
         'theme' => 'standard',
         'file' => 'normal.php',
         'regions' => array(),
+        'options' => array('langmenu'=>true),
     ),
     
     // Pages that appear in pop-up windows - no navigation, no blocks, no header.
index cc75449ca0fab472098bf04806eba9cb7530d11c..adbd333d90b0da35e1904270d7e211c4abaa3d1c 100644 (file)
 <?php if ($PAGE->heading) { ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
-        <div class="headermenu"><?php echo $PAGE->headingmenu ?></div>
+        <div class="headermenu"><?php
+            echo $OUTPUT->login_info();
+            if (!empty($PAGE->layout_options['langmenu'])) {
+                echo $OUTPUT->lang_menu();
+            }
+            echo $PAGE->headingmenu
+        ?></div>
     </div>
 <?php } ?>
 
index bba952486fc0c6a56397323c0585820a73ffdc8c..92e8dc7d4055cf69234642d4ef9db2dae08a3569 100644 (file)
     <div id="header-home" class="clearfix">
         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
         <div class="headermenu"><?php
-        echo $OUTPUT->login_info();
-        if ($PAGE->headingmenu) {
+            echo $OUTPUT->login_info();
+            echo $OUTPUT->lang_menu();
             echo $PAGE->headingmenu;
-        }
         ?></div>
     </div>
     <hr />
index 323b2cb3cb480ea6099865fb764baae31ae855fb..fd029652895399e62977ea43ced9a0eec8f49735 100644 (file)
 <?php if ($PAGE->heading) { ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
-        <div class="headermenu"><?php echo $PAGE->headingmenu ?></div>
+        <div class="headermenu"><?php
+            echo $OUTPUT->login_info();
+            if (!empty($PAGE->layout_options['langmenu'])) {
+                echo $OUTPUT->lang_menu();
+            }
+            echo $PAGE->headingmenu
+        ?></div>
     </div>
 <?php } ?>