@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * create (a singleton function that ensures ClockworksmsPlugin instance is |
16 | 16 | * created only once. If it is already created, it returns the instance) |
17 | - * @return object ClockworksmsPlugin instance |
|
17 | + * @return ClockworksmsPlugin ClockworksmsPlugin instance |
|
18 | 18 | */ |
19 | 19 | public static function create() |
20 | 20 | { |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * create (a singleton function that ensures KannelsmsPlugin instance is |
16 | 16 | * created only once. If it is already created, it returns the instance) |
17 | - * @return object KannelsmsPlugin instance |
|
17 | + * @return KannelsmsPlugin KannelsmsPlugin instance |
|
18 | 18 | */ |
19 | 19 | public static function create() |
20 | 20 | { |
@@ -213,7 +213,8 @@ |
||
213 | 213 | /** |
214 | 214 | * Returns a meeting "join" URL |
215 | 215 | * @param string The name of the meeting (usually the course code) |
216 | - * @return mixed The URL to join the meeting, or false on error |
|
216 | + * @param false|string $meetingId |
|
217 | + * @return false|null The URL to join the meeting, or false on error |
|
217 | 218 | * @todo implement moderator pass |
218 | 219 | * @assert ('') === false |
219 | 220 | * @assert ('abcdefghijklmnopqrstuvwxyzabcdefghijklmno') === false |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | } |
129 | - */ |
|
129 | + */ |
|
130 | 130 | |
131 | 131 | /* |
132 | 132 | * Creating a Room for the meeting |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | return true; |
257 | 257 | } |
258 | 258 | |
259 | - /** |
|
260 | - * Gets the password for a specific meeting for the current user |
|
261 | - * @return string A moderator password if user is teacher, or the course code otherwise |
|
262 | - */ |
|
259 | + /** |
|
260 | + * Gets the password for a specific meeting for the current user |
|
261 | + * @return string A moderator password if user is teacher, or the course code otherwise |
|
262 | + */ |
|
263 | 263 | public function getMeetingUserPassword() |
264 | 264 | { |
265 | 265 | if ($this->isTeacher()) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | // |
539 | 539 | // } |
540 | 540 | // |
541 | - //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
541 | + //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
542 | 542 | // //created_at |
543 | 543 | // |
544 | 544 | // $item['publish_url'] = api_get_self().'?action=publish&id='.$meetingDb['id']; |
@@ -36,6 +36,11 @@ |
||
36 | 36 | private $_pass; |
37 | 37 | private $_url; |
38 | 38 | |
39 | + /** |
|
40 | + * @param string $host |
|
41 | + * @param string $user |
|
42 | + * @param string $pass |
|
43 | + */ |
|
39 | 44 | public function __construct($host, $user, $pass) |
40 | 45 | { |
41 | 46 | $this->_user = urlencode($user); |
@@ -351,9 +351,9 @@ |
||
351 | 351 | . '&externalRoomType='.$room->externalRoomType; |
352 | 352 | if ($room->allowRecording) { |
353 | 353 | $url .= '&allowUserQuestions='.$this->var_to_str($room->allowUserQuestions) |
354 | - . '&isAudioOnly='.$this->var_to_str($room->isAudioOnly) |
|
355 | - . '&waitForRecording='.$this->var_to_str($room->waitForRecording) |
|
356 | - . '&allowRecording='.$this->var_to_str($room->allowRecording); |
|
354 | + . '&isAudioOnly='.$this->var_to_str($room->isAudioOnly) |
|
355 | + . '&waitForRecording='.$this->var_to_str($room->waitForRecording) |
|
356 | + . '&allowRecording='.$this->var_to_str($room->allowRecording); |
|
357 | 357 | } elseif ($room->isAudioOnly) { |
358 | 358 | $url .= '&isAudioOnly='.$this->var_to_str($room->isAudioOnly); |
359 | 359 | } |
@@ -27,6 +27,9 @@ discard block |
||
27 | 27 | */ |
28 | 28 | class OpenMeetingsRestService |
29 | 29 | { |
30 | + /** |
|
31 | + * @param string $request |
|
32 | + */ |
|
30 | 33 | function call($request, $returnAttribute = "return") |
31 | 34 | { |
32 | 35 | // This will allow you to view errors in the browser |
@@ -121,6 +124,9 @@ discard block |
||
121 | 124 | |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @param DOMDocument $node |
|
129 | + */ |
|
124 | 130 | function getArray($node) |
125 | 131 | { |
126 | 132 | if (is_null($node) || !is_object($node)) { |
@@ -40,31 +40,31 @@ discard block |
||
40 | 40 | // $request |
41 | 41 | |
42 | 42 | // Initialize the session by passing the request as a parameter |
43 | - $session = curl_init ( $request ); |
|
43 | + $session = curl_init($request); |
|
44 | 44 | |
45 | 45 | // Set curl options by passing session and flags |
46 | 46 | // CURLOPT_HEADER allows us to receive the HTTP header |
47 | - curl_setopt ( $session, CURLOPT_HEADER, true ); |
|
47 | + curl_setopt($session, CURLOPT_HEADER, true); |
|
48 | 48 | |
49 | 49 | // CURLOPT_RETURNTRANSFER will return the response |
50 | - curl_setopt ( $session, CURLOPT_RETURNTRANSFER, true ); |
|
50 | + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); |
|
51 | 51 | |
52 | 52 | // Make the request |
53 | - $response = curl_exec ( $session ); |
|
53 | + $response = curl_exec($session); |
|
54 | 54 | |
55 | 55 | // Close the curl session |
56 | - curl_close ( $session ); |
|
56 | + curl_close($session); |
|
57 | 57 | |
58 | 58 | // Confirm that the request was transmitted to the OpenMeetings! Image Search Service |
59 | - if (! $response) { |
|
60 | - die ( "Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()' ); |
|
59 | + if (!$response) { |
|
60 | + die ("Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Create an array to store the HTTP response codes |
64 | - $status_code = array (); |
|
64 | + $status_code = array(); |
|
65 | 65 | |
66 | 66 | // Use regular expressions to extract the code from the header |
67 | - preg_match ( '/\d\d\d/', $response, $status_code ); |
|
67 | + preg_match('/\d\d\d/', $response, $status_code); |
|
68 | 68 | $bt = debug_backtrace(); |
69 | 69 | $caller = array_shift($bt); |
70 | 70 | $extra = ' (from '.$caller['file'].' at line '.$caller['line'].') '; |
@@ -74,24 +74,24 @@ discard block |
||
74 | 74 | // Success |
75 | 75 | break; |
76 | 76 | case 503 : |
77 | - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503. |
|
77 | + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503. |
|
78 | 78 | That means: Service unavailable. An internal problem prevented us from returning data to you.' ); |
79 | 79 | return false; |
80 | 80 | break; |
81 | 81 | case 403 : |
82 | - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403. |
|
82 | + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403. |
|
83 | 83 | That means: Forbidden. You do not have permission to access this resource, or are over your rate limit.' ); |
84 | 84 | return false; |
85 | 85 | break; |
86 | 86 | case 400 : |
87 | 87 | // You may want to fall through here and read the specific XML error |
88 | - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400. |
|
88 | + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400. |
|
89 | 89 | That means: Bad request. The parameters passed to the service did not match as expected. |
90 | 90 | The exact error is returned in the XML response.' ); |
91 | 91 | return false; |
92 | 92 | break; |
93 | 93 | default: |
94 | - error_log( 'Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: ' . $status_code [0] . " Request " . $request ); |
|
94 | + error_log('Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: '.$status_code [0]." Request ".$request); |
|
95 | 95 | return false; |
96 | 96 | } |
97 | 97 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | /** |
100 | 100 | * Gets a string from a boolean attribute |
101 | 101 | * @param string $attribute Name of the attribute |
102 | - * @param mixed $voidReturn What to return if the value is not defined |
|
102 | + * @param string $voidReturn What to return if the value is not defined |
|
103 | 103 | * @return string The boolean value expressed as string ('true' or 'false') |
104 | 104 | */ |
105 | 105 | public function getString($attribute, $voidReturn = false) |
@@ -40,11 +40,19 @@ |
||
40 | 40 | return isset($_GET[$key]) ? $_GET[$key] : $default; |
41 | 41 | } |
42 | 42 | |
43 | + /** |
|
44 | + * @param string $key |
|
45 | + * |
|
46 | + * @return string |
|
47 | + */ |
|
43 | 48 | public static function server($key, $default = '') |
44 | 49 | { |
45 | 50 | return isset($_SERVER[$key]) ? $_SERVER[$key] : $default; |
46 | 51 | } |
47 | 52 | |
53 | + /** |
|
54 | + * @param string $name |
|
55 | + */ |
|
48 | 56 | public static function get_lang($name) |
49 | 57 | { |
50 | 58 | return SearchCoursePlugin::create()->get_lang($name); |
@@ -108,8 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | function run() |
110 | 110 | { |
111 | - if (!$this->accept()) |
|
112 | - { |
|
111 | + if (!$this->accept()) { |
|
113 | 112 | return; |
114 | 113 | } |
115 | 114 | $this->display_header(); |
@@ -120,21 +119,15 @@ discard block |
||
120 | 119 | $action = self::get('action'); |
121 | 120 | |
122 | 121 | $has_content = !empty($search_term) || !empty($action); |
123 | - if ($has_content) |
|
124 | - { |
|
122 | + if ($has_content) { |
|
125 | 123 | echo '<div class="list">'; |
126 | - } |
|
127 | - else |
|
128 | - { |
|
124 | + } else { |
|
129 | 125 | echo '<div>'; |
130 | 126 | } |
131 | 127 | |
132 | - if (RegisterCourseWidget::factory()->run()) |
|
133 | - { |
|
128 | + if (RegisterCourseWidget::factory()->run()) { |
|
134 | 129 | $result = true; |
135 | - } |
|
136 | - else |
|
137 | - { |
|
130 | + } else { |
|
138 | 131 | $result = $this->action_display(); |
139 | 132 | } |
140 | 133 | |
@@ -148,8 +141,7 @@ discard block |
||
148 | 141 | { |
149 | 142 | $self = $_SERVER['PHP_SELF']; |
150 | 143 | $parameters = array(); |
151 | - if ($action) |
|
152 | - { |
|
144 | + if ($action) { |
|
153 | 145 | $parameters[self::PARAM_ACTION] = $action; |
154 | 146 | } |
155 | 147 | $parameters = implode('&', $parameters); |
@@ -165,8 +157,7 @@ discard block |
||
165 | 157 | global $charset; |
166 | 158 | |
167 | 159 | $search_term = self::post('search_term'); |
168 | - if ($search_term) |
|
169 | - { |
|
160 | + if ($search_term) { |
|
170 | 161 | $search_result_for_label = self::get_lang('SearchResultsFor'); |
171 | 162 | $search_term_html = htmlentities($search_term, ENT_QUOTES, $charset); |
172 | 163 | echo "<h5>$search_result_for_label $search_term_html</h5>"; |
@@ -275,8 +266,7 @@ discard block |
||
275 | 266 | |
276 | 267 | //Already subscribed |
277 | 268 | $code = $current_course['code']; |
278 | - if (isset($user_courses[$code])) |
|
279 | - { |
|
269 | + if (isset($user_courses[$code])) { |
|
280 | 270 | echo self::get_lang('AlreadySubscribed'); |
281 | 271 | return false; |
282 | 272 | } |
@@ -296,8 +286,7 @@ discard block |
||
296 | 286 | EOT; |
297 | 287 | |
298 | 288 | $search_term = $this->post('search_term'); |
299 | - if ($search_term) |
|
300 | - { |
|
289 | + if ($search_term) { |
|
301 | 290 | $search_term = Security::remove_XSS($search_term); |
302 | 291 | echo <<<EOT |
303 | 292 | <input type="hidden" name="search_course" value="1" /> |
@@ -324,19 +313,15 @@ discard block |
||
324 | 313 | */ |
325 | 314 | function retrieve_courses($search_term) |
326 | 315 | { |
327 | - if (empty($search_term)) |
|
328 | - { |
|
316 | + if (empty($search_term)) { |
|
329 | 317 | return array(); |
330 | 318 | } |
331 | 319 | $search_term = Database::escape_string($search_term); |
332 | 320 | $course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
333 | 321 | |
334 | - if (api_is_anonymous()) |
|
335 | - { |
|
322 | + if (api_is_anonymous()) { |
|
336 | 323 | $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD; |
337 | - } |
|
338 | - else |
|
339 | - { |
|
324 | + } else { |
|
340 | 325 | $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD . ' OR '; |
341 | 326 | $course_fiter .= 'visibility = ' . COURSE_VISIBILITY_OPEN_PLATFORM . ' OR '; |
342 | 327 | $course_fiter .= '(visibility = ' . COURSE_VISIBILITY_REGISTERED . ' AND subscribe = 1)'; |
@@ -374,8 +359,7 @@ discard block |
||
374 | 359 | */ |
375 | 360 | function retrieve_user_courses($user_id = null) |
376 | 361 | { |
377 | - if (is_null($user_id)) |
|
378 | - { |
|
362 | + if (is_null($user_id)) { |
|
379 | 363 | global $_user; |
380 | 364 | $user_id = $_user['user_id']; |
381 | 365 | } |
@@ -423,8 +407,7 @@ discard block |
||
423 | 407 | */ |
424 | 408 | function filter_out_user_courses($courses) |
425 | 409 | { |
426 | - if (empty($courses)) |
|
427 | - { |
|
410 | + if (empty($courses)) { |
|
428 | 411 | return $courses; |
429 | 412 | } |
430 | 413 | |
@@ -432,8 +415,7 @@ discard block |
||
432 | 415 | $user_id = $_user['user_id']; |
433 | 416 | |
434 | 417 | $user_courses = $this->retrieve_user_courses($user_id); |
435 | - foreach ($user_courses as $key => $value) |
|
436 | - { |
|
418 | + foreach ($user_courses as $key => $value) { |
|
437 | 419 | unset($courses[$key]); |
438 | 420 | } |
439 | 421 | return $courses; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | <div class="well course_search"> |
185 | 185 | <div class="menusection"> |
186 | 186 | <h4>$search_course_label</h4> |
187 | -EOT; |
|
187 | +eot; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | function display_footer() |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | <input type="text" name="search_term" class="span2" value="$search_term" /> |
210 | 210 | <input class="btn btn-default" type="submit" value="$search_label" /> |
211 | 211 | </form> |
212 | -EOT; |
|
212 | +eot; |
|
213 | 213 | echo $form; |
214 | 214 | } |
215 | 215 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | <form action="$self?action=subscribe" method="post"> |
294 | 294 | <input type="hidden" name="sec_token" value="$stok" /> |
295 | 295 | <input type="hidden" name="subscribe" value="$code" /> |
296 | -EOT; |
|
296 | +eot; |
|
297 | 297 | |
298 | 298 | $search_term = $this->post('search_term'); |
299 | 299 | if ($search_term) |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | echo <<<EOT |
303 | 303 | <input type="hidden" name="search_course" value="1" /> |
304 | 304 | <input type="hidden" name="search_term" value="$search_term" /> |
305 | -EOT; |
|
305 | +eot; |
|
306 | 306 | } |
307 | 307 | echo '<input type="image" name="unsub" src="'.Display::returnIconPath('enroll.gif').'" alt="'.get_lang('Subscribe').'" /> |
308 | 308 | '.get_lang('Subscribe').' |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | SELECT * FROM $course_table |
347 | 347 | WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%') |
348 | 348 | ORDER BY title, visual_code ASC |
349 | -EOT; |
|
349 | +eot; |
|
350 | 350 | |
351 | 351 | $result = array(); |
352 | 352 | $resultset = Database::query($sql); |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $url = self::server('REQUEST_URI'); |
61 | 61 | $url = explode('?', $url); |
62 | 62 | $url = reset($url); |
63 | - $url = self::server('SERVER_NAME') . $url; |
|
63 | + $url = self::server('SERVER_NAME').$url; |
|
64 | 64 | |
65 | 65 | $root = api_get_path('WEB_PATH'); |
66 | 66 | $root = str_replace('https://', '', $root); |
67 | 67 | $root = str_replace('http://', '', $root); |
68 | - $index_url = $root . 'index.php'; |
|
68 | + $index_url = $root.'index.php'; |
|
69 | 69 | |
70 | 70 | return $url == $index_url || $url == $root; |
71 | 71 | } |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | $url = self::server('REQUEST_URI'); |
81 | 81 | $url = explode('?', $url); |
82 | 82 | $url = reset($url); |
83 | - $url = self::server('SERVER_NAME') . $url; |
|
83 | + $url = self::server('SERVER_NAME').$url; |
|
84 | 84 | |
85 | 85 | $root = api_get_path('WEB_PATH'); |
86 | 86 | $root = str_replace('https://', '', $root); |
87 | 87 | $root = str_replace('http://', '', $root); |
88 | - $index_url = $root . 'user_portal.php'; |
|
88 | + $index_url = $root.'user_portal.php'; |
|
89 | 89 | |
90 | 90 | return $url == $index_url || $url == $root; |
91 | 91 | } |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $parameters[self::PARAM_ACTION] = $action; |
154 | 154 | } |
155 | 155 | $parameters = implode('&', $parameters); |
156 | - $parameters = $parameters ? '?' . $parameters : ''; |
|
157 | - return $self . $parameters; |
|
156 | + $parameters = $parameters ? '?'.$parameters : ''; |
|
157 | + return $self.$parameters; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $details = implode(' - ', $details); |
242 | 242 | $title = $course['title']; |
243 | 243 | |
244 | - $href = api_get_path(WEB_COURSE_PATH).$course['code'] .'/index.php'; |
|
245 | - echo '<tr><td><b><a href="' . $href . '">' . "$title</a></b><br/>$details</td><td>"; |
|
244 | + $href = api_get_path(WEB_COURSE_PATH).$course['code'].'/index.php'; |
|
245 | + echo '<tr><td><b><a href="'.$href.'">'."$title</a></b><br/>$details</td><td>"; |
|
246 | 246 | if (!api_is_anonymous()) { |
247 | 247 | if ($course['registration_code']) { |
248 | 248 | Display::display_icon( |
@@ -333,13 +333,13 @@ discard block |
||
333 | 333 | |
334 | 334 | if (api_is_anonymous()) |
335 | 335 | { |
336 | - $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD; |
|
336 | + $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD; |
|
337 | 337 | } |
338 | 338 | else |
339 | 339 | { |
340 | - $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD . ' OR '; |
|
341 | - $course_fiter .= 'visibility = ' . COURSE_VISIBILITY_OPEN_PLATFORM . ' OR '; |
|
342 | - $course_fiter .= '(visibility = ' . COURSE_VISIBILITY_REGISTERED . ' AND subscribe = 1)'; |
|
340 | + $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD.' OR '; |
|
341 | + $course_fiter .= 'visibility = '.COURSE_VISIBILITY_OPEN_PLATFORM.' OR '; |
|
342 | + $course_fiter .= '(visibility = '.COURSE_VISIBILITY_REGISTERED.' AND subscribe = 1)'; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | $sql = <<<EOT |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $this->time = $this->utime(); |
32 | 32 | $this->debug = (isset($opts['debug']) && $opts['debug'] ? true : false); |
33 | 33 | $this->timeout = (isset($opts['timeout']) ? $opts['timeout'] : 0); |
34 | - $this->netVolumesSessionKey = !empty($opts['netVolumesSessionKey'])? $opts['netVolumesSessionKey'] : 'elFinderNetVolumes'; |
|
34 | + $this->netVolumesSessionKey = !empty($opts['netVolumesSessionKey']) ? $opts['netVolumesSessionKey'] : 'elFinderNetVolumes'; |
|
35 | 35 | $this->callbackWindowURL = (isset($opts['callbackWindowURL']) ? $opts['callbackWindowURL'] : ''); |
36 | 36 | |
37 | 37 | // setlocale and global locale regists to elFinder::locale |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | $_reqCmd = isset($_req['cmd']) ? $_req['cmd'] : ''; |
47 | 47 | foreach ($opts['bind'] as $cmd => $handlers) { |
48 | 48 | $doRegist = (strpos($cmd, '*') !== false); |
49 | - if (! $doRegist) { |
|
49 | + if (!$doRegist) { |
|
50 | 50 | $_getcmd = create_function('$cmd', 'list($ret) = explode(\'.\', $cmd);return trim($ret);'); |
51 | 51 | $doRegist = ($_reqCmd && in_array($_reqCmd, array_map($_getcmd, explode(' ', $cmd)))); |
52 | 52 | } |
53 | 53 | if ($doRegist) { |
54 | - if (! is_array($handlers) || is_object($handlers[0])) { |
|
54 | + if (!is_array($handlers) || is_object($handlers[0])) { |
|
55 | 55 | $handlers = array($handlers); |
56 | 56 | } |
57 | - foreach($handlers as $handler) { |
|
57 | + foreach ($handlers as $handler) { |
|
58 | 58 | if ($handler) { |
59 | 59 | if (is_string($handler) && strpos($handler, '.')) { |
60 | 60 | list($_domain, $_name, $_method) = array_pad(explode('.', $handler), 3, ''); |
61 | 61 | if (strcasecmp($_domain, 'plugin') === 0) { |
62 | - if ($plugin = $this->getPluginInstance($_name, isset($opts['plugin'][$_name])? $opts['plugin'][$_name] : array()) |
|
62 | + if ($plugin = $this->getPluginInstance($_name, isset($opts['plugin'][$_name]) ? $opts['plugin'][$_name] : array()) |
|
63 | 63 | and method_exists($plugin, $_method)) { |
64 | 64 | $this->bind($cmd, array($plugin, $_method)); |
65 | 65 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | $resubscriptionLimit = Resubscription::create()->get('resubscription_limit'); |
33 | 33 | |
34 | - // Initialize variables as a calendar year by default |
|
34 | + // Initialize variables as a calendar year by default |
|
35 | 35 | $limitDateFormat = 'Y-01-01'; |
36 | 36 | $limitDate = gmdate($limitDateFormat); |
37 | 37 | $resubscriptionOffset = "1 year"; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Limit session resubscription when a Chamilo user is resubscribed to a session |
25 | - * @param HookCreateUserEventInterface $hook The hook |
|
25 | + * @param HookResubscribeEventInterface $hook The hook |
|
26 | 26 | */ |
27 | 27 | public function hookResubscribe(HookResubscribeEventInterface $hook) |
28 | 28 | { |