http://www.atutor.ca/atutor/mantis/view.php?id=4484
authorCindy Li <cli@ocad.ca>
Thu, 12 Aug 2010 15:43:02 +0000 (15:43 -0000)
committerCindy Li <cli@ocad.ca>
Thu, 12 Aug 2010 15:43:02 +0000 (15:43 -0000)
1. limit category names in the category picker to 28 characters;
2. adjust "delete this lesson" icon

docs/include/classes/Utility.class.php
docs/include/constants.inc.php
docs/themes/default/include/header.tmpl.php

index cd918f0..5c451fb 100644 (file)
@@ -51,12 +51,12 @@ class Utility {
        * truncate it.\r
        * This is used on data that are being inserted into the database.\r
        * If this function is used for display purposes, you may want to add the '...' \r
-       *  at the end of the string by setting the $forDisplay=1\r
+       * at the end of the string by setting the $forDisplay=1\r
        * @param        the mbstring that needed to be checked\r
        * @param        the byte length of what the input should be in the database.\r
-       * @param        (OPTIONAL)\r
-       *                       append '...' at the end of the string.  Should not use this when \r
-       *                       dealing with database.  This should only be set for display purposes.\r
+       * @param        (OPTIONAL) 1 or 0, default value is 0 \r
+       *                       when 1, append '...' at the end of the string.\r
+       *           when 0, only truncate string, do not append '...'  \r
        * @return       the mbstring safe sql entry\r
        * @author       Harris Wong\r
        */\r
index a4e54c6..e4e35ca 100644 (file)
@@ -68,6 +68,9 @@ define('TR_COURSESIZE_DEFAULT',                  -2);  /* can be changed in config.inc.php */
 // course category
 define('TR_COURSECATEGORY_UNCATEGORIZED',   0); 
 
+// the maximum length of the category name in category picker
+define('TR_MAX_LAN_CATEGORY_NAME', 28);
+
 // content type
 define('CONTENT_TYPE_CONTENT',  0);
 define('CONTENT_TYPE_FOLDER', 1);
index eaace23..6346989 100644 (file)
@@ -53,6 +53,7 @@ if (!defined('TR_INCLUDE_PATH')) { exit; }
  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
  */
 include_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
 $lang_charset = "UTF-8";
 //Timer
 $mtime = microtime(); 
@@ -184,7 +185,9 @@ foreach ($this->top_level_pages as $page) {
           <option value="" <?php if (!isset($_GET['catid']) || $_GET['catid'] == '') echo 'selected="selected"'; ?>><?php echo _AT('all_categories'); ?></option>
           <option value="">---------------------------------</option>
 <?php foreach ($this->categories as $category) {?>
-          <option value="<?php echo $category['category_id']; ?>" <?php if ($_GET['catid'] == $category['category_id']) echo 'selected'; ?>><?php echo $category['category_name']; ?></option>
+          <option value="<?php echo $category['category_id']; ?>" <?php if ($_GET['catid'] == $category['category_id']) echo 'selected'; ?> title="<?php echo $category['category_name']; ?>">
+            <?php echo Utility::validateLength($category['category_name'], TR_MAX_LAN_CATEGORY_NAME, 1); ?>
+          </option>
 <?php }?>
           <option value="0" <?php if ($_GET['catid'] == 0 && $_GET['catid'] <> '') echo 'selected'; ?>><?php echo _AT('cats_uncategorized'); ?></option>
         </select>
@@ -259,7 +262,7 @@ foreach ($this->top_level_pages as $page) {
         </a>
       </li>
       <li><a href="<?php echo $this->base_path; ?>home/course/del_course.php?_course_id=<?php echo $this->course_id; ?>">
-        <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/bookmark_remove.png"; ?>" title="<?php echo _AT('del_course'); ?>" alt="<?php echo _AT('del_course'); ?>" border="0"  class="shortcut_icon"/>
+        <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/delete.gif"; ?>" title="<?php echo _AT('del_course'); ?>" alt="<?php echo _AT('del_course'); ?>" border="0"  class="shortcut_icon"/>
         </a>
       </li>
       <?php }?>