@@ -87,7 +87,8 @@ |
||
87 | 87 | // generate the data to display |
88 | 88 | $sortable_data = array(); |
89 | 89 | foreach ($data_array as $data) { |
90 | - if ($data[2] != "") {//filter by course removed |
|
90 | + if ($data[2] != "") { |
|
91 | +//filter by course removed |
|
91 | 92 | $row = array(); |
92 | 93 | $row[] = $this->build_type_column($data[0]); |
93 | 94 | $row[] = $this->build_name_link($data[0]); |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | * You can add lp_item database manipulation function here |
10 | 10 | * |
11 | 11 | */ |
12 | -class LpItem |
|
13 | -{ |
|
12 | +class LpItem |
|
13 | +{ |
|
14 | 14 | public $c_id = 0; |
15 | 15 | public $id = 0; |
16 | 16 | public $lp_id = 0; |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | public $search_did = 0; |
35 | 35 | public $audio = ''; |
36 | 36 | |
37 | - public function __construct($in_c_id = 0, $in_id = 0) |
|
38 | - { |
|
39 | - if ($in_c_id > 0 && $in_id > 0) { |
|
37 | + public function __construct($in_c_id = 0, $in_id = 0) |
|
38 | + { |
|
39 | + if ($in_c_id > 0 && $in_id > 0) { |
|
40 | 40 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM); |
41 | 41 | $sql = "SELECT * FROM $item_view_table |
42 | 42 | WHERE |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $res = Database::query($sql); |
47 | 47 | $data = Database::fetch_array($res); |
48 | - if (Database::num_rows($res) > 0) { |
|
48 | + if (Database::num_rows($res) > 0) { |
|
49 | 49 | $this->c_id = $data['c_id']; |
50 | 50 | $this->id = $data['id']; |
51 | 51 | $this->lp_id = $data['lp_id']; |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * Update in database |
77 | 77 | */ |
78 | - public function update_in_bdd() |
|
79 | - { |
|
78 | + public function update_in_bdd() |
|
79 | + { |
|
80 | 80 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM); |
81 | - if ($this->c_id > 0 && $this->id > 0) { |
|
81 | + if ($this->c_id > 0 && $this->id > 0) { |
|
82 | 82 | $sql = "UPDATE $item_view_table SET |
83 | 83 | lp_id = '".intval($this->lp_id)."' , |
84 | 84 | item_type = '".Database::escape_string($this->item_type)."' , |
@@ -200,7 +200,10 @@ |
||
200 | 200 | $searchForm->display(); |
201 | 201 | echo '</div>'; |
202 | 202 | ?> |
203 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
203 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) { |
|
204 | + echo '&add=true'; |
|
205 | +} |
|
206 | +?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
204 | 207 | <?php echo '<legend>'.$data['name'].': '.$tool_name.'</legend>'; |
205 | 208 | echo Display::input('hidden', 'id', $id); |
206 | 209 | echo Display::input('hidden', 'form_sent', '1'); |
@@ -150,7 +150,8 @@ |
||
150 | 150 | /** |
151 | 151 | * Actions in the list: edit, accept, delete, request additional information. |
152 | 152 | */ |
153 | -function modify_filter($id) { |
|
153 | +function modify_filter($id) |
|
154 | +{ |
|
154 | 155 | $code = CourseRequestManager::get_course_request_code($id); |
155 | 156 | $result = '<a href="course_request_edit.php?id='.$id.'&caller=2">'.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'. |
156 | 157 | ' <a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;')).'</a>'; |
@@ -98,7 +98,10 @@ discard block |
||
98 | 98 | <td width="40%" align="center"> |
99 | 99 | <select name="user_group_list[]" multiple="multiple" size="20" style="width:400px;"> |
100 | 100 | <?php foreach ($dbUserGroups as $item) { ?> |
101 | - <option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) echo 'selected="selected"'; ?>><?php echo $item['name']; ?> |
|
101 | + <option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) { |
|
102 | + echo 'selected="selected"'; |
|
103 | +} |
|
104 | +?>><?php echo $item['name']; ?> |
|
102 | 105 | </option> |
103 | 106 | <?php } ?> |
104 | 107 | </select> |
@@ -109,7 +112,10 @@ discard block |
||
109 | 112 | <td width="40%" align="center"> |
110 | 113 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
111 | 114 | <?php foreach ($db_urls as $url_obj) { ?> |
112 | - <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?> |
|
115 | + <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) { |
|
116 | + echo 'selected="selected"'; |
|
117 | +} |
|
118 | +?>><?php echo $url_obj['url']; ?> |
|
113 | 119 | </option> |
114 | 120 | <?php } ?> |
115 | 121 | </select> |
@@ -153,7 +153,8 @@ |
||
153 | 153 | echo "\t</tr>\n"; |
154 | 154 | |
155 | 155 | // the main area with the checkboxes or images |
156 | -foreach ($blog_users as $user_id => $user_name) { // $blog_users contains all the users in this blog |
|
156 | +foreach ($blog_users as $user_id => $user_name) { |
|
157 | +// $blog_users contains all the users in this blog |
|
157 | 158 | // --------------------------------------------------- |
158 | 159 | // RETRIEVING THE PERMISSIONS OF THE USER |
159 | 160 | // --------------------------------------------------- |
@@ -87,9 +87,11 @@ |
||
87 | 87 | echo "\t</tr>\n"; |
88 | 88 | |
89 | 89 | // the main area with the checkboxes or images |
90 | -foreach ($tool_rights as $tool => $rights) // $tool_rights contains all the possible tools and their rights |
|
90 | +foreach ($tool_rights as $tool => $rights) { |
|
91 | + // $tool_rights contains all the possible tools and their rights |
|
91 | 92 | { |
92 | 93 | echo "\t<tr>\n"; |
94 | +} |
|
93 | 95 | echo "\t\t<td>\n"; |
94 | 96 | echo get_lang($tool); |
95 | 97 | echo "\t\t</td>\n"; |
@@ -32,8 +32,7 @@ |
||
32 | 32 | } |
33 | 33 | if ($this->form_type == self::TYPE_USER_INFO) { |
34 | 34 | $this->build_user_info_form(); |
35 | - } |
|
36 | - elseif ($this->form_type == self::TYPE_SIMPLE_SEARCH) { |
|
35 | + } elseif ($this->form_type == self::TYPE_SIMPLE_SEARCH) { |
|
37 | 36 | $this->build_simple_search(); |
38 | 37 | } |
39 | 38 | $this->setDefaults(); |
@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | * @param int $count_type Number of items to retrieve |
31 | 31 | * @return array An array of nids corresponding to the results. |
32 | 32 | */ |
33 | -function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) { |
|
33 | +function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) |
|
34 | +{ |
|
34 | 35 | |
35 | 36 | try { |
36 | 37 | if (!is_object($db)) { |
@@ -129,7 +130,8 @@ discard block |
||
129 | 130 | /** |
130 | 131 | * build a boolean query |
131 | 132 | */ |
132 | -function xapian_get_boolean_query($term) { |
|
133 | +function xapian_get_boolean_query($term) |
|
134 | +{ |
|
133 | 135 | return new XapianQuery($term); |
134 | 136 | } |
135 | 137 | |
@@ -141,7 +143,8 @@ discard block |
||
141 | 143 | * @param XapianDatabase $db Xapian database to connect |
142 | 144 | * @return array |
143 | 145 | */ |
144 | -function xapian_get_all_terms($count = 0, $prefix, $db = NULL) { |
|
146 | +function xapian_get_all_terms($count = 0, $prefix, $db = NULL) |
|
147 | +{ |
|
145 | 148 | try { |
146 | 149 | if (!is_object($db)) { |
147 | 150 | $db = new XapianDatabase(XAPIAN_DB); |
@@ -175,7 +178,8 @@ discard block |
||
175 | 178 | * @param XapianDocument document searched |
176 | 179 | * @return array |
177 | 180 | */ |
178 | -function xapian_get_doc_terms($doc = NULL, $prefix) { |
|
181 | +function xapian_get_doc_terms($doc = NULL, $prefix) |
|
182 | +{ |
|
179 | 183 | try { |
180 | 184 | if (!is_a($doc, 'XapianDocument')) { |
181 | 185 | return; |
@@ -210,7 +214,8 @@ discard block |
||
210 | 214 | * @param string $op |
211 | 215 | * @return XapianQuery query joined |
212 | 216 | */ |
213 | -function xapian_join_queries($query1, $query2 = NULL, $op = 'or') { |
|
217 | +function xapian_join_queries($query1, $query2 = NULL, $op = 'or') |
|
218 | +{ |
|
214 | 219 | // let decide how to join, avoiding include xapian.php outside |
215 | 220 | switch ($op) { |
216 | 221 | case 'or': |
@@ -244,7 +249,8 @@ discard block |
||
244 | 249 | * @param String The xapian error message |
245 | 250 | * @return String The chamilo error message |
246 | 251 | */ |
247 | -function display_xapian_error($xapian_error_message) { |
|
252 | +function display_xapian_error($xapian_error_message) |
|
253 | +{ |
|
248 | 254 | $message = explode(':', $xapian_error_message); |
249 | 255 | $type_error_message = $message[0]; |
250 | 256 | if ($type_error_message == 'DatabaseOpeningError') { |