http://www.atutor.ca/atutor/mantis/view.php?id=4399
authorCindy Li <cli@ocad.ca>
Thu, 5 Aug 2010 16:44:20 +0000 (16:44 -0000)
committerCindy Li <cli@ocad.ca>
Thu, 5 Aug 2010 16:44:20 +0000 (16:44 -0000)
And,
1. some fixes on page path URL (Menu.class.php)
2. remove lines of commented debug from header.tmpl.php

docs/include/classes/Menu.class.php
docs/tests/html/tests_questions.inc.php
docs/tests/question_db.php
docs/themes/default/include/header.tmpl.php
docs/themes/default/tests/question_db_top.tmpl.php

index bbcd28b..17f8273 100644 (file)
@@ -431,19 +431,25 @@ class Menu {
                // all children pages inherit URL parameter of the parent page
                $parent_page = $this->pages[$page]['parent'];
                $parent_page_param = $this->getParam($page);
+               
+               if (stripos($page, str_replace(array(SEP, '?'), array('', ''), $parent_page_param)) > 0) {
+                       $page_url = $page;
+               } else {
+                       $page_url = $page.$parent_page_param;
+               }
 
                $page_title = $this->getPageTitle($page);
 
                if (isset($parent_page) && defined($parent_page))
                {
-                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
+                       $path[] = array('url' => $_base_path . $page_url, 'title' => $page_title, 'param' => $parent_page_param);
                }
                else if (isset($parent_page))
                {
-                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
+                       $path[] = array('url' => $_base_path . $page_url, 'title' => $page_title, 'param' => $parent_page_param);
                        $path = array_merge((array) $path, $this->setPath($parent_page));
                } else {
-                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
+                       $path[] = array('url' => $_base_path . $page_url, 'title' => $page_title, 'param' => $parent_page_param);
                }
 
                return $path;
index b88b196..4293258 100644 (file)
@@ -50,8 +50,6 @@ else if (isset($category_row)) {
 \r
 $cols = 3;\r
 ?>\r
-\r
-       <div class="input-form" style="width:90%;">\r
        <fieldset class="group_form"><legend class="group_form"><?php echo _AT('category'); ?></legend>\r
        <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
                <input type="hidden" name="tid" value="<?php echo $tid; ?>" />\r
@@ -67,10 +65,9 @@ $cols = 3;
                        <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>" />\r
                        <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />\r
                </div>\r
-               </form>\r
+       </form>\r
 \r
-               </fieldset>\r
-       </div>\r
+       </fieldset>\r
 \r
 <?php if ($tid): ?>\r
        <form method="post" action="tests/add_test_questions_confirm.php?_course_id=<?php echo $_course_id; ?>" name="form">\r
index e7a6440..f243536 100644 (file)
@@ -99,7 +99,8 @@ $savant->display('tests/question_db_top.tmpl.php');
 $tid = 0; 
 
 require_once(TR_INCLUDE_PATH.'../tests/html/tests_questions.inc.php'); 
+?>
+<br style="clear:both;" />
+</div>
 
-require_once(TR_INCLUDE_PATH.'footer.inc.php'); 
-
-?>
\ No newline at end of file
+<?php require_once(TR_INCLUDE_PATH.'footer.inc.php');?>
\ No newline at end of file
index 7717e62..922e5cf 100644 (file)
@@ -328,13 +328,6 @@ foreach ($this->top_level_pages as $page) {
 <div id="subnavlistcontainer">
     <div id="sub-navigation">
          <?php if (isset($this->back_to_page)): ?>
-
-<?php
-//global $_base_href;
-//debug($_base_href);
-
-?>
-
            <div id="subnavbacktopage">   
              <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo '<img src="'.TR_BASE_HREF.'images/arrowicon.gif"  alt="'._AT('back_to').':'.$this->back_to_page['title'].'" title="'._AT('back_to').':'.$this->back_to_page['title'].'" style="vertical-align:center;" />'; ?></a> 
            </div>
index b15bbba..ed60ba9 100644 (file)
@@ -11,7 +11,8 @@
 /************************************************************************/\r
 \r
 ?>\r
-       <fieldset class="group_form" style="width:43%;float:left;height:18em;min-width:15em;margin-left:4em;"><legend class="group_form"><?php echo _AT('create_new_question'); ?></legend>\r
+<div class="input-form">\r
+       <fieldset class="group_form" style="width:46%;float:left;height:18em;min-width:15em;"><legend class="group_form"><?php echo _AT('create_new_question'); ?></legend>\r
                <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
                        <input type="hidden" name="tid" value="<?php echo $this->tid; ?>" />\r
                        <input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
@@ -27,7 +28,7 @@
                </form>\r
        </fieldset>\r
 \r
-       <fieldset class="group_form" style="width:38%;float:left;clear:right;height:18em;"><legend class="group_form"><?php echo _AT('import_question'); ?></legend>\r
+       <fieldset class="group_form" style="width:46%;float:left;clear:right;height:18em;"><legend class="group_form"><?php echo _AT('import_question'); ?></legend>\r
                <form method="post" action="<?php echo 'tests/question_import.php?_course_id='.$this->course_id; ?>" enctype="multipart/form-data" >    <label for="to_file"><?php echo _AT('upload_question'); ?></label><br />\r
                        <input type="file" name="file" id="to_file" /><br /><br />\r
                        <div class="row buttons">\r