1. display content tool links as shortcut icons.
authorCindy Li <cli@ocad.ca>
Tue, 11 May 2010 18:50:44 +0000 (18:50 -0000)
committerCindy Li <cli@ocad.ca>
Tue, 11 May 2010 18:50:44 +0000 (18:50 -0000)
2. On "Translation" page, set "search phrase" button as default button. It means when user hit ENTER, the "search" button is fired instead of "submit" button

docs/home/course/content.php
docs/include/classes/Language/LanguageManager.class.php
docs/include/header.inc.php
docs/themes/default/include/footer.tmpl.php
docs/themes/default/include/header.tmpl.php
docs/translation/index.php

index 9018d9a..4043c1b 100644 (file)
@@ -192,6 +192,43 @@ if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
 }
 $savant->assign('shortcuts', $shortcuts);
 */
+
+if (((!$content_row['content_parent_id'] && ($_SESSION['packaging'] == 'top'))
+      || ($_SESSION['packaging'] == 'all'))
+         || (isset($_current_user) && $_current_user->isAuthor($_course_id))) {
+
+       $_tool_shortcuts[] = array(
+                 'title' => _AT('export_content'), 
+                 'url' => $_base_href . 'home/imscc/ims_export.php?_cid='.$cid,
+                 'icon' => $_base_href . 'images/download.png');
+}
+
+if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
+       $_tool_shortcuts[] = array(
+                 'title' => _AT('edit_this_page'),   
+                  'url' => $_base_href . 'home/editor/edit_content.php?_cid='.$cid,
+                 'icon' => $_base_href . 'images/medit.gif');
+
+       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
+                 $_tool_shortcuts[] = array(
+                 'title' => _AT('add_sibling_folder'), 
+                 'url' => $_base_href .
+                       'home/editor/edit_content_folder.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
+                  'icon' => $_base_href . 'images/folder_new_sibling.gif');
+       }
+       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
+               $_tool_shortcuts[] = array(
+                 'title' => _AT('add_sibling_page'), 
+                 'url' => $_base_href .
+                       'home/editor/edit_content.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
+                 'icon' => $_base_href . 'images/page_add_sibling.gif');
+       }
+       $_tool_shortcuts[] = array(
+                 'title' => _AT('delete_this_page'),   
+                 'url' => $_base_href . 'home/editor/delete_content.php?_cid='.$cid,
+                 'icon' => $_base_href . 'images/page_delete.gif');
+}
+
 //if it has test and forum associated with it, still display it even if the content is empty
 if ($content_row['text'] == '' && empty($content_test_ids)){
        $msg->addInfo('NO_PAGE_CONTENT');
index ca2843e..84773e5 100644 (file)
@@ -228,6 +228,7 @@ class LanguageManager {
        function printList($current_language, $name, $id, $url) {
 
                $delim = false;
+               
                foreach ($this->availableLanguages as $codes) {
                        $language = current($codes);
 
index ff5093f..86d057f 100644 (file)
@@ -27,7 +27,7 @@ global $_custom_head;
 global $_base_path;
 global $_pages;
 global $framed, $popup;
-global $_current_user, $_course_id, $_sequence_links;
+global $_current_user, $_course_id, $_sequence_links, $_tool_shortcuts;
 global $validate_content;
 global $contentManager;
 global $course_base_href, $content_base_href;
@@ -98,48 +98,7 @@ if (isset($course_base_href) || isset($content_base_href)) {
        }
 }
 
-// Setup array of content tools for shortcuts tool bar.
-
-$shortcuts = array();
-if (((!$content_row['content_parent_id'] && ($_SESSION['packaging'] == 'top'))
-      || ($_SESSION['packaging'] == 'all'))
-         || (isset($_current_user) && $_current_user->isAuthor($_course_id))) {
-
-       $shortcuts[] = array(
-                 'title' => _AT('export_content'), 
-                 'url' => $_base_href . 'tools/ims/ims_export.php?cid='.$cid,
-                 'icon' => $_base_href . 'images/download.png');
-}
-
-if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
-       $shortcuts[] = array(
-                 'title' => _AT('edit_this_page'),   
-                  'url' => $_base_href . 'home/editor/edit_content.php?_cid='.$cid,
-                 'icon' => $_base_href . 'images/medit.gif');
-
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-                 $shortcuts[] = array(
-                 'title' => _AT('add_sibling_folder'), 
-                 'url' => $_base_href .
-                       'home/editor/edit_content_folder.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
-                  'icon' => $_base_href . 'images/folder_new_sibling.gif');
-       }
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-               $shortcuts[] = array(
-                 'title' => _AT('add_sibling_page'), 
-                 'url' => $_base_href .
-                       'home/editor/edit_content.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
-                 'icon' => $_base_href . 'images/page_add_sibling.gif');
-       }
-       $shortcuts[] = array(
-                 'title' => _AT('delete_this_page'),   
-                 'url' => $_base_href . 'home/editor/delete_content.php?_cid='.$cid,
-                 'icon' => $_base_href . 'images/page_delete.gif');
-}
-$savant->assign('shortcuts', $shortcuts);
-
-
-
+$savant->assign('tool_shortcuts', $_tool_shortcuts);  // array of content tools for shortcuts tool bar.
 $savant->assign('content_base_href', $_tmp_base_href);
 $savant->assign('lang_code', $_SESSION['lang']);
 $savant->assign('lang_charset', $myLang->getCharacterSet());
