@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | use Symfony\Component\Console\Helper\HelperSet; |
21 | 21 | use Doctrine\DBAL\Types\Type; |
22 | 22 | |
23 | -(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php'; |
|
23 | +(@include_once __DIR__.'/../vendor/autoload.php') || @include_once __DIR__.'/../../../autoload.php'; |
|
24 | 24 | |
25 | -$directories = array(getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config'); |
|
25 | +$directories = array(getcwd(), getcwd().DIRECTORY_SEPARATOR.'config'); |
|
26 | 26 | |
27 | 27 | $configFile = null; |
28 | 28 | foreach ($directories as $directory) { |
29 | - $configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php'; |
|
29 | + $configFile = $directory.DIRECTORY_SEPARATOR.'cli-config.php'; |
|
30 | 30 | |
31 | 31 | if (file_exists($configFile)) { |
32 | 32 | break; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if ( ! file_exists($configFile)) { |
|
36 | +if (!file_exists($configFile)) { |
|
37 | 37 | ConsoleRunner::printCliConfigTemplate(); |
38 | 38 | exit(1); |
39 | 39 | } |
40 | 40 | |
41 | -if ( ! is_readable($configFile)) { |
|
42 | - echo 'Configuration file [' . $configFile . '] does not have read permission.' . "\n"; |
|
41 | +if (!is_readable($configFile)) { |
|
42 | + echo 'Configuration file ['.$configFile.'] does not have read permission.'."\n"; |
|
43 | 43 | exit(1); |
44 | 44 | } |
45 | 45 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $helperSet = require $configFile; |
67 | 67 | |
68 | -if ( ! ($helperSet instanceof HelperSet)) { |
|
68 | +if (!($helperSet instanceof HelperSet)) { |
|
69 | 69 | foreach ($GLOBALS as $helperSetCandidate) { |
70 | 70 | if ($helperSetCandidate instanceof HelperSet) { |
71 | 71 | $helperSet = $helperSetCandidate; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | -require_once __DIR__ . '/../../main/inc/global.inc.php'; |
|
4 | +require_once __DIR__.'/../../main/inc/global.inc.php'; |
|
5 | 5 | require_once __DIR__.'/CourseBlockPlugin.php'; |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/config.php'; |
|
3 | +require_once __DIR__.'/config.php'; |
|
4 | 4 | $plugin_info = CourseBlockPlugin::create()->get_info(); |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : ''; |
113 | 113 | if ($vid) { |
114 | 114 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
115 | - $vhost = (object)array_pop($vhosts); |
|
115 | + $vhost = (object) array_pop($vhosts); |
|
116 | 116 | } else { |
117 | - $vhost = (object)$_configuration; |
|
117 | + $vhost = (object) $_configuration; |
|
118 | 118 | $vhost->slug = Virtual::getSlugFromUrl($vhost->root_web); |
119 | 119 | $vhost->id = 0; |
120 | 120 | } |
@@ -302,16 +302,16 @@ discard block |
||
302 | 302 | case 'clearcache': |
303 | 303 | // Removes cache directory. |
304 | 304 | if (empty($automation)) { |
305 | - if (array_key_exists('vids', $_REQUEST)) { |
|
305 | + if (array_key_exists('vids', $_REQUEST)) { |
|
306 | 306 | $toclear = Database::select('*', 'vchamilo', array('where' => array("id IN ('$vidlist')" => array()))); |
307 | 307 | } else { |
308 | 308 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : 0; |
309 | 309 | if ($vid) { |
310 | 310 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
311 | - $vhost = (object)array_pop($vhosts); |
|
311 | + $vhost = (object) array_pop($vhosts); |
|
312 | 312 | $toclear[$vhost->id] = $vhost; |
313 | 313 | } else { |
314 | - $toclear[0] = (object)$_configuration; |
|
314 | + $toclear[0] = (object) $_configuration; |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | } else { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | //$uploadPath = Virtual::getConfig('vchamilo', 'upload_real_root'); |
335 | 335 | |
336 | 336 | // Get instance archive |
337 | - $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array)$instance); |
|
337 | + $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array) $instance); |
|
338 | 338 | $templatepath = $archivePath.'/'.$instance['slug'].'/twig'; |
339 | 339 | Display::addFlash(Display::return_message("Deleting cache $templatepath \n")); |
340 | 340 | removeDir($templatepath); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $dataroot = $_REQUEST['dataroot']; |
21 | 21 | |
22 | 22 | $absalternatecourse = Virtual::getConfig('vchamilo', 'course_real_root'); |
23 | -if (!empty($absalternatecourse)){ |
|
23 | +if (!empty($absalternatecourse)) { |
|
24 | 24 | // this is the relocated case |
25 | 25 | $coursedir = str_replace('//', '/', $absalternatecourse.'/'.$dataroot); |
26 | 26 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return $this->_form->display(); |
45 | 45 | } |
46 | 46 | |
47 | - public function definition_after_data(){ |
|
47 | + public function definition_after_data() { |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function return_form() |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * @param bool $slashed true means return data with addslashes applied |
65 | 65 | * @return object submitted data; NULL if not valid or not submitted |
66 | 66 | */ |
67 | - public function get_data($slashed=true) |
|
67 | + public function get_data($slashed = true) |
|
68 | 68 | { |
69 | - $cform =& $this->_form; |
|
69 | + $cform = & $this->_form; |
|
70 | 70 | |
71 | 71 | if ($this->is_submitted() and $this->is_validated()) { |
72 | 72 | $data = $cform->exportValues(null, $slashed); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if (empty($data)) { |
75 | 75 | return null; |
76 | 76 | } else { |
77 | - return (object)$data; |
|
77 | + return (object) $data; |
|
78 | 78 | } |
79 | 79 | } else { |
80 | 80 | return null; |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @param bool $slashed true means return data with addslashes applied |
88 | 88 | * @return object submitted data; NULL if not submitted |
89 | 89 | */ |
90 | - public function get_submitted_data($slashed=true) |
|
90 | + public function get_submitted_data($slashed = true) |
|
91 | 91 | { |
92 | - $cform =& $this->_form; |
|
92 | + $cform = & $this->_form; |
|
93 | 93 | |
94 | 94 | if ($this->is_submitted()) { |
95 | 95 | $data = $cform->exportValues(null, $slashed); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (empty($data)) { |
98 | 98 | return null; |
99 | 99 | } else { |
100 | - return (object)$data; |
|
100 | + return (object) $data; |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | return null; |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function is_cancelled() |
123 | 123 | { |
124 | - $cform =& $this->_form; |
|
125 | - if ($cform->isSubmitted()){ |
|
126 | - foreach ($cform->_cancelButtons as $cancelbutton){ |
|
127 | - if (optional_param($cancelbutton, 0, PARAM_RAW)){ |
|
124 | + $cform = & $this->_form; |
|
125 | + if ($cform->isSubmitted()) { |
|
126 | + foreach ($cform->_cancelButtons as $cancelbutton) { |
|
127 | + if (optional_param($cancelbutton, 0, PARAM_RAW)) { |
|
128 | 128 | return true; |
129 | 129 | } |
130 | 130 | } |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | * |
169 | 169 | * @return bool true if form data valid |
170 | 170 | */ |
171 | - public function validate_defined_fields($validateonnosubmit=false) |
|
171 | + public function validate_defined_fields($validateonnosubmit = false) |
|
172 | 172 | { |
173 | 173 | static $validated = null; // one validation is enough |
174 | - $cform =& $this->_form; |
|
174 | + $cform = & $this->_form; |
|
175 | 175 | |
176 | - if ($this->no_submit_button_pressed() && empty($validateonnosubmit)){ |
|
176 | + if ($this->no_submit_button_pressed() && empty($validateonnosubmit)) { |
|
177 | 177 | return false; |
178 | 178 | } elseif ($validated === null) { |
179 | 179 | $internal_val = $cform->validate(); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $data = $cform->exportValues(null, true); |
193 | 193 | $chamilo_val = $this->validation($data, $files); |
194 | - if ((is_array($chamilo_val) && count($chamilo_val)!==0)) { |
|
194 | + if ((is_array($chamilo_val) && count($chamilo_val) !== 0)) { |
|
195 | 195 | // non-empty array means errors |
196 | 196 | foreach ($chamilo_val as $element => $msg) { |
197 | 197 | $cform->setElementError($element, $msg); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | return $nosubmit; |
218 | 218 | } |
219 | 219 | |
220 | - $cform =& $this->_form; |
|
220 | + $cform = & $this->_form; |
|
221 | 221 | $nosubmit = false; |
222 | 222 | if (!$this->is_submitted()) { |
223 | 223 | return false; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | public function set_data($default_values, $slashed = false) |
247 | 247 | { |
248 | 248 | if (is_object($default_values)) { |
249 | - $default_values = (array)$default_values; |
|
249 | + $default_values = (array) $default_values; |
|
250 | 250 | } |
251 | 251 | $filter = $slashed ? 'stripslashes' : NULL; |
252 | 252 | $this->_form->setDefaults($default_values, $filter); |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | } |
267 | 267 | |
268 | 268 | $errors = array(); |
269 | - $mform =& $this->_form; |
|
269 | + $mform = & $this->_form; |
|
270 | 270 | |
271 | 271 | // check the files |
272 | 272 | $status = $this->_upload_manager->preprocess_files(); |
273 | 273 | |
274 | 274 | // now check that we really want each file |
275 | 275 | foreach ($_FILES as $elname => $file) { |
276 | - if ($mform->elementExists($elname) and $mform->getElementType($elname)=='file') { |
|
276 | + if ($mform->elementExists($elname) and $mform->getElementType($elname) == 'file') { |
|
277 | 277 | $required = $mform->isElementRequired($elname); |
278 | 278 | if (!empty($this->_upload_manager->files[$elname]['uploadlog']) && |
279 | 279 | empty($this->_upload_manager->files[$elname]['clear']) |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | * @param string $location |
7 | 7 | * |
8 | 8 | */ |
9 | -function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null){ |
|
9 | +function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null) { |
|
10 | 10 | global $_configuration; |
11 | 11 | |
12 | 12 | $vnodes = array(); |
13 | 13 | |
14 | - if (empty($nodelistlocation)){ |
|
14 | + if (empty($nodelistlocation)) { |
|
15 | 15 | $nodelistlocation = $_configuratioh['root_sys'].'/plugin/vchamilo/nodelist.csv'; |
16 | 16 | } |
17 | 17 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // Jump any empty or comment line |
71 | 71 | $text = fgets($fp, 1024); |
72 | 72 | $i = 0; |
73 | - while(vchamilo_is_empty_line_or_format($text, $i == 0)){ |
|
73 | + while (vchamilo_is_empty_line_or_format($text, $i == 0)) { |
|
74 | 74 | $text = fgets($fp, 1024); |
75 | 75 | $i++; |
76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // Check for valid field names |
81 | 81 | foreach ($headers as $h) { |
82 | 82 | $header[] = trim($h); |
83 | - $patternized = implode('|', $patterns) . "\\d+"; |
|
83 | + $patternized = implode('|', $patterns)."\\d+"; |
|
84 | 84 | $metapattern = implode('|', $metas); |
85 | 85 | if (!(isset($required[$h]) || |
86 | 86 | isset($optionalDefaults[$h]) || |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $linenum = 2; // Since header is line 1. |
110 | 110 | |
111 | 111 | // Take some from admin profile, other fixed by hardcoded defaults. |
112 | - while (!feof ($fp)) { |
|
112 | + while (!feof($fp)) { |
|
113 | 113 | |
114 | 114 | // Make a new base record. |
115 | 115 | $vnode = new StdClass(); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @param bool $casesensitive true if options are case sensitive |
197 | 197 | * @return string entered text |
198 | 198 | */ |
199 | -function cli_input($prompt, $default='', array $options=null, $casesensitiveoptions=false) { |
|
199 | +function cli_input($prompt, $default = '', array $options = null, $casesensitiveoptions = false) { |
|
200 | 200 | echo $prompt; |
201 | 201 | echo "\n: "; |
202 | 202 | $input = fread(STDIN, 2048); |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | * @param array $shortmapping array describing mapping of short to long style options ex:('h'=>'help', 'v'=>'verbose') |
223 | 223 | * @return array array of arrays, options, unrecognised as optionlongname=>value |
224 | 224 | */ |
225 | -function cli_get_params(array $longoptions, array $shortmapping=null) { |
|
226 | - $shortmapping = (array)$shortmapping; |
|
225 | +function cli_get_params(array $longoptions, array $shortmapping = null) { |
|
226 | + $shortmapping = (array) $shortmapping; |
|
227 | 227 | $options = array(); |
228 | 228 | $unrecognized = array(); |
229 | 229 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @param bool $return false means print, true return as string |
293 | 293 | * @return mixed void or string |
294 | 294 | */ |
295 | -function cli_separator($return=false) { |
|
295 | +function cli_separator($return = false) { |
|
296 | 296 | $separator = str_repeat('-', 79)."\n"; |
297 | 297 | if ($return) { |
298 | 298 | return $separator; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @param bool $return false means print, true return as string |
308 | 308 | * @return mixed void or string |
309 | 309 | */ |
310 | -function cli_heading($string, $return=false) { |
|
310 | +function cli_heading($string, $return = false) { |
|
311 | 311 | $string = "== $string ==\n"; |
312 | 312 | if ($return) { |
313 | 313 | return $string; |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | global $VCRON; |
31 | 31 | |
32 | 32 | $VCRON = new stdClass(); |
33 | -$VCRON->ACTIVATION = 'cli'; // choose how individual cron are launched, 'cli' or 'web' |
|
34 | -$VCRON->STRATEGY = ROUND_ROBIN ; // choose vcron rotation mode |
|
35 | -$VCRON->PERIOD = 15 * MINSECS ; // used if LOWEST_POSSIBLE_GAP to setup the max gap |
|
36 | -$VCRON->TIMEOUT = 300; // time out for CURL call to effective cron |
|
33 | +$VCRON->ACTIVATION = 'cli'; // choose how individual cron are launched, 'cli' or 'web' |
|
34 | +$VCRON->STRATEGY = ROUND_ROBIN; // choose vcron rotation mode |
|
35 | +$VCRON->PERIOD = 15 * MINSECS; // used if LOWEST_POSSIBLE_GAP to setup the max gap |
|
36 | +$VCRON->TIMEOUT = 300; // time out for CURL call to effective cron |
|
37 | 37 | // $VCRON->TRACE = $_configuration['root_sys'].'plugin/vchamilo/log/vcrontrace.log'; // Trace file where to collect cron outputs |
38 | -$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log'; // Trace file where to collect cron outputs |
|
39 | -$VCRON->TRACE_ENABLE = true; // enables tracing |
|
38 | +$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log'; // Trace file where to collect cron outputs |
|
39 | +$VCRON->TRACE_ENABLE = true; // enables tracing |
|
40 | 40 | |
41 | 41 | if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/log')) { |
42 | 42 | mkdir($_configuration['root_sys'].'plugin/vchamilo/log', 0777, true); |
@@ -97,32 +97,32 @@ discard block |
||
97 | 97 | $timestamp_receive = time(); |
98 | 98 | |
99 | 99 | if ($rawresponse === false) { |
100 | - $error = curl_errno($ch) .':'. curl_error($ch); |
|
101 | - if ($VCRON->TRACE_ENABLE){ |
|
102 | - if ($CRONTRACE){ |
|
103 | - fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" ); |
|
100 | + $error = curl_errno($ch).':'.curl_error($ch); |
|
101 | + if ($VCRON->TRACE_ENABLE) { |
|
102 | + if ($CRONTRACE) { |
|
103 | + fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n"); |
|
104 | 104 | fputs($CRONTRACE, "VCron Error : $error \n"); |
105 | - fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" ); |
|
105 | + fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n"); |
|
106 | 106 | fclose($CRONTRACE); |
107 | 107 | } |
108 | 108 | } |
109 | - echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" ); |
|
109 | + echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n"); |
|
110 | 110 | echo("VCron Error : $error \n"); |
111 | - echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" ); |
|
111 | + echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n"); |
|
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | 115 | if ($VCRON->TRACE_ENABLE) { |
116 | 116 | if ($CRONTRACE) { |
117 | - fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n" ); |
|
117 | + fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n"); |
|
118 | 118 | fputs($CRONTRACE, $rawresponse."\n"); |
119 | - fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" ); |
|
119 | + fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n"); |
|
120 | 120 | fclose($CRONTRACE); |
121 | 121 | } |
122 | 122 | } |
123 | - echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" ); |
|
123 | + echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n"); |
|
124 | 124 | echo($rawresponse."\n"); |
125 | - echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" ); |
|
125 | + echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n"); |
|
126 | 126 | $vhost->lastcrongap = time() - $vhost->lastcron; |
127 | 127 | $vhost->lastcron = $timestamp_send; |
128 | 128 | $vhost->croncount++; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $vhostid = $vhost->id; |
131 | 131 | unset($vhost->id); |
132 | 132 | |
133 | - Database::update('vchamilo', (array)$vhost, array('id = ?' => $vhostid)); |
|
133 | + Database::update('vchamilo', (array) $vhost, array('id = ?' => $vhostid)); |
|
134 | 134 | |
135 | 135 | } |
136 | 136 | |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | |
155 | 155 | if ($VCRON->TRACE_ENABLE) { |
156 | 156 | if ($CRONTRACE) { |
157 | - fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n" ); |
|
157 | + fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n"); |
|
158 | 158 | fputs($CRONTRACE, $rawresponse."\n"); |
159 | - fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" ); |
|
159 | + fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n"); |
|
160 | 160 | fclose($CRONTRACE); |
161 | 161 | } |
162 | 162 | } |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | $match = trim($match); |
210 | 210 | |
211 | 211 | // try for IP match (Left side) |
212 | - $lhs = substr($host,0,strlen($match)); |
|
213 | - if (strcasecmp($match,$lhs)==0) { |
|
212 | + $lhs = substr($host, 0, strlen($match)); |
|
213 | + if (strcasecmp($match, $lhs) == 0) { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | |
217 | 217 | // try for host match (Right side) |
218 | - $rhs = substr($host,-strlen($match)); |
|
219 | - if (strcasecmp($match,$rhs)==0) { |
|
218 | + $rhs = substr($host, -strlen($match)); |
|
219 | + if (strcasecmp($match, $rhs) == 0) { |
|
220 | 220 | return true; |
221 | 221 | } |
222 | 222 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | // Main execution sequence |
229 | 229 | |
230 | -if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')){ |
|
230 | +if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')) { |
|
231 | 231 | die("Nothing to do. No Vhosts"); |
232 | 232 | } |
233 | 233 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | if ($VCRON->STRATEGY == ROUND_ROBIN) { |
241 | 241 | $rr = 0; |
242 | 242 | foreach ($allvhosts as $vhostassoc) { |
243 | - $vhost = (object)$vhostassoc; |
|
243 | + $vhost = (object) $vhostassoc; |
|
244 | 244 | if ($rr == 1) { |
245 | 245 | api_set_setting('vchamilo_cron_lasthost', $vhost->id); |
246 | 246 | echo("Round Robin : ".$vhost->root_web."\n"); |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | |
253 | 253 | die('Done.'); |
254 | 254 | } |
255 | - if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')){ |
|
255 | + if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')) { |
|
256 | 256 | $rr = 1; // take next one |
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
260 | 260 | // We were at last. Loop back and take first. |
261 | - $firsthost = (object)$allvhosts[0]; |
|
261 | + $firsthost = (object) $allvhosts[0]; |
|
262 | 262 | api_set_setting('vchamilo_cron_lasthost', $firsthost->id, 'vchamilo'); |
263 | 263 | echo("Round Robin : ".$firsthost->root_web."\n"); |
264 | 264 | if ($VCRON->ACTIVATION == 'cli') { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $hostsperturn = max(1, $VCRON->PERIOD / api_get_setting('vcrontickperiod', 'vchamilo') * count($allvhosts)); |
278 | 278 | $i = 0; |
279 | 279 | foreach ($allvhosts as $vhostassoc) { |
280 | - $vhost = (object)$vhostassoc; |
|
280 | + $vhost = (object) $vhostassoc; |
|
281 | 281 | if ((time() - $vhost->lastcron) > $VCRON->PERIOD) { |
282 | 282 | if ($VCRON->ACTIVATION == 'cli') { |
283 | 283 | exec_vhost_cron($vhost); |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | |
37 | 37 | $userInfo = api_get_user_info($sale['user_id']); |
38 | 38 | |
39 | - $html = '<h2>' . $sale['product_name'] .'</h2>'; |
|
39 | + $html = '<h2>'.$sale['product_name'].'</h2>'; |
|
40 | 40 | $html .= '<div class="row">'; |
41 | 41 | $html .= '<div class="col-sm-6 col-md-6">'; |
42 | 42 | $html .= '<ul>'; |
43 | - $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>'; |
|
44 | - $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>'; |
|
45 | - $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>'; |
|
46 | - $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>'; |
|
47 | - $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>'; |
|
48 | - $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>'; |
|
43 | + $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>'; |
|
44 | + $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>'; |
|
45 | + $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>'; |
|
46 | + $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>'; |
|
47 | + $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>'; |
|
48 | + $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>'; |
|
49 | 49 | $html .= '</ul>'; |
50 | 50 | $html .= '</div>'; |
51 | 51 | $html .= '<div class="col-sm-6 col-md-6">'; |
52 | - $html .= '<img class="thumbnail" src="'. $productImage .'" >'; |
|
52 | + $html .= '<img class="thumbnail" src="'.$productImage.'" >'; |
|
53 | 53 | $html .= '</div>'; |
54 | 54 | $html .= '</div>'; |
55 | 55 | echo $html; |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | $html = '<div class="row">' |
90 | 90 | . '<p>' |
91 | 91 | . '<ul>' |
92 | - . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>' |
|
93 | - . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>' |
|
94 | - . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>' |
|
92 | + . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>' |
|
93 | + . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>' |
|
94 | + . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>' |
|
95 | 95 | . '</ul>' |
96 | 96 | . '</p>'; |
97 | 97 | $html .= '</div>'; |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | |
128 | 128 | $isoCode = $currentCurrency['iso_code']; |
129 | 129 | |
130 | - $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>'; |
|
130 | + $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>'; |
|
131 | 131 | $html .= '' |
132 | 132 | . '<p>' |
133 | 133 | . '<ul>' |
134 | - . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>' |
|
135 | - . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>' |
|
134 | + . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>' |
|
135 | + . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>' |
|
136 | 136 | . '</ul>' |
137 | 137 | . '</p>'; |
138 | - $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>'; |
|
138 | + $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>'; |
|
139 | 139 | $html .= '<br /><br />'; |
140 | 140 | $html .= '<div id="spinner" class="text-center"></div>'; |
141 | 141 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | echo Display::return_message(get_plugin_lang("PayoutSuccess", "BuyCoursesPlugin"), 'success', false); |
184 | 184 | } else { |
185 | - echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false); |
|
185 | + echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false); |
|
186 | 186 | } |
187 | 187 | break; |
188 | 188 |