]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10870 All files updated to new build_navigation() method.
authornicolasconnault <nicolasconnault>
Thu, 16 Aug 2007 15:01:25 +0000 (15:01 +0000)
committernicolasconnault <nicolasconnault>
Thu, 16 Aug 2007 15:01:25 +0000 (15:01 +0000)
12 files changed:
admin/lang.php
admin/pagelib.php
admin/roles/tabs.php
blocks/rss_client/block_rss_client_action.php
blog/preferences.php
calendar/preferences.php
course/edit.php
files/index.php
lib/moodlelib.php
mod/data/edit.php
mod/lams/mod.html
mod/resource/index.php

index ebac3d372ebc9d20e0682cff8c965b96c411013f..2cdb81f641e26cee1c392468292febe740aa1800 100644 (file)
@@ -80,8 +80,6 @@
             $title = $strlanguage;
             break;
     }
-    $navigation = "<a href=\"lang.php\">$strlanguage</a> -> $title";
-
     $crumbs[] = array('name' => $strlanguage, 'link' => "$CFG->wwwroot/admin/lang.php");
     $navigation = build_navigation($crumbs);
 
index 12095b6660fc91c1529475ecc8d4331bd4d96fc0..8ff148e19707def21b830944113591fe2168dbc1 100644 (file)
@@ -15,7 +15,7 @@ define('BLOCK_L_MIN_WIDTH', $lmin);
 define('BLOCK_L_MAX_WIDTH', $lmax);
 define('BLOCK_R_MIN_WIDTH', $rmin);
 define('BLOCK_R_MAX_WIDTH', $rmax);
