2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 global $_custom_css, $onload;
\r
14 $_custom_css = TR_BASE_HREF."include/jscripts/infusion/components/inlineEdit/css/InlineEdit.css";
\r
15 $onload = "document.add_form.category_name.focus();";
\r
16 include(TR_INCLUDE_PATH.'header.inc.php');
\r
19 <div class="input-form">
\r
20 <form name="add_form" method="post" action="<?php echo AT_print($_SERVER['PHP_SELF'], 'input.form'); ?>" >
\r
21 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("add_course_category"); ?></legend>
\r
22 <table class="form-data" align="left">
\r
25 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="category_name"><?php echo _AT('category_name'); ?></label>:
\r
26 <input id="category_name" name="category_name" type="text" maxlength="255" size="30" />
\r
27 <input type="submit" name="add" value="<?php echo _AT('add'); ?>" />
\r
35 <div id="output_div" class="input-form">
\r
36 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("course_categories"); ?></legend>
\r
38 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
40 <table summary="<?php echo _AT('course_category_table_summary'); ?>" class="data" rules="rows" id="editable_table">
\r
43 <th scope="col" align="left" width="5%"><input type="checkbox" value="<?php echo _AT('select_all'); ?>" id="all" title="<?php echo _AT('select_all'); ?>" name="selectall" onclick="CheckAll();" /></th>
\r
44 <th scope="col"><?php echo _AT('category_name'); ?></th>
\r
48 <?php if (is_array($this->rows) && count($this->rows) > 0): ?>
\r
52 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
57 <?php if (is_array($this->rows)){ foreach ($this->rows as $row) {?>
\r
58 <!-- <tr onmousedown="document.form['m<?php echo $row['category_id']; ?>'].checked = !document.form['m<?php echo $row['category_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['category_id']; ?>');"
\r
59 onkeydown="document.form['m<?php echo $row['category_id']; ?>'].checked = !document.form['m<?php echo $row['category_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['category_id']; ?>');"
\r
60 id="rm<?php echo $row['category_id']; ?>">
\r
61 <td><input type="checkbox" name="id[]" value="<?php echo $row['category_id']; ?>" id="m<?php echo $row['category_id']; ?>"
\r
62 onmouseup="this.checked=!this.checked" onkeyup="this.checked=!this.checked" /></td>
\r
64 <tr id="rm<?php echo $row['category_id']; ?>">
\r
65 <td><input type="checkbox" name="id[]" value="<?php echo $row['category_id']; ?>" id="m<?php echo $row['category_id']; ?>" /></td>
\r
66 <td><span class="inlineEdits" id="<?php echo "category_name-".$row['category_id']; ?>"><?php echo $row['category_name']; ?></span></td>
\r
72 <td colspan="2"><?php echo _AT('none_found'); ?></td>
\r
76 <small class="data-table-tip"><?php echo _AT('inline_editor_tip'); ?></small>
\r
82 <script language="JavaScript" type="text/javascript">
\r
84 function CheckAll() {
\r
85 for (var i=0;i<document.form.elements.length;i++) {
\r
86 var e = document.form.elements[i];
\r
87 if ((e.name == 'id[]') && (e.type=='checkbox')) {
\r
88 e.checked = document.form.selectall.checked;
\r
89 togglerowhighlight(document.getElementById("r" + e.id), e.id);
\r
94 function togglerowhighlight(obj, boxid) {
\r
95 if (document.getElementById(boxid).checked) {
\r
96 obj.className = 'selected';
\r
102 jQuery(document).ready(function () {
\r
103 var tableEdit = fluid.inlineEdits("#editable_table", {
\r
106 editables : "td:has(span.inlineEdits)"
\r
108 defaultViewText: "",
\r
111 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
\r
112 if (newValue != oldValue)
\r
113 rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>course_category/index_inline_editor_submit.php", { "field":viewNode.id, "value":newValue },
\r
114 function(data) { handleAjaxResponse(data, viewNode, oldValue); }, "json");
\r
122 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>