* 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
// 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);
* 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();
<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>
</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 }?>