-  
+
 page_map_class(PAGE_ADMIN, 'page_admin');
 
 class page_admin extends page_base {
@@ -27,7 +27,7 @@ class page_admin extends page_base {
     // hack alert!
     // this function works around the inability to store the section name
     // in default block, maybe we should "improve" the blocks a bit?
-    function init_extra($section) { 
+    function init_extra($section) {
         global $CFG;
 
         if($this->full_init_done) {
@@ -40,7 +40,7 @@ class page_admin extends page_base {
         $this->section = $section;
 
         $this->visiblepathtosection = array();
-        
+
         // this part is (potentially) processor-intensive... there's gotta be a better way
         // of handling this
         if ($this->pathtosection = $adminroot->path($this->section)) {
@@ -54,24 +54,24 @@ class page_admin extends page_base {
         // all done
         $this->full_init_done = true;
     }
-    
+
     function blocks_get_default() {
         return 'admin_tree,admin_bookmarks';
     }
 
     // seems reasonable that the only people that can edit blocks on the admin pages
     // are the admins... but maybe we want a role for this?
-    function user_allowed_editing() { 
+    function user_allowed_editing() {
         return has_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM, SITEID));
     }
 
     // has to be fixed. i know there's a "proper" way to do this
-    function user_is_editing() { 
+    function user_is_editing() {
         global $USER;
         return $USER->adminediting;
     }
 
-    function url_get_path() { 
+    function url_get_path() {
         global $CFG;
 
         $adminroot = admin_get_root();
@@ -88,11 +88,11 @@ class page_admin extends page_base {
         return array('section' => (isset($this->section) ? $this->section : ''));
     }
 
-    function blocks_get_positions() { 
+    function blocks_get_positions() {
         return array(BLOCK_POS_LEFT, BLOCK_POS_RIGHT);
     }
 
-    function blocks_default_position() { 
+    function blocks_default_position() {
         return BLOCK_POS_LEFT;
     }
 
@@ -116,7 +116,7 @@ class page_admin extends page_base {
         $this->init_full($section); // we're trusting that init_full() has already been called by now; it should have.
                                     // if not, print_header() has to be called with a $section parameter
 
-        // The search page currently doesn't handle block editing 
+        // The search page currently doesn't handle block editing
         if ($this->section != 'search' and $this->user_allowed_editing()) {
             $buttons = '<div><form '.$CFG->frametarget.' method="get" action="' . $this->url_get_path() . '">'.
                 '<div><input type="hidden" name="adminedit" value="'.($this->user_is_editing()?'off':'on').'" />'.
@@ -126,8 +126,13 @@ class page_admin extends page_base {
             $buttons = '&nbsp;';
         }
 
-        print_header("$SITE->shortname: " . implode(": ",$this->visiblepathtosection), $SITE->fullname, 
-                     implode(" -> ",$this->visiblepathtosection),'', '', true, $buttons, '');
+        $navlinks = array();
+        foreach ($this->visiblepathtosection as $element) {
+            $navlinks[] = array('name' => $element, 'link' => null, 'type' => 'misc');
+        }
+        $navigation = build_navigation($navlinks);
+
+        print_header("$SITE->shortname: " . implode(": ",$this->visiblepathtosection), $SITE->fullname, $navigation,'', '', true, $buttons, '');
     }
 
     function get_type() {
index f6d02e08c224e6c8b54aa014a09ff3762a607d5f..cc571040ad21bcd0ac0d89305259178e73dbd757 100755 (executable)
@@ -7,6 +7,7 @@ if (!defined('MOODLE_INTERNAL')) {
     die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
 }
 
+$navlinks = array();
 if ($currenttab != 'update') {
     switch ($context->contextlevel) {
 
@@ -27,8 +28,16 @@ if ($currenttab != 'update') {
             $strcategories = get_string("categories");
             $strcategory = get_string("category");
             $strcourses = get_string("courses");
-            print_header("$SITE->shortname: $category->name", "$SITE->fullname: $strcourses",
-                    "<a href=\"$CFG->wwwroot/course/index.php\">$strcategories</a> -> <a href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a> -> $straction", "", "", true);
+
+            $navlinks[] = array('name' => $strcategories,
+                                'link' => "$CFG->wwwroot/course/index.php",
+                                'type' => 'misc');
+            $navlinks[] = array('name' => $category->name,
+                                'link' => "$CFG->wwwroot/course/category.php?id=$category->id",
+                                'type' => 'misc');
+            $navigation = build_navigation($navlinks);
+
+            print_header("$SITE->shortname: $category->name", "$SITE->fullname: $strcourses", $navigation, "", "", true);
             break;
 
         case CONTEXT_COURSE:
@@ -38,9 +47,11 @@ if ($currenttab != 'update') {
                 $course = get_record('course', 'id', $context->instanceid);
 
                 require_login($course);
-
-                print_header($streditcoursesettings, $course->fullname,
-                        "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $straction");
+                $navlinks[] = array('name' => $course->shortname,
+                                    'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                                    'type' => 'misc');
+                $navigation = build_navigation($navlinks);
+                print_header($streditcoursesettings, $course->fullname, $navigation);
             }
             break;
 
@@ -64,9 +75,8 @@ if ($currenttab != 'update') {
 
             require_login($course);
 
-            $strnav = "<a href=\"$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id\">$instance->name</a> ->";
-            $fullmodulename = get_string("modulename", $module->name);
-            $streditinga = get_string("editinga", "moodle", $fullmodulename);
+            $fullmodulename      = get_string("modulename", $module->name);
+            $streditinga         = get_string("editinga", "moodle", $fullmodulename);
             $strmodulenameplural = get_string("modulenameplural", $module->name);
 
             if ($module->name == "label") {
@@ -75,9 +85,21 @@ if ($currenttab != 'update') {
                 $focuscursor = "form.name";
             }
 
-            print_header_simple($streditinga, '',
-                    "<a href=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</a> ->
-                    $strnav <a href=\"$CFG->wwwroot/course/mod.php?update=$cm->id&amp;sesskey=".sesskey()."\">$streditinga</a> -> $straction", $focuscursor, "", false);
+            $navlinks[] = array('name' => $strmodulenameplural,
+                                'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id",
+                                'type' => 'misc');
+
+            $navlinks[] = array('name' => $instance->name,
+                                'link' => "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
+                                'type' => 'misc');
+
+            $navlinks[] = array('name' => $streditinga,
+                                'link' => "$CFG->wwwroot/course/mod.php?update=$cm->id&amp;sesskey=".sesskey(),
+                                'type' => 'misc');
+
+            $navigation = build_navigation($navlinks);
+
+            print_header_simple($streditinga, '', $navigation, $focuscursor, "", false);
 
             break;
 
@@ -85,7 +107,10 @@ if ($currenttab != 'update') {
             if ($blockinstance = get_record('block_instance', 'id', $context->instanceid)) {
                 if ($block = get_record('block', 'id', $blockinstance->blockid)) {
                     $blockname = print_context_name($context);
-                    $navigation = $blockname. ' -> '.$straction;
+
+                    // Prepare the last part of the breadcrumbs first
+                    $navlinks[98] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
+                    $navlinks[99] = array('name' => $straction, 'link' => null, 'type' => 'misc');
 
                     switch ($blockinstance->pagetype) {
                         case 'course-view':
@@ -94,16 +119,21 @@ if ($currenttab != 'update') {
                                 require_login($course);
 
                                 if ($course->id != SITEID) {
-                                    $navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
+                                    $navlinks[0] = array('name' => $course->shortname,
+                                                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                                                        'type' => 'misc');
                                 }
+                                $navigation = build_navigation($navlinks);
                                 print_header("$straction: $blockname", $course->fullname, $navigation);
                             }
                             break;
 
                         case 'blog-view':
                             $strblogs = get_string('blogs','blog');
-                            $navigation = '<a href="'.$CFG->wwwroot.'/blog/index.php">'.
-                                $strblogs.'</a> -> '.$navigation;
+                            $navlinks[0] = array('name' => $strblogs,
+                                                 'link' => $CFG->wwwroot.'/blog/index.php',
+                                                 'type' => 'misc');
+                            $navigation = build_navigation($navlinks);
                             print_header("$straction: $strblogs", $SITE->fullname, $navigation);
                             break;
 
index 9c4d9ed54b73324c388d8ef93fd2e67bc74f49c7..53eabce589a0127d86b63f1beb81c1af7355c73e 100644 (file)
@@ -57,7 +57,7 @@ if (!defined('MAGPIE_OUTPUT_ENCODING')) {
 
 
 if (!empty($id)) {
-    // we get the complete $course object here because print_header assumes this is 
+    // we get the complete $course object here because print_header assumes this is
     // a complete object (needed for proper course theme settings)
     if ($course = get_record('course', 'id', $id)) {
         $context = get_context_instance(CONTEXT_COURSE, $id);
@@ -68,13 +68,12 @@ if (!empty($id)) {
 
 
 $straddedit = get_string('feedsaddedit', 'block_rss_client');
-
-if (!empty($course)) {
-    $navigation = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$id.'">'.$course->shortname.'</a> -> '.$straddedit;
-} else {
-    $navigation = $straddedit;
+$link = $CFG->wwwroot.'/course/view.php?id='.$id;
+if (empty($course)) {
+    $link = '';
 }
-
+// $navlinks = array(array('name' => $course->shortname, 'link' => $link, 'type' => 'misc'));
+$navigation = build_navigation($navlinks);
 print_header($straddedit, $straddedit, $navigation);
 
 
index c53acf4a26536b95e274cdfcc7cfffc6287a92cf..3f5fdce78d2655c34de67a79dac0f991af0c6391 100755 (executable)
@@ -42,8 +42,9 @@
 
     $strpreferences = get_string('preferences');
     $strblogs       = get_string('blogs', 'blog');
-
-    $navigation = "<a href='".$CFG->wwwroot."/blog/'>$strblogs</a> -> $strpreferences";
+    $navlinks = array(array('name' => $strblogs, 'link' => "$CFG->wwwroot/blog/", 'type' => 'misc'));
+    $navlinks[] = array('name' => $strpreferences, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
     print_header("$site->shortname: $strblogs : $strpreferences", $strblogs, $navigation);
     print_heading($strpreferences);
index 048fb99974360484415c5ee1239d9d72468e2010..806c618af2d18c8796e85f497b2e7a5b065a1fb2 100644 (file)
@@ -15,7 +15,7 @@
     }
     // Initialize the session variables
     calendar_session_vars();
-    
+
 /// If data submitted, then process and store.
 
     if ($form = data_submitted()) {
     $strcalendar = get_string('calendar', 'calendar');
     $strpreferences = get_string('preferences', 'calendar');
 
+    $navlinks = array();
     if ($course->id != SITEID) {
-        $navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
-                       <a href=\"view.php\">$strcalendar</a> -> $strpreferences";
-    } else {
-        $navigation = "<a href=\"view.php\">$strcalendar</a> -> $strpreferences";
+        $navlinks[] = array('name' => $course->shortname,
+                            'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                            'type' => 'misc');
     }
-
+    $navlinks[] = array('name' => $strpreferences, 'link' => 'view.php', 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
     print_header("$site->shortname: $strcalendar: $strpreferences", $strcalendar, $navigation,
                  '', '', true, '', user_login_string($site));
index 1e1c69e220dd5f03ba98a1f2c20e1ea8cf1c43e4..c7f3c052ebf4e5815353f8e923e9d248d3dd9fbc 100644 (file)
                 } // it'll be greyed out but we want these by default anyway.
             }
             $course->allowedmods = $allowedmods;
-    
+
             if ($course->enrolstartdate){
                 $course->enrolstartdisabled = 0;
             }
-    
+
             if ($course->enrolenddate) {
                 $course->enrolenddisabled = 0;
             }
@@ -98,7 +98,7 @@
             // assign default role to creator if not already having permission to manage course assignments
             if (!has_capability('moodle/course:view', $context) or !has_capability('moodle/role:assign', $context)) {
                 role_assign($CFG->creatornewroleid, $USER->id, 0, $context->id);
-            }        
+            }
 
             if ($data->metacourse and has_capability('moodle/course:managemetacourse', $context)) {
                 // Redirect users with metacourse capability to student import
                 // Redirect to roles assignment
                 redirect($CFG->wwwroot."/$CFG->admin/roles/assign.php?contextid=$context->id");
             }
-            
-        } else {            
+
+        } else {
             if (!update_course($data)) {
                 print_error('coursenotupdated');
             }
     $straddnewcourse = get_string("addnewcourse");
     $stradministration = get_string("administration");
     $strcategories = get_string("categories");
+    $navlinks = array();
 
     if (!empty($course)) {
-        print_header($streditcoursesettings, $course->fullname,
-                     "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-                      -> $streditcoursesettings", $editform->focus());
+        $navlinks[] = array('name' => $streditcoursesettings,
+                            'link' => null,
+                            'type' => 'misc');
+        $title = $streditcoursesettings;
+        $fullname = $course->fullname;
     } else {
-        print_header("$site->shortname: $straddnewcourse", $site->fullname,
-                     "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> ".
-                     "<a href=\"index.php\">$strcategories</a> -> $straddnewcourse", $editform->focus());
+        $navlinks[] = array('name' => $stradministration,
+                            'link' => "$CFG->wwwroot/$CFG->admin/index.php",
+                            'type' => 'misc');
+        $navlinks[] = array('name' => $strcategories,
+                            'link' => 'index.php',
+                            'type' => 'misc');
+        $navlinks[] = array('name' => $straddnewcourse,
+                            'link' => null,
+                            'type' => 'misc');
+        $title = "$site->shortname: $straddnewcourse";
+        $fullname = $site->fullname;
     }
 
+    $navigation = build_navigation($navlinks);
+    print_header($title, $fullname, $navigation, $editform->focus());
     print_heading($streditcoursesettings);
 
     $editform->display();
index 8f91ffc0ea14986727ec389d0d2a07cfa477502c..156a0db70853baeed0ed92754e3245e198a3c53c 100644 (file)
@@ -49,6 +49,9 @@
     function html_header($course, $wdir, $formfield=""){
         global $CFG, $ME, $choose;
 
+        $navlinks = array();
+        // $navlinks[] = array('name' => $course->shortname, 'link' => "../course/view.php?id=$course->id", 'type' => 'misc');
+
         if ($course->id == SITEID) {
             $strfiles = get_string("sitefiles");
         } else {
         }
 
         if ($wdir == "/") {
-            $fullnav = "$strfiles";
+            $navlinks[] = array('name' => $strfiles, 'link' => null, 'type' => 'misc');
         } else {
             $dirs = explode("/", $wdir);
             $numdirs = count($dirs);
             $link = "";
-            $navigation = "";
+            $navlinks[] = array('name' => $strfiles,
+                                'link' => $ME."?id=$course->id&amp;wdir=/&amp;choose=$choose",
+                                'type' => 'misc');
+
             for ($i=1; $i<$numdirs-1; $i++) {
-               $navigation .= " -> ";
-               $link .= "/".urlencode($dirs[$i]);
-               $navigation .= "<a href=\"".$ME."?id=$course->id&amp;wdir=$link&amp;choose=$choose\">".$dirs[$i]."</a>";
+                $link .= "/".urlencode($dirs[$i]);
+                $navlinks[] = array('name' => $dirs[$i],
+                                    'link' => $ME."?id=$course->id&amp;wdir=$link&amp;choose=$choose",
+                                    'type' => 'misc');
             }
-            $fullnav = "<a href=\"".$ME."?id=$course->id&amp;wdir=/&amp;choose=$choose\">$strfiles</a> $navigation -> ".$dirs[$numdirs-1];
+            $navlinks[] = array('name' => $dirs[$numdirs-1], 'link' => null, 'type' => 'misc');
         }
 
 
                     admin_externalpage_print_header();
 
                     print_heading(get_string("publicsitefileswarning"), "center", 2);
-                    
+
                 }
 
             } else {
-                print_header("$course->shortname: $strfiles", $course->fullname,
-                             "<a href=\"../course/view.php?id=$course->id\">$course->shortname".
-                             "</a> -> $fullnav", $formfield);
+                $navigation = build_navigation($navlinks);
+                print_header("$course->shortname: $strfiles", $course->fullname, $navigation,  $formfield);
             }
         }
 
 
                 echo "<p>$struploadafile ($strmaxsize) --> <b>$wdir</b></p>";
                 echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"index.php\">";
-                echo "<div>";             
+                echo "<div>";
                 echo "<table><tr><td colspan=\"2\">";
                 echo ' <input type="hidden" name="choose" value="'.$choose.'" />';
                 echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />";
                 echo "</div>";
                 echo "</form>";
                 echo "<form action=\"index.php\" method=\"get\">";
-                echo "<div>";             
+                echo "<div>";
                 echo ' <input type="hidden" name="choose" value="'.$choose.'" />';
                 echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />";
                 echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
index 34cee17a19d5431d6cb82cd289e9fae0465c72de..e349806c9d0260eb914c1092f20c7116466cb938 100644 (file)
@@ -7090,14 +7090,18 @@ function build_navigation($extranavlinks) {
 
     //Site name
     if ($site = get_site()) {
-        $navlinks[] = array('name' => format_string($site->shortname), 'link' => "$CFG->wwwroot/", 'type' => 'home');
+        $navlinks[] = array('name' => format_string($site->shortname),
+                            'link' => "$CFG->wwwroot/",
+                            'type' => 'home');
     }
 
 
     if ($COURSE) {
         if ($COURSE->id != SITEID) {
             //Course
-            $navlinks[] = array('name' => format_string($COURSE->shortname), 'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",'type' => 'course');
+            $navlinks[] = array('name' => format_string($COURSE->shortname),
+                                'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",
+                                'type' => 'course');
         }
     }
 
@@ -7108,26 +7112,35 @@ function build_navigation($extranavlinks) {
     //Accessibility: heading hidden from visual browsers by default.
     $navigation = '<h2 class="accesshide">'.get_string('youarehere','access')."</h2> <ul>\n";
     $countlinks = count($navlinks);
-
-    for($i=0;$i<$countlinks;$i++) {
-
+    $i = 0;
+    foreach ($navlinks as $navlink) {
+        if ($i >= $countlinks || !is_array($navlink)) {
+            continue;
+        }
         // Check the link type to see if this link should appear in the trail
-        if ($navlinks[$i]['type'] == 'activity' && $i+1 < $countlinks  && ($CFG->hideactivitytypenavlink == 2 || ($CFG->hideactivitytypenavlink == 1 && !has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id))))) {
+        $cap = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id));
+        $hidetype_is2 = $CFG->hideactivitytypenavlink == 2;
+        $hidetype_is1 = $CFG->hideactivitytypenavlink == 1;
+
+        if ($navlink['type'] == 'activity' &&
+            $i+1 < $countlinks  &&
+            ($hidetype_is2 || ($hidetype_is1 && !$cap))) {
             continue;
         }
         $navigation .= '<li class="first">';
         if ($i > 0) {
             $navigation .= get_separator();
         }
-        if ($navlinks[$i]['link'] && $i+1 < $countlinks) {
-            $navigation .= "<a onclick=\"this.target='$CFG->framename'\" href=\"{$navlinks[$i]['link']}\">";
+        if ($navlink['link'] && $i+1 < $countlinks) {
+            $navigation .= "<a onclick=\"this.target='$CFG->framename'\" href=\"{$navlink['link']}\">";
         }
-        $navigation .= "{$navlinks[$i]['name']}";
-        if ($navlinks[$i]['link'] && $i+1 < $countlinks) {
+        $navigation .= "{$navlink['name']}";
+        if ($navlink['link'] && $i+1 < $countlinks) {
             $navigation .= "</a>";
         }
 
         $navigation .= "</li>";
+        $i++;
     }
 
     $navigation .= "</ul>";
@@ -7150,8 +7163,7 @@ function is_newnav($navigation) {
  * @param object $object The object to check
  * @return boolean
  */
-function in_object_vars($var, $object)
-{
+function in_object_vars($var, $object) {
     $class_vars = get_class_vars(get_class($object));
     $class_vars = array_keys($class_vars);
     return in_array($var, $class_vars);
index 3b062e12936401f8ace92f13a2138b9142147728..e823780a0950293c7a5f30018d023c0e78ae3fa5 100755 (executable)
 
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
-/// If it's hidden then it's don't show anything.  :)
+/// If it's hidden then it doesn't show anything.  :)
     if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
         $strdatabases = get_string("modulenameplural", "data");
-        $navigation = "<a href=\"index.php?id=$course->id\">$strdatabases</a> ->";
-        
+
         $navlinks = array();
         $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity');
         $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
         $navigation = build_navigation($navlinks);
-        
+
         print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm));
         notice(get_string("activityiscurrentlyhidden"));
     }
             if (!has_capability('mod/data:approve', $context)) {
                 $record->approved = 0;
             }
-            
+
             $record->groupid = $currentgroup;
             $record->timemodified = time();
             update_record('data_records',$record);
index 8540d10ddd36805b2f69f380dae378328d05b937..d34bae9ccdcdf355f1a39ac8922de8314fd09b09 100644 (file)
@@ -37,8 +37,8 @@ if (!isset($form->create_sequence_url)) {
 <center>
 <span id="message"><p>Please wait .......</p></span>
 <table cellpadding="5">
-<tr valign=top>
-<td align=right><b><?php print_string("workspace", "lams") ?>:</b></td>
+<tr valign="top">
+<td align="right"><b><?php print_string("workspace", "lams") ?>:</b></td>
 <td>
 <select id="workspace" name="workspace"></select>
 </td>
@@ -55,7 +55,8 @@ if (!isset($form->create_sequence_url)) {
 <input type="text" id="name" name="name" size="30" />
 </td>
 </tr>
-<td align=right><p><b><?php print_string("introduction", "lams") ?>:</b></p>
+<tr>
+<td align="right"><p><b><?php print_string("introduction", "lams") ?>:</b></p>
 <br />
 <font size="1">
 <?php
@@ -87,8 +88,10 @@ print_textarea($usehtmleditor, 20, 50, 680, 400, "introduction", $form->introduc
 <input type="hidden" name="learning_session_id"/>
 <input type="hidden" name="create_sequence_url" id="create_sequence_url"/>
 <input type="submit" id="save" name="save" value="<?php print_string("useSequence","lams") ?>" onClick="return validate();">
-<input type="button" id="edit" name"edit" value="<?php print_string("editSequence","lams") ?>" onClick="openAuthor(<?php echo "'".$form->create_sequence_url."&".$LAMSCONSTANTS->param_ldid."=".$form->sequence."'";?>);">
-<input type="button" id="create" name="create" value="<?php print_string("createSequence","lams") ?>" onClick="openAuthor(<?php echo "'".$form->create_sequence_url."'";?>);">
+<input type="button" id="edit" name="edit" value="<?php print_string("editSequence","lams") ?>" onClick="openAuthor(<?php
+    echo "'".$form->create_sequence_url."&".$LAMSCONSTANTS->param_ldid."=".$form->sequence."'";?>);">
+<input type="button" id="create" name="create" value="<?php print_string("createSequence","lams") ?>" onClick="openAuthor(<?php
+    echo "'".$form->create_sequence_url."'";?>);">
 <input type="button" id="refresh" name="refresh" value="<?php print_string("refreshSequenceList","lams")?>" onclick="refreshLists();">
 <input type="submit" id="cancel" name=cancel value="<?php  print_string("cancel") ?>">
 
index 56cb2e8a679371008ce182e7edfcf873e7127d9d..cd7d7e1db5c0e421b5b3afde6dd1563faee8aa17 100644 (file)
 
     if ($course->id != SITEID) {
         require_login($course->id);
-        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
-    } else {
-        $navigation = '';
     }
-
     add_to_log($course->id, "resource", "view all", "index.php?id=$course->id", "");
 
     $strresource = get_string("modulename", "resource");
     $strname = get_string("name");
     $strsummary = get_string("summary");
     $strlastmodified = get_string("lastmodified");
-    
+
     $navlinks = array();
     $navlinks[] = array('name' => $strresources, 'link' => '', 'type' => 'activityinstance');
     $navigation = build_navigation($navlinks);
 
-    print_header("$course->shortname: $strresources", $course->fullname, $navigation, 
+    print_header("$course->shortname: $strresources", $course->fullname, $navigation,
                  "", "", true, "", navmenu($course));
 
     if (! $resources = get_all_instances_in_course("resource", $course)) {
             $extra = "";
         }
         if (!$resource->visible) {      // Show dimmed if the mod is hidden
-            $table->data[] = array ($printsection, 
+            $table->data[] = array ($printsection,
                     "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">".format_string($resource->name,true)."</a>",
                     format_text($resource->summary, FORMAT_MOODLE, $options) );
 
         } else {                        //Show normal if the mod is visible
-            $table->data[] = array ($printsection, 
+            $table->data[] = array ($printsection,
                     "<a $extra href=\"view.php?id=$resource->coursemodule\">".format_string($resource->name,true)."</a>",
                     format_text($resource->summary, FORMAT_MOODLE, $options) );
         }
@@ -89,6 +85,6 @@
     print_table($table);
 
     print_footer($course);
+
 ?>