@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * @package chamilo.admin |
5 | 5 | */ |
6 | 6 | // resetting the course id |
7 | -$cidReset=true; |
|
7 | +$cidReset = true; |
|
8 | 8 | |
9 | 9 | // including some necessary files |
10 | 10 | require_once '../inc/global.inc.php'; |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | api_protect_admin_script(true); |
22 | 22 | |
23 | 23 | // setting breadcrumbs |
24 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
25 | -$interbreadcrumb[]=array('url' => 'usergroups.php','name' => get_lang('Classes')); |
|
24 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
25 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
26 | 26 | |
27 | 27 | // Database Table Definitions |
28 | 28 | |
29 | 29 | // setting the name of the tool |
30 | -$tool_name=get_lang('SubscribeClassToSessions'); |
|
30 | +$tool_name = get_lang('SubscribeClassToSessions'); |
|
31 | 31 | |
32 | 32 | $add_type = 'multiple'; |
33 | -if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
33 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
34 | 34 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
35 | 35 | } |
36 | 36 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | function display_advanced_search () { |
66 | 66 | if ($("#advancedSearch").css("display") == "none") { |
67 | 67 | $("#advancedSearch").css("display","block"); |
68 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
68 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
69 | 69 | } else { |
70 | 70 | $("#advancedSearch").css("display","none"); |
71 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
71 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $form_sent = 0; |
84 | 84 | $errorMsg = ''; |
85 | -$sessions=array(); |
|
85 | +$sessions = array(); |
|
86 | 86 | $usergroup = new UserGroup(); |
87 | 87 | $id = intval($_GET['id']); |
88 | 88 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | $session_list = SessionManager::get_sessions_list(array(), array('name')); |
104 | 104 | |
105 | 105 | //api_display_tool_title($tool_name.' ('.$session_info['name'].')'); |
106 | -$elements_not_in = $elements_in= array(); |
|
106 | +$elements_not_in = $elements_in = array(); |
|
107 | 107 | |
108 | 108 | if (!empty($session_list)) { |
109 | - foreach($session_list as $session) { |
|
109 | + foreach ($session_list as $session) { |
|
110 | 110 | if (in_array($session['id'], $session_list_in)) { |
111 | 111 | $elements_in[$session['id']] = $session['name']; |
112 | 112 | } else { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | //checking for extra field with filter on |
121 | 121 | |
122 | -function search_sessions($needle,$type) { |
|
122 | +function search_sessions($needle, $type) { |
|
123 | 123 | global $elements_in; |
124 | 124 | $xajax_response = new xajaxResponse(); |
125 | 125 | $return = ''; |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | array('s.name' => array('operator' => 'LIKE', 'value' => "$needle%")) |
142 | 142 | ); |
143 | 143 | } |
144 | - $i=0; |
|
145 | - if ($type=='single') { |
|
144 | + $i = 0; |
|
145 | + if ($type == 'single') { |
|
146 | 146 | } else { |
147 | 147 | $return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">'; |
148 | 148 | |
149 | - foreach ($session_list as $row ) { |
|
149 | + foreach ($session_list as $row) { |
|
150 | 150 | if (!in_array($row['id'], array_keys($elements_in))) { |
151 | 151 | $return .= '<option value="'.$row['id'].'">'.$row['name'].'</option>'; |
152 | 152 | } |
153 | 153 | } |
154 | 154 | $return .= '</select>'; |
155 | - $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return)); |
|
155 | + $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return)); |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
@@ -171,19 +171,19 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | echo '<div class="actions">'; |
174 | -echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
175 | -echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus"> '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>'; |
|
174 | +echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
175 | +echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus"> '.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>'; |
|
176 | 176 | echo '</div>'; |
177 | -echo '<div id="advancedSearch" style="display: none">'. get_lang('SearchSessions'); ?> : |
|
177 | +echo '<div id="advancedSearch" style="display: none">'.get_lang('SearchSessions'); ?> : |
|
178 | 178 | <input name="SearchSession" onchange = "xajax_search_sessions(this.value,'searchbox')" onkeyup="this.onchange()"> |
179 | 179 | </div> |
180 | -<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();"';}?>> |
|
180 | +<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();"'; }?>> |
|
181 | 181 | <?php |
182 | 182 | echo '<legend>'.$data['name'].': '.$tool_name.'</legend>'; |
183 | 183 | |
184 | -if ($add_type=='multiple') { |
|
184 | +if ($add_type == 'multiple') { |
|
185 | 185 | if (is_array($extra_field_list)) { |
186 | - if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
186 | + if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
187 | 187 | echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
188 | 188 | foreach ($new_field_list as $new_field) { |
189 | 189 | echo $new_field['name']; |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | echo ' <select name="'.$varname.'">'; |
192 | 192 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
193 | 193 | foreach ($new_field['data'] as $option) { |
194 | - $checked=''; |
|
194 | + $checked = ''; |
|
195 | 195 | if (isset($_POST[$varname])) { |
196 | - if ($_POST[$varname]==$option[1]) { |
|
196 | + if ($_POST[$varname] == $option[1]) { |
|
197 | 197 | $checked = 'selected="true"'; |
198 | 198 | } |
199 | 199 | } |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | } |
208 | 208 | } |
209 | 209 | } |
210 | -echo Display::input('hidden','id',$id); |
|
211 | -echo Display::input('hidden','form_sent','1'); |
|
212 | -echo Display::input('hidden','add_type',null); |
|
213 | -if(!empty($errorMsg)) { |
|
210 | +echo Display::input('hidden', 'id', $id); |
|
211 | +echo Display::input('hidden', 'form_sent', '1'); |
|
212 | +echo Display::input('hidden', 'add_type', null); |
|
213 | +if (!empty($errorMsg)) { |
|
214 | 214 | Display::display_normal_message($errorMsg); //main API |
215 | 215 | } |
216 | 216 | ?> |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | <td align="center"><b><?php echo get_lang('SessionsInGroup') ?> :</b></td> |
224 | 224 | </tr> |
225 | 225 | |
226 | -<?php if ($add_type=='multiple') { ?> |
|
226 | +<?php if ($add_type == 'multiple') { ?> |
|
227 | 227 | <tr> |
228 | 228 | <td align="center"> |
229 | 229 | <?php echo get_lang('FirstLetterSessions'); ?> : |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | <td align="center"> |
243 | 243 | <div id="content_source"> |
244 | 244 | <?php |
245 | - if (!($add_type=='multiple')) { |
|
245 | + if (!($add_type == 'multiple')) { |
|
246 | 246 | ?> |
247 | 247 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
248 | 248 | <div id="ajax_list_users_single"></div> |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } else { |
251 | 251 | ?> |
252 | 252 | <div id="ajax_list_multiple"> |
253 | - <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
|
253 | + <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?> |
|
254 | 254 | </div> |
255 | 255 | <?php |
256 | 256 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | </td> |
282 | 282 | <td align="center"> |
283 | 283 | <?php |
284 | - echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false ); |
|
284 | + echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false); |
|
285 | 285 | unset($sessionUsersList); |
286 | 286 | ?> |
287 | 287 | </td> |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $tool_name = get_lang('CreateSubLanguage'); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | -$interbreadcrumb[] = array ('url' => 'languages.php', 'name' => get_lang('PlatformLanguages')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'languages.php', 'name' => get_lang('PlatformLanguages')); |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Add sub-language |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param int ID del idioma padre |
31 | 31 | * @return int New sub language ID or false on error |
32 | 32 | */ |
33 | -function add_sub_language ($original_name,$english_name,$isocode,$sublanguage_available,$parent_id) { |
|
33 | +function add_sub_language($original_name, $english_name, $isocode, $sublanguage_available, $parent_id) { |
|
34 | 34 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
35 | 35 | $original_name = Database::escape_string($original_name); |
36 | 36 | $english_name = Database::escape_string($english_name); |
@@ -61,41 +61,41 @@ discard block |
||
61 | 61 | * @todo This function is not transaction-safe and should probably be included |
62 | 62 | * inside the add_sub_language function. |
63 | 63 | */ |
64 | -function check_if_language_exist ($original_name, $english_name, $isocode, $sublanguage_available) { |
|
65 | - $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
|
66 | - $sql_original_name='SELECT count(*) AS count_original_name FROM '.$tbl_admin_languages.' WHERE original_name="'.Database::escape_string($original_name).'" '; |
|
67 | - $sql_english_name='SELECT count(*) AS count_english_name FROM '.$tbl_admin_languages.' WHERE english_name="'.Database::escape_string($english_name).'" '; |
|
64 | +function check_if_language_exist($original_name, $english_name, $isocode, $sublanguage_available) { |
|
65 | + $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
|
66 | + $sql_original_name = 'SELECT count(*) AS count_original_name FROM '.$tbl_admin_languages.' WHERE original_name="'.Database::escape_string($original_name).'" '; |
|
67 | + $sql_english_name = 'SELECT count(*) AS count_english_name FROM '.$tbl_admin_languages.' WHERE english_name="'.Database::escape_string($english_name).'" '; |
|
68 | 68 | //$sql_isocode='SELECT count(*) AS count_isocode FROM '.$tbl_admin_languages.' WHERE isocode="'.Database::escape_string($isocode).'" '; |
69 | - $rs_original_name=Database::query($sql_original_name); |
|
70 | - $rs_english_name=Database::query($sql_english_name); |
|
69 | + $rs_original_name = Database::query($sql_original_name); |
|
70 | + $rs_english_name = Database::query($sql_english_name); |
|
71 | 71 | //$rs_isocode=Database::query($sql_isocode); |
72 | - $count_original_name=Database::result($rs_original_name,0,'count_original_name'); |
|
73 | - $count_english_name=Database::result($rs_english_name,0,'count_english_name'); |
|
72 | + $count_original_name = Database::result($rs_original_name, 0, 'count_original_name'); |
|
73 | + $count_english_name = Database::result($rs_english_name, 0, 'count_english_name'); |
|
74 | 74 | //$count_isocode=Database::result($rs_isocode,0,'count_isocode'); |
75 | - $has_error=false; |
|
76 | - $message_information=array(); |
|
75 | + $has_error = false; |
|
76 | + $message_information = array(); |
|
77 | 77 | |
78 | - if ($count_original_name==1) { |
|
79 | - $has_error=true; |
|
80 | - $message_information['original_name']=true; |
|
78 | + if ($count_original_name == 1) { |
|
79 | + $has_error = true; |
|
80 | + $message_information['original_name'] = true; |
|
81 | 81 | } |
82 | - if ($count_english_name==1) { |
|
83 | - $has_error=true; |
|
84 | - $message_information['english_name']=true; |
|
82 | + if ($count_english_name == 1) { |
|
83 | + $has_error = true; |
|
84 | + $message_information['english_name'] = true; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $iso_list = api_get_platform_isocodes(); |
88 | 88 | $iso_list = array_values($iso_list); |
89 | 89 | |
90 | 90 | if (!in_array($isocode, $iso_list)) { |
91 | - $has_error=true; |
|
92 | - $message_information['isocode']=true; |
|
91 | + $has_error = true; |
|
92 | + $message_information['isocode'] = true; |
|
93 | 93 | } |
94 | - if ($has_error===true) { |
|
95 | - $message_information['execute_add']=false; |
|
94 | + if ($has_error === true) { |
|
95 | + $message_information['execute_add'] = false; |
|
96 | 96 | } |
97 | - if ($has_error===false) { |
|
98 | - $message_information['execute_add']=true; |
|
97 | + if ($has_error === false) { |
|
98 | + $message_information['execute_add'] = true; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $message_information; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @return bool |
109 | 109 | * @todo deprecate this function and use the static method directly |
110 | 110 | */ |
111 | -function check_if_exist_language_by_id ($language_id) { |
|
111 | +function check_if_exist_language_by_id($language_id) { |
|
112 | 112 | return SubLanguageManager::check_if_exist_language_by_id($language_id); |
113 | 113 | } |
114 | 114 | /** |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | * @param int Language ID of the presumed parent |
117 | 117 | * @return bool True if this language has children, false otherwise |
118 | 118 | */ |
119 | -function ckeck_if_is_parent_of_sub_language ($parent_id) { |
|
120 | - $sql='SELECT count(*) AS count FROM language WHERE parent_id= '.intval($parent_id).''; |
|
121 | - $rs=Database::query($sql); |
|
122 | - if (Database::num_rows($rs)>0 && Database::result($rs,0,'count')==1) { |
|
119 | +function ckeck_if_is_parent_of_sub_language($parent_id) { |
|
120 | + $sql = 'SELECT count(*) AS count FROM language WHERE parent_id= '.intval($parent_id).''; |
|
121 | + $rs = Database::query($sql); |
|
122 | + if (Database::num_rows($rs) > 0 && Database::result($rs, 0, 'count') == 1) { |
|
123 | 123 | return true; |
124 | 124 | } else { |
125 | 125 | return false; |
@@ -131,117 +131,117 @@ discard block |
||
131 | 131 | * @param int Child language ID |
132 | 132 | * @return array |
133 | 133 | */ |
134 | -function allow_get_all_information_of_sub_language ($parent_id,$sub_language_id) { |
|
135 | - return SubLanguageManager::get_all_information_of_sub_language($parent_id,$sub_language_id); |
|
134 | +function allow_get_all_information_of_sub_language($parent_id, $sub_language_id) { |
|
135 | + return SubLanguageManager::get_all_information_of_sub_language($parent_id, $sub_language_id); |
|
136 | 136 | } |
137 | 137 | /*end declare functions*/ |
138 | 138 | |
139 | 139 | //add data |
140 | 140 | |
141 | -if (isset($_GET['sub_language_id']) && $_GET['sub_language_id']==strval(intval($_GET['sub_language_id']))) { |
|
142 | - $language_name=SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']); |
|
143 | - if (check_if_exist_language_by_id ($_GET['sub_language_id'])===true) { |
|
144 | - $sub_language_id=$_GET['sub_language_id']; |
|
145 | - $sub_language_id_exist=true; |
|
141 | +if (isset($_GET['sub_language_id']) && $_GET['sub_language_id'] == strval(intval($_GET['sub_language_id']))) { |
|
142 | + $language_name = SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']); |
|
143 | + if (check_if_exist_language_by_id($_GET['sub_language_id']) === true) { |
|
144 | + $sub_language_id = $_GET['sub_language_id']; |
|
145 | + $sub_language_id_exist = true; |
|
146 | 146 | } else { |
147 | - $sub_language_id_exist=false; |
|
147 | + $sub_language_id_exist = false; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | } |
151 | 151 | $language_details = array(); |
152 | -$language_name=''; |
|
153 | -if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) { |
|
152 | +$language_name = ''; |
|
153 | +if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) { |
|
154 | 154 | $language_details = SubLanguageManager::get_all_information_of_language($_GET['id']); |
155 | 155 | $language_name = $language_details['original_name']; |
156 | - if (check_if_exist_language_by_id ($_GET['id'])===true) { |
|
157 | - $parent_id=$_GET['id']; |
|
158 | - $language_id_exist=true; |
|
156 | + if (check_if_exist_language_by_id($_GET['id']) === true) { |
|
157 | + $parent_id = $_GET['id']; |
|
158 | + $language_id_exist = true; |
|
159 | 159 | } else { |
160 | - $language_id_exist=false; |
|
160 | + $language_id_exist = false; |
|
161 | 161 | } |
162 | 162 | } else { |
163 | - $language_id_exist=false; |
|
163 | + $language_id_exist = false; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | //removed and register |
167 | 167 | |
168 | -if ((isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) && (isset($_GET['sub_language_id']) && $_GET['sub_language_id']==strval(intval($_GET['sub_language_id'])))) { |
|
169 | - if (check_if_exist_language_by_id($_GET['id'])===true && check_if_exist_language_by_id($_GET['sub_language_id'])===true) { |
|
170 | - $get_all_information=allow_get_all_information_of_sub_language ($_GET['id'],$_GET['sub_language_id']); |
|
171 | - $original_name=$get_all_information['original_name']; |
|
172 | - $english_name=$get_all_information['english_name']; |
|
173 | - $isocode=$get_all_information['isocode']; |
|
168 | +if ((isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) && (isset($_GET['sub_language_id']) && $_GET['sub_language_id'] == strval(intval($_GET['sub_language_id'])))) { |
|
169 | + if (check_if_exist_language_by_id($_GET['id']) === true && check_if_exist_language_by_id($_GET['sub_language_id']) === true) { |
|
170 | + $get_all_information = allow_get_all_information_of_sub_language($_GET['id'], $_GET['sub_language_id']); |
|
171 | + $original_name = $get_all_information['original_name']; |
|
172 | + $english_name = $get_all_information['english_name']; |
|
173 | + $isocode = $get_all_information['isocode']; |
|
174 | 174 | |
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | -$language_name=get_lang('CreateSubLanguageForLanguage').' ( '.strtolower($language_name).' )'; |
|
178 | +$language_name = get_lang('CreateSubLanguageForLanguage').' ( '.strtolower($language_name).' )'; |
|
179 | 179 | |
180 | -if (ckeck_if_is_parent_of_sub_language($parent_id)===true && isset($_GET['action']) && $_GET['action']=='deletesublanguage') { |
|
181 | - $language_name=get_lang('DeleteSubLanguage'); |
|
180 | +if (ckeck_if_is_parent_of_sub_language($parent_id) === true && isset($_GET['action']) && $_GET['action'] == 'deletesublanguage') { |
|
181 | + $language_name = get_lang('DeleteSubLanguage'); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | $msg = ''; |
185 | 185 | |
186 | 186 | if (isset($_POST['SubmitAddNewLanguage'])) { |
187 | - $original_name=$_POST['original_name']; |
|
188 | - $english_name=$_POST['english_name']; |
|
189 | - $isocode=$_POST['isocode']; |
|
190 | - $english_name=str_replace(' ','_',$english_name); |
|
191 | - $isocode=str_replace(' ','_',$isocode); |
|
187 | + $original_name = $_POST['original_name']; |
|
188 | + $english_name = $_POST['english_name']; |
|
189 | + $isocode = $_POST['isocode']; |
|
190 | + $english_name = str_replace(' ', '_', $english_name); |
|
191 | + $isocode = str_replace(' ', '_', $isocode); |
|
192 | 192 | |
193 | - $sublanguage_available=$_POST['sub_language_is_visible']; |
|
194 | - $check_information=array(); |
|
195 | - $check_information=check_if_language_exist($original_name,$english_name,$isocode,$sublanguage_available); |
|
193 | + $sublanguage_available = $_POST['sub_language_is_visible']; |
|
194 | + $check_information = array(); |
|
195 | + $check_information = check_if_language_exist($original_name, $english_name, $isocode, $sublanguage_available); |
|
196 | 196 | foreach ($check_information as $index_information => $value_information) { |
197 | - $allow_insert_info=false; |
|
198 | - if ($index_information=='original_name') { |
|
199 | - $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('OriginalName').'" '.'('.$original_name.')','error'); |
|
197 | + $allow_insert_info = false; |
|
198 | + if ($index_information == 'original_name') { |
|
199 | + $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('OriginalName').'" '.'('.$original_name.')', 'error'); |
|
200 | 200 | } |
201 | - if ($index_information=='english_name') { |
|
202 | - $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('EnglishName').'" '.'('.$english_name.')','error'); |
|
201 | + if ($index_information == 'english_name') { |
|
202 | + $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('EnglishName').'" '.'('.$english_name.')', 'error'); |
|
203 | 203 | } |
204 | - if ($index_information=='isocode') { |
|
205 | - $msg .= Display::return_message(get_lang('CodeDoesNotExists').': '.$isocode.'','error'); |
|
204 | + if ($index_information == 'isocode') { |
|
205 | + $msg .= Display::return_message(get_lang('CodeDoesNotExists').': '.$isocode.'', 'error'); |
|
206 | 206 | } |
207 | - if ($index_information=='execute_add' && $value_information===true) { |
|
208 | - $allow_insert_info=true; |
|
207 | + if ($index_information == 'execute_add' && $value_information === true) { |
|
208 | + $allow_insert_info = true; |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | |
212 | - if (strlen($original_name)>0 && strlen($english_name)>0 && strlen($isocode)>0) { |
|
213 | - if ($allow_insert_info===true && $language_id_exist===true) { |
|
214 | - $english_name=str_replace(' ','_',$english_name); |
|
212 | + if (strlen($original_name) > 0 && strlen($english_name) > 0 && strlen($isocode) > 0) { |
|
213 | + if ($allow_insert_info === true && $language_id_exist === true) { |
|
214 | + $english_name = str_replace(' ', '_', $english_name); |
|
215 | 215 | //Fixes BT#1636 |
216 | - $english_name=api_strtolower($english_name); |
|
216 | + $english_name = api_strtolower($english_name); |
|
217 | 217 | |
218 | - $isocode=str_replace(' ','_',$isocode); |
|
219 | - $str_info='<br/>'.get_lang('OriginalName').' : '.$original_name.'<br/>'.get_lang('EnglishName').' : '.$english_name.'<br/>'.get_lang('PlatformCharsetTitle').' : '.$isocode; |
|
218 | + $isocode = str_replace(' ', '_', $isocode); |
|
219 | + $str_info = '<br/>'.get_lang('OriginalName').' : '.$original_name.'<br/>'.get_lang('EnglishName').' : '.$english_name.'<br/>'.get_lang('PlatformCharsetTitle').' : '.$isocode; |
|
220 | 220 | |
221 | - $mkdir_result=SubLanguageManager::add_language_directory($english_name); |
|
221 | + $mkdir_result = SubLanguageManager::add_language_directory($english_name); |
|
222 | 222 | if ($mkdir_result) { |
223 | - $sl_id = add_sub_language($original_name,$english_name,$isocode,$sublanguage_available,$parent_id); |
|
223 | + $sl_id = add_sub_language($original_name, $english_name, $isocode, $sublanguage_available, $parent_id); |
|
224 | 224 | if ($sl_id === false) { |
225 | 225 | SubLanguageManager::remove_language_directory($english_name); |
226 | - $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'),'error'); |
|
226 | + $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'), 'error'); |
|
227 | 227 | } else { |
228 | 228 | // Here we build the confirmation message and we send the user to the sub language terms definition page, using a little hack - see #3712 |
229 | - $_SESSION['msg'] = Display::return_message(get_lang('TheNewSubLanguageHasBeenAdded').$str_info.'confirm',false); |
|
229 | + $_SESSION['msg'] = Display::return_message(get_lang('TheNewSubLanguageHasBeenAdded').$str_info.'confirm', false); |
|
230 | 230 | unset($interbreadcrumb); |
231 | 231 | $_GET['sub_language_id'] = $_REQUEST['sub_language_id'] = $sl_id; |
232 | 232 | require 'sub_language.php'; |
233 | 233 | exit(); |
234 | 234 | } |
235 | 235 | } else { |
236 | - $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'),'error'); |
|
236 | + $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'), 'error'); |
|
237 | 237 | } |
238 | 238 | } else { |
239 | - if ($language_id_exist===false) { |
|
240 | - $msg .= Display::return_message(get_lang('LanguageParentNotExist'),'error'); |
|
239 | + if ($language_id_exist === false) { |
|
240 | + $msg .= Display::return_message(get_lang('LanguageParentNotExist'), 'error'); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | } else { |
244 | - $msg .= Display::return_message(get_lang('FormHasErrorsPleaseComplete'),'error'); |
|
244 | + $msg .= Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error'); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | if (isset($_POST['SubmitAddDeleteLanguage'])) { |
253 | 253 | $rs = SubLanguageManager::remove_sub_language($_GET['id'], $_GET['sub_language_id']); |
254 | - if ($rs===true) { |
|
254 | + if ($rs === true) { |
|
255 | 255 | Display::display_confirmation_message(get_lang('TheSubLanguageHasBeenRemoved')); |
256 | 256 | } else { |
257 | 257 | Display::display_error_message(get_lang('TheSubLanguageHasNotBeenRemoved')); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | } |
260 | 260 | // ckeck_if_is_parent_of_sub_language($parent_id)===false |
261 | 261 | // |
262 | -if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') { |
|
262 | +if (isset($_GET['action']) && $_GET['action'] == 'definenewsublanguage') { |
|
263 | 263 | $text = $language_name; |
264 | 264 | $form = new FormValidator('addsublanguage', 'post', 'sub_language_add.php?id='.Security::remove_XSS($_GET['id']).'&action=definenewsublanguage'); |
265 | - $class='add'; |
|
265 | + $class = 'add'; |
|
266 | 266 | $form->addElement('header', '', $text); |
267 | - $form->addElement('text', 'original_name', get_lang('OriginalName'),'class="input_titles"'); |
|
267 | + $form->addElement('text', 'original_name', get_lang('OriginalName'), 'class="input_titles"'); |
|
268 | 268 | $form->addRule('original_name', get_lang('ThisFieldIsRequired'), 'required'); |
269 | - $form->addElement('text', 'english_name', get_lang('EnglishName'),'class="input_titles"'); |
|
269 | + $form->addElement('text', 'english_name', get_lang('EnglishName'), 'class="input_titles"'); |
|
270 | 270 | $form->addRule('english_name', get_lang('ThisFieldIsRequired'), 'required'); |
271 | 271 | $form->addElement('text', 'isocode', get_lang('ISOCode'), 'class="input_titles"'); |
272 | 272 | $form->addRule('isocode', get_lang('ThisFieldIsRequired'), 'required'); |
@@ -279,18 +279,18 @@ discard block |
||
279 | 279 | $form->setDefaults($values); |
280 | 280 | $form->display(); |
281 | 281 | } else { |
282 | - if (isset($_GET['action']) && $_GET['action']=='deletesublanguage') { |
|
283 | - $text=$language_name; |
|
282 | + if (isset($_GET['action']) && $_GET['action'] == 'deletesublanguage') { |
|
283 | + $text = $language_name; |
|
284 | 284 | $form = new FormValidator('deletesublanguage', 'post', 'sub_language_add.php?id='.Security::remove_XSS($_GET['id']).'&sub_language_id='.Security::remove_XSS($_GET['sub_language_id'])); |
285 | - $class='minus'; |
|
285 | + $class = 'minus'; |
|
286 | 286 | $form->addElement('header', '', $text); |
287 | - $form->addElement('static', '', get_lang('OriginalName'),$original_name); |
|
288 | - $form->addElement('static', '', get_lang('EnglishName'),$english_name); |
|
289 | - $form->addElement('static', '', get_lang('PlatformCharsetTitle'),$isocode); |
|
287 | + $form->addElement('static', '', get_lang('OriginalName'), $original_name); |
|
288 | + $form->addElement('static', '', get_lang('EnglishName'), $english_name); |
|
289 | + $form->addElement('static', '', get_lang('PlatformCharsetTitle'), $isocode); |
|
290 | 290 | $form->addButtonCreate(get_lang('DeleteSubLanguage'), 'SubmitAddDeleteLanguage'); |
291 | 291 | $form->display(); |
292 | 292 | } |
293 | - if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') { |
|
293 | + if (isset($_GET['action']) && $_GET['action'] == 'definenewsublanguage') { |
|
294 | 294 | Display::display_normal_message(get_lang('TheSubLanguageForThisLanguageHasBeenAdded')); |
295 | 295 | } |
296 | 296 | } |
@@ -7,16 +7,16 @@ |
||
7 | 7 | * @package chamilo.admin |
8 | 8 | */ |
9 | 9 | include ('../inc/global.inc.php'); |
10 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
10 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
11 | 11 | |
12 | 12 | api_protect_admin_script(); |
13 | 13 | $tool_name = get_lang('DummyCourseCreator'); |
14 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
14 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
15 | 15 | Display::display_header($tool_name); |
16 | 16 | //api_display_tool_title($tool_name); |
17 | 17 | if (api_get_setting('server_type') != 'test') { |
18 | 18 | echo get_lang('DummyCourseOnlyOnTestServer'); |
19 | -} elseif( isset($_POST['action'])) { |
|
19 | +} elseif (isset($_POST['action'])) { |
|
20 | 20 | require_once('../coursecopy/classes/DummyCourseCreator.class.php'); |
21 | 21 | $dcc = new DummyCourseCreator(); |
22 | 22 | $dcc->create_dummy_course($_POST['course_code']); |
@@ -5,13 +5,13 @@ |
||
5 | 5 | * @package chamilo.admin |
6 | 6 | */ |
7 | 7 | |
8 | -$cidReset=true; |
|
8 | +$cidReset = true; |
|
9 | 9 | require_once '../inc/global.inc.php'; |
10 | 10 | $this_section = SECTION_PLATFORM_ADMIN; |
11 | 11 | |
12 | 12 | api_protect_admin_script(); |
13 | 13 | |
14 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
14 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
15 | 15 | $tool_name = get_lang('Statistics'); |
16 | 16 | Display::display_header($tool_name); |
17 | 17 | Display::display_footer(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | Display::addFlash(Display::return_message(get_lang('FileDeleted'))); |
60 | 60 | } |
61 | 61 | |
62 | -if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') { |
|
62 | +if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') { |
|
63 | 63 | $id = intval($_GET['id']); |
64 | 64 | api_delete_setting_option($id); |
65 | 65 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
125 | - if (isset($category) && $category== 'search_setting') { |
|
125 | + if (isset($category) && $category == 'search_setting') { |
|
126 | 126 | if (!empty($_REQUEST['search_field'])) { |
127 | 127 | $settings = search_setting($_REQUEST['search_field']); |
128 | 128 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | // Set true for allow_message_tool variable if social tool is actived |
221 | 221 | foreach ($convert_byte_to_mega_list as $item) { |
222 | 222 | if (isset($values[$item])) { |
223 | - $values[$item] = round($values[$item]*1024*1024); |
|
223 | + $values[$item] = round($values[$item] * 1024 * 1024); |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
22 | -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions')); |
|
23 | 23 | |
24 | 24 | Display :: display_header(null); |
25 | 25 | |
26 | -$form = new FormValidator('filter_form','GET', api_get_self()); |
|
26 | +$form = new FormValidator('filter_form', 'GET', api_get_self()); |
|
27 | 27 | |
28 | 28 | $career = new Career(); |
29 | 29 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | // action links |
55 | 55 | echo '<div class="actions" style="margin-bottom:20px">'; |
56 | 56 | echo '<a href="../admin/index.php">'. |
57 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
57 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
58 | 58 | echo '<a href="careers.php">'. |
59 | - Display::return_icon('career.png',get_lang('Careers'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
59 | + Display::return_icon('career.png', get_lang('Careers'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
60 | 60 | echo '<a href="promotions.php">'. |
61 | - Display::return_icon('promotion.png',get_lang('Promotions'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
61 | + Display::return_icon('promotion.png', get_lang('Promotions'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
62 | 62 | echo '</div>'; |
63 | 63 | |
64 | 64 | $form->display(); |
@@ -119,22 +119,22 @@ discard block |
||
119 | 119 | foreach ($career_array as $career_id => $data) { |
120 | 120 | $career = $data['name']; |
121 | 121 | $promotions = $data['promotions']; |
122 | - $career = Display::url($career, 'careers.php?action=edit&id=' . $career_id); |
|
122 | + $career = Display::url($career, 'careers.php?action=edit&id='.$career_id); |
|
123 | 123 | $career = Display::tag('h4', $career); |
124 | - echo '<tr><td style="background-color:#ECF0F1" colspan="3">' . $career . '</td></tr>'; |
|
124 | + echo '<tr><td style="background-color:#ECF0F1" colspan="3">'.$career.'</td></tr>'; |
|
125 | 125 | if (!empty($promotions)) { |
126 | 126 | foreach ($promotions as $promotion_id => $promotion) { |
127 | 127 | $promotion_name = $promotion['name']; |
128 | - $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id=' . $promotion_id); |
|
128 | + $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id='.$promotion_id); |
|
129 | 129 | $sessions = $promotion['sessions']; |
130 | 130 | echo '<tr>'; |
131 | 131 | $count = count($sessions); |
132 | 132 | $rowspan = ''; |
133 | 133 | if (!empty($count)) { |
134 | 134 | $count++; |
135 | - $rowspan = 'rowspan="' . $count . '"'; |
|
135 | + $rowspan = 'rowspan="'.$count.'"'; |
|
136 | 136 | } |
137 | - echo '<td ' . $rowspan . '>'; |
|
137 | + echo '<td '.$rowspan.'>'; |
|
138 | 138 | echo Display::tag('h5', $promotion_url); |
139 | 139 | echo '</td>'; |
140 | 140 | echo '</tr>'; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $course_list = $session['courses']; |
145 | 145 | |
146 | 146 | $url = Display::url($session['data']['name'], |
147 | - '../session/resume_session.php?id_session=' . $session['data']['id']); |
|
147 | + '../session/resume_session.php?id_session='.$session['data']['id']); |
|
148 | 148 | echo '<tr>'; |
149 | 149 | //Session name |
150 | 150 | echo Display::tag('td', $url); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $url = Display::url( |
159 | 159 | $course['title'], |
160 | - api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . $session['data']['id'] |
|
160 | + api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.$session['data']['id'] |
|
161 | 161 | ); |
162 | 162 | echo Display::tag('td', $url); |
163 | 163 | echo '</tr>'; |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | |
16 | 16 | $tool_name = get_lang('SessionOverview'); |
17 | 17 | |
18 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
19 | -$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
18 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
20 | 20 | |
21 | 21 | // Database Table Definitions |
22 | -$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
23 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
22 | +$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
23 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
24 | 24 | $table_access_url_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
25 | 25 | $url_id = api_get_current_access_url_id(); |
26 | 26 | |
27 | 27 | $action = $_GET['action']; |
28 | 28 | |
29 | -switch($action) { |
|
29 | +switch ($action) { |
|
30 | 30 | case 'add_user_to_url': |
31 | 31 | $user_id = $_REQUEST['user_id']; |
32 | 32 | $result = UrlManager::add_user_to_url($user_id, $url_id); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | -foreach($session_list as $session_item) { |
|
61 | +foreach ($session_list as $session_item) { |
|
62 | 62 | $session_id = $session_item['id']; |
63 | 63 | $html .= '<h3>'.$session_item['name'].'</h3>'; |
64 | 64 |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | $group_id = isset($_GET['id']) ? intval($_GET['id']) : intval($_POST['id']); |
15 | 15 | $tool_name = get_lang('GroupEdit'); |
16 | 16 | |
17 | -$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
18 | -$interbreadcrumb[] = array('url' => 'group_list.php','name' => get_lang('GroupList')); |
|
17 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
18 | +$interbreadcrumb[] = array('url' => 'group_list.php', 'name' => get_lang('GroupList')); |
|
19 | 19 | |
20 | 20 | $table_group = Database::get_main_table(TABLE_MAIN_GROUP); |
21 | 21 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $form->applyFilter('url', 'trim'); |
74 | 74 | // Picture |
75 | 75 | $form->addElement('file', 'picture', get_lang('AddPicture')); |
76 | -$allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); |
|
76 | +$allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif'); |
|
77 | 77 | $form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); |
78 | 78 | if (strlen($group_data['picture_uri']) > 0) { |
79 | 79 | $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $form->setDefaults($group_data); |
101 | 101 | |
102 | 102 | // Validate form |
103 | -if ( $form->validate()) { |
|
103 | +if ($form->validate()) { |
|
104 | 104 | $group = $form->exportValues(); |
105 | 105 | |
106 | 106 | $picture_element = $form->getElement('picture'); |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
36 | 36 | |
37 | 37 | $add_type = 'multiple'; |
38 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
38 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
39 | 39 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $access_url_id = 1; |
43 | -if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { |
|
43 | +if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') { |
|
44 | 44 | $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
45 | 45 | } |
46 | 46 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($form_sent == 1) { |
94 | - if ($access_url_id==0) { |
|
94 | + if ($access_url_id == 0) { |
|
95 | 95 | header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
96 | 96 | } elseif (is_array($course_list)) { |
97 | 97 | UrlManager::update_urls_rel_course($course_list, $access_url_id); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | Display::display_header($tool_name); |
104 | 104 | |
105 | 105 | echo '<div class="actions">'; |
106 | -echo Display::url( Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'),''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
106 | +echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
107 | 107 | echo '</div>'; |
108 | 108 | |
109 | 109 | api_display_tool_title($tool_name); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $no_course_list = $course_list = array(); |
115 | 115 | $ajax_search = $add_type == 'unique' ? true : false; |
116 | 116 | |
117 | -if($ajax_search) { |
|
117 | +if ($ajax_search) { |
|
118 | 118 | $courses = UrlManager::get_url_rel_course_data($access_url_id); |
119 | 119 | foreach ($courses as $course) { |
120 | 120 | $course_list[$course['c_id']] = $course; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
132 | - $sql="SELECT id, code, title |
|
132 | + $sql = "SELECT id, code, title |
|
133 | 133 | FROM $tbl_course u |
134 | 134 | ORDER BY title, code"; |
135 | 135 | $result = Database::query($sql); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | -if($add_type == 'multiple') { |
|
145 | +if ($add_type == 'multiple') { |
|
146 | 146 | $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
147 | 147 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
148 | 148 | } else { |
@@ -155,23 +155,23 @@ discard block |
||
155 | 155 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> |
156 | 156 | </div> |
157 | 157 | <br /><br /> |
158 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?> > |
|
158 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?> > |
|
159 | 159 | <?php echo get_lang('SelectUrl').' : '; ?> |
160 | 160 | <select name="access_url_id" onchange="javascript:send();"> |
161 | 161 | <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option> |
162 | 162 | <?php |
163 | - $url_selected=''; |
|
163 | + $url_selected = ''; |
|
164 | 164 | foreach ($url_list as $url_obj) { |
165 | 165 | $checked = ''; |
166 | 166 | if (!empty($access_url_id)) { |
167 | - if ($url_obj[0]==$access_url_id) { |
|
167 | + if ($url_obj[0] == $access_url_id) { |
|
168 | 168 | $checked = 'selected=true'; |
169 | - $url_selected=$url_obj[1]; |
|
169 | + $url_selected = $url_obj[1]; |
|
170 | 170 | } |
171 | 171 | } |
172 | - if ($url_obj['active']==1) { |
|
172 | + if ($url_obj['active'] == 1) { |
|
173 | 173 | ?> |
174 | - <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
174 | + <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
175 | 175 | <?php |
176 | 176 | } |
177 | 177 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | <input type="hidden" name="form_sent" value="1" /> |
182 | 182 | <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" /> |
183 | 183 | <?php |
184 | - if(!empty($errorMsg)) { |
|
184 | + if (!empty($errorMsg)) { |
|
185 | 185 | Display::display_normal_message($errorMsg); //main API |
186 | 186 | } |
187 | 187 | ?> |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | <td align="center"> |
200 | 200 | <div id="content_source"> |
201 | 201 | <?php |
202 | - if($ajax_search) { |
|
202 | + if ($ajax_search) { |
|
203 | 203 | ?> |
204 | 204 | <input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> |
205 | 205 | <div id="ajax_list_courses"></div> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | ?> |
209 | 209 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
210 | 210 | <?php |
211 | - foreach($no_course_list as $no_course) { |
|
211 | + foreach ($no_course_list as $no_course) { |
|
212 | 212 | ?> |
213 | 213 | <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> |
214 | 214 | <?php |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </td> |
224 | 224 | <td width="10%" valign="middle" align="center"> |
225 | 225 | <?php |
226 | - if($ajax_search) { |
|
226 | + if ($ajax_search) { |
|
227 | 227 | ?> |
228 | 228 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
229 | 229 | <em class="fa fa-arrow-left"></em> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <td align="center"> |
247 | 247 | <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
248 | 248 | <?php |
249 | - foreach($course_list as $course) { |
|
249 | + foreach ($course_list as $course) { |
|
250 | 250 | $courseInfo = api_get_course_info_by_id($course['id']); |
251 | 251 | ?> |
252 | 252 | <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <td colspan="3" align="center"> |
262 | 262 | <br /> |
263 | 263 | <?php |
264 | - if(isset($_GET['add'])) |
|
264 | + if (isset($_GET['add'])) |
|
265 | 265 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
266 | 266 | else |
267 | 267 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |