@@ -196,7 +196,7 @@ |
||
196 | 196 | * |
197 | 197 | * @return array |
198 | 198 | */ |
199 | - public function sender($key = '', $userId = '') |
|
199 | + public function sender($key = '', $userId = '') |
|
200 | 200 | { |
201 | 201 | $_user = api_get_user_info($userId); |
202 | 202 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public static function path($name = '') |
37 | 37 | { |
38 | - return api_get_path(SYS_PATH) . 'custompages/' . $name; |
|
38 | + return api_get_path(SYS_PATH).'custompages/'.$name; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | - $file = self::path($page_name . '.php'); |
|
53 | + $file = self::path($page_name.'.php'); |
|
54 | 54 | if (file_exists($file)) { |
55 | 55 | include($file); |
56 | 56 | exit; |
57 | 57 | } else { |
58 | - error_log('CustomPages::displayPage : could not read file ' . $file); |
|
58 | + error_log('CustomPages::displayPage : could not read file '.$file); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | public static function getURLImages($url_id = null) |
70 | 70 | { |
71 | 71 | if (is_null($url_id)) { |
72 | - $url = 'http://' . $_SERVER['HTTP_HOST'] . '/'; |
|
72 | + $url = 'http://'.$_SERVER['HTTP_HOST'].'/'; |
|
73 | 73 | $url_id = UrlManager::get_url_id($url); |
74 | 74 | } |
75 | - $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; |
|
75 | + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; |
|
76 | 76 | $images = array(); |
77 | 77 | for ($img_id = 1; $img_id <= 3; $img_id++) { |
78 | - if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) { |
|
79 | - $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png'; |
|
78 | + if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) { |
|
79 | + $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png'; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | self::navigate($url); |
35 | 35 | } |
36 | 36 | |
37 | - $url = self::www() . $url; |
|
37 | + $url = self::www().$url; |
|
38 | 38 | self::navigate($url); |
39 | 39 | } |
40 | 40 | |
@@ -67,25 +67,25 @@ discard block |
||
67 | 67 | case COURSEMANAGER: |
68 | 68 | $redir = api_get_setting('teacher_page_after_login'); |
69 | 69 | if (!empty($redir)) { |
70 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
70 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
71 | 71 | } |
72 | 72 | break; |
73 | 73 | case STUDENT: |
74 | 74 | $redir = api_get_setting('student_page_after_login'); |
75 | 75 | if (!empty($redir)) { |
76 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
76 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
77 | 77 | } |
78 | 78 | break; |
79 | 79 | case DRH: |
80 | 80 | $redir = api_get_setting('drh_page_after_login'); |
81 | 81 | if (!empty($redir)) { |
82 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
82 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
83 | 83 | } |
84 | 84 | break; |
85 | 85 | case SESSIONADMIN: |
86 | 86 | $redir = api_get_setting('sessionadmin_page_after_login'); |
87 | 87 | if (!empty($redir)) { |
88 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
88 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
89 | 89 | } |
90 | 90 | break; |
91 | 91 | default: |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | $page_after_login = api_get_setting('page_after_login'); |
113 | 113 | if (!empty($page_after_login)) { |
114 | - self::navigate(api_get_path(WEB_PATH) . $page_after_login); |
|
114 | + self::navigate(api_get_path(WEB_PATH).$page_after_login); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $this->skills = $skills; |
29 | 29 | $this->type = $type; |
30 | - $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2); |
|
30 | + $this->center_x = intval($offset_x + $this->canvas_x / 2 - $this->block_size / 2); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | function prepare_skill_box($skill, $position, $class) |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $extra_class = 'second_window'; |
40 | 40 | } |
41 | 41 | |
42 | - $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.' '.$class.'" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">'; |
|
42 | + $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.' '.$class.'" style = "top:'.$position['y'].'px; left:'.$position['x'].'px;">'; |
|
43 | 43 | |
44 | - $content = $skill['name']; |
|
44 | + $content = $skill['name']; |
|
45 | 45 | $content .= '<div class="btn-group">'; |
46 | 46 | $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); |
47 | 47 | $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | } |
88 | 88 | //default_arrow_color |
89 | 89 | |
90 | - $this->js .= 'var e'.$block_id.' = prepare("block_' . $block_id.'", '.$end_point.');'."\n"; |
|
91 | - $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_' . $skill['parent_id'].'", '.$end_point.');'."\n"; |
|
92 | - $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n";; |
|
90 | + $this->js .= 'var e'.$block_id.' = prepare("block_'.$block_id.'", '.$end_point.');'."\n"; |
|
91 | + $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_'.$skill['parent_id'].'", '.$end_point.');'."\n"; |
|
92 | + $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n"; ; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $brothers = array(); |
126 | 126 | |
127 | 127 | foreach ($this->skills as &$skill) { |
128 | - if (!in_array($skill['parent_id'], array(0,1))) { |
|
128 | + if (!in_array($skill['parent_id'], array(0, 1))) { |
|
129 | 129 | continue; |
130 | 130 | } |
131 | - $childs = isset($skill['children']) ? count($skill['children']) : 0 ; |
|
131 | + $childs = isset($skill['children']) ? count($skill['children']) : 0; |
|
132 | 132 | |
133 | 133 | //$x = round($this->offsetX * sin(deg2rad($corner * $count))); |
134 | 134 | //$y = round($this->offsetY * cos(deg2rad($corner * $count))); |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | if ($skill['parent_id'] == 0) { |
145 | 145 | //$x = 130*$childs/2; |
146 | 146 | //$x = $this->space_between_blocks_x*$childs/2; |
147 | - $x = $this->canvas_x/2 - $this->block_size/2; |
|
147 | + $x = $this->canvas_x / 2 - $this->block_size / 2; |
|
148 | 148 | } else { |
149 | 149 | $max = isset($this->skills[$skill['parent_id']]['children']) ? count($this->skills[$skill['parent_id']]['children']) : 0; |
150 | - foreach($this->skills[$skill['parent_id']]['children'] as $id => $sk) { |
|
150 | + foreach ($this->skills[$skill['parent_id']]['children'] as $id => $sk) { |
|
151 | 151 | if ($skill['id'] == $sk['id']) { |
152 | 152 | break; |
153 | 153 | } |
@@ -155,17 +155,17 @@ discard block |
||
155 | 155 | } |
156 | 156 | $parent_x = isset($this->skills[$skill['parent_id']]['x']) ? $this->skills[$skill['parent_id']]['x'] : 0; |
157 | 157 | //$x = $my_count*$this->space_between_blocks_x + $parent_x + $this->block_size - ($this->space_between_blocks_x*$max/2) ; |
158 | - $x = $my_count*$this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x/2 ) ; |
|
158 | + $x = $my_count * $this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x / 2); |
|
159 | 159 | } |
160 | 160 | |
161 | - $y = $skill['level']*$this->space_between_blocks_y; |
|
161 | + $y = $skill['level'] * $this->space_between_blocks_y; |
|
162 | 162 | |
163 | 163 | $skill['x'] = $x; |
164 | 164 | $skill['y'] = $y; |
165 | 165 | |
166 | 166 | //$skill['description'] = "{$brothers[$skill['parent_id']]} $x - $y"; |
167 | 167 | //$skill['name'] = $skill['name']." | $x = $my_count * 150 + $parent_x - (150* $max/2) - 10*$childs "; |
168 | - $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y +$y)); |
|
168 | + $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y + $y)); |
|
169 | 169 | } |
170 | 170 | return $this->get_html(); |
171 | 171 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | foreach ($data as $row) { |
101 | 101 | $string = implode("</td><td>", $row); |
102 | - $string = '<tr><td>' . $string . '</td></tr>'; |
|
102 | + $string = '<tr><td>'.$string.'</td></tr>'; |
|
103 | 103 | if ($encoding != 'utf-8') { |
104 | 104 | $string = api_convert_encoding($string, $encoding, $systemEncoding); |
105 | 105 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | fwrite($handle, '<'.$wrapper_tagname.'>'); |
174 | 174 | } |
175 | 175 | $s = self::_export_complex_table_xml_helper($data); |
176 | - fwrite($handle,$s); |
|
176 | + fwrite($handle, $s); |
|
177 | 177 | if (!is_null($wrapper_tagname)) { |
178 | 178 | fwrite($handle, '</'.$wrapper_tagname.'>'."\n"); |
179 | 179 | } |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | } |
196 | 196 | $string = ''; |
197 | 197 | foreach ($data as $row) { |
198 | - $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>'; |
|
198 | + $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>'; |
|
199 | 199 | if (is_array($row['value'])) { |
200 | - $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n"; |
|
201 | - $string .= str_repeat("\t",$level).'</'.$row['name'].'>'; |
|
200 | + $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
201 | + $string .= str_repeat("\t", $level).'</'.$row['name'].'>'; |
|
202 | 202 | } else { |
203 | 203 | $string .= $row['value']; |
204 | 204 | $string .= '</'.$row['name'].'>'; |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | { |
111 | 111 | $old_locale = setlocale(LC_ALL, null); |
112 | 112 | $code = api_get_language_isocode(); |
113 | - $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8'); |
|
113 | + $locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8'); |
|
114 | 114 | $try_sort = false; |
115 | 115 | |
116 | - foreach($locale_list as $locale) { |
|
116 | + foreach ($locale_list as $locale) { |
|
117 | 117 | $my_local = setlocale(LC_COLLATE, $locale); |
118 | 118 | if ($my_local) { |
119 | 119 | $try_sort = true; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $flatten = array(); |
152 | 152 | array_walk_recursive( |
153 | 153 | $array, |
154 | - function ($value) use (&$flatten) { |
|
154 | + function($value) use (&$flatten) { |
|
155 | 155 | $flatten[] = $value; |
156 | 156 | } |
157 | 157 | ); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | require_once 'xapian.php'; |
9 | -require_once dirname(__FILE__) . '/../IndexableChunk.class.php'; |
|
9 | +require_once dirname(__FILE__).'/../IndexableChunk.class.php'; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Abstract helper class |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | if (!empty($chunk->terms)) { |
131 | 131 | foreach ($chunk->terms as $term) { |
132 | 132 | /* FIXME: think of getting weight */ |
133 | - $doc->add_term($term['flag'] . $term['name'], 1); |
|
133 | + $doc->add_term($term['flag'].$term['name'], 1); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $doc->clear_terms(); |
216 | 216 | foreach ($terms as $term) { |
217 | 217 | //add directly |
218 | - $doc->add_term($prefix . $term, 1); |
|
218 | + $doc->add_term($prefix.$term, 1); |
|
219 | 219 | } |
220 | 220 | $this->db->replace_document($did, $doc); |
221 | 221 | $this->db->flush(); |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | * Code |
9 | 9 | */ |
10 | 10 | require_once 'xapian.php'; |
11 | -require_once dirname(__FILE__) . '/../IndexableChunk.class.php'; |
|
11 | +require_once dirname(__FILE__).'/../IndexableChunk.class.php'; |
|
12 | 12 | //TODO: think another way without including specific fields here |
13 | -require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
13 | +require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
14 | 14 | |
15 | -define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH) . 'plugins/xapian/searchdb/'); |
|
15 | +define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Queries the database. |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | // process each specific field prefix |
97 | 97 | foreach ($specific_fields as $specific_field) { |
98 | - $results[$count]['sf-' . $specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']); |
|
98 | + $results[$count]['sf-'.$specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // rest of data |
@@ -261,6 +261,6 @@ discard block |
||
261 | 261 | } else { |
262 | 262 | $message_error = get_lang('SearchOtherXapianError'); |
263 | 263 | } |
264 | - $display_message = get_lang('Error') . ' : ' . $message_error; |
|
264 | + $display_message = get_lang('Error').' : '.$message_error; |
|
265 | 265 | Display::display_error_message($display_message); |
266 | 266 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * code |
9 | 9 | */ |
10 | -require_once dirname(__FILE__) . '/../../global.inc.php'; |
|
10 | +require_once dirname(__FILE__).'/../../global.inc.php'; |
|
11 | 11 | include_once 'xapian/XapianIndexer.class.php'; |
12 | 12 | |
13 | 13 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
40 | 40 | return FALSE; |
41 | 41 | |
42 | - require_once api_get_path(LIBRARY_PATH) . 'search/xapian/XapianQuery.php'; |
|
42 | + require_once api_get_path(LIBRARY_PATH).'search/xapian/XapianQuery.php'; |
|
43 | 43 | |
44 | 44 | // compare terms |
45 | 45 | $doc = $this->get_document($search_did); |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | |
56 | 56 | // save it to search engine |
57 | 57 | foreach ($missing_terms as $term) { |
58 | - $this->add_term_to_doc($prefix . $term, $doc); |
|
58 | + $this->add_term_to_doc($prefix.$term, $doc); |
|
59 | 59 | } |
60 | 60 | foreach ($deprecated_terms as $term) { |
61 | - $this->remove_term_from_doc($prefix . $term, $doc); |
|
61 | + $this->remove_term_from_doc($prefix.$term, $doc); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // don't do anything if no change |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @return array Array of terms |
75 | 75 | */ |
76 | 76 | function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id) { |
77 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
77 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
78 | 78 | $terms = get_specific_field_values_list_by_prefix($prefix, $course_code, $tool_id, $ref_id); |
79 | 79 | $prefix_terms = array(); |
80 | 80 | foreach ($terms as $term) { |