index deb34ba..e738e7f 100644 (file)
@@ -31,8 +31,7 @@ if ($this->course_id > 0) { ?>
        
        <div id="footer">
 <?php 
-if($languageManager->getNumEnabledLanguages() > 1)
-{
+if($languageManager->getNumEnabledLanguages() > 1) {
 ?>
       <div align="center" id="lang" style="clear: left"><br />
 <?php
index 904d5e5..200b67a 100644 (file)
@@ -179,18 +179,17 @@ foreach ($this->top_level_pages as $page) {
   <div id="ajax-msg">
   </div>
 
-      <?php if ($this->shortcuts): ?>
-      <div id="shortcuts">
-             <ul>
-                     <?php foreach ($this->shortcuts as $link): ?>
-                             <li><a href="<?php echo $link['url']; ?>"><img src="<?php echo $link['icon']; ?>" alt="<?php echo $link['title']; ?>"  title="<?php echo $link['title']; ?>" class="shortcut_icon"/><!-- <?php echo $link['title']; ?> --></a></li>
-                     <?php endforeach; ?>
-             </ul>
-      </div>
-      <?php endif; ?>
-      </div>
+  <?php if (is_array($this->tool_shortcuts)): ?>
+  <div id="shortcuts">
+    <ul>
+    <?php foreach ($this->tool_shortcuts as $link): ?>
+      <li><a href="<?php echo $link['url']; ?>"><img src="<?php echo $link['icon']; ?>" alt="<?php echo $link['title']; ?>"  title="<?php echo $link['title']; ?>" class="shortcut_icon"/><!-- <?php echo $link['title']; ?> --></a></li>
+    <?php endforeach; ?>
+    </ul>
+  </div>
+  <?php endif; ?>
 
- <div id="guide_box">
 <div id="guide_box">
     <!-- guide -->
     <?php if (isset($this->guide)) {?>
     <!-- <div> -->
index e077caa..c6da70b 100644 (file)
@@ -22,7 +22,7 @@ global $msg, $addslashes;
 $dao = new DAO();
 $languagesDAO = new LanguagesDAO();
 $languageTextDAO = new LanguageTextDAO();
-
+//debug($_REQUEST);exit;
 if (isset($_REQUEST['reset_filter'])) unset($_REQUEST);
 
 if (isset($_REQUEST['submit']) || isset($_REQUEST['search']))
@@ -93,6 +93,11 @@ include(TR_INCLUDE_PATH.'header.inc.php');
 ?>
 
 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+       <!-- DO NOT REMOVE. It sets the "search" button as the default button, which means when user hit ENTER,
+            the "search" button is fired instead of "submit" button -->
+       <div style="display:none">
+               <input type="submit" name="search" value="<?php echo _AT('search_phase'); ?>" class="submit" /> 
+       </div>
        <div class="input-form">
                <div class="row">
                        <span class="required" title="<?php echo _AT('required_field'); ?>">*</span>