@@ -41,7 +41,7 @@ |
||
41 | 41 | $glossary_all_data = implode('[|.|_|.|-|.|]', $glossary_all_data); |
42 | 42 | echo api_xml_http_response_encode($glossary_all_data); |
43 | 43 | } |
44 | -} elseif(isset($_POST['glossary_name'])) { |
|
44 | +} elseif (isset($_POST['glossary_name'])) { |
|
45 | 45 | $my_glossary_name = Security::remove_XSS($_POST['glossary_name']); |
46 | 46 | $my_glossary_name = api_convert_encoding($my_glossary_name, $charset, 'UTF-8'); |
47 | 47 | $my_glossary_name = trim($my_glossary_name); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $dataroot = $_REQUEST['dataroot']; |
24 | 24 | |
25 | 25 | $absalternatecourse = vchamilo_get_config('vchamilo', 'course_real_root'); |
26 | -if (!empty($absalternatecourse)){ |
|
26 | +if (!empty($absalternatecourse)) { |
|
27 | 27 | // this is the relocated case |
28 | 28 | $coursedir = str_replace('//', '/', $absalternatecourse.'/'.$dataroot); |
29 | 29 | } else { |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | echo "Chamilo Bulk Nodes Creation v.1.0\n"; |
14 | 14 | echo "=================================\n"; |
15 | 15 | require_once('../../../main/inc/global.inc.php'); |
16 | -require_once('clilib.php'); // cli only functions |
|
16 | +require_once('clilib.php'); // cli only functions |
|
17 | 17 | // Ensure errors are well explained |
18 | 18 | ini_set('debug_display', 1); |
19 | 19 | ini_set('debug_level', E_ALL); |
@@ -68,26 +68,26 @@ discard block |
||
68 | 68 | |
69 | 69 | if (!empty($options['config'])) { |
70 | 70 | echo "Loading config : ".$options['config']; |
71 | - if (!file_exists($options['config'])){ |
|
71 | + if (!file_exists($options['config'])) { |
|
72 | 72 | cli_error('Config file mentioned but not found'); |
73 | 73 | } |
74 | 74 | |
75 | 75 | $content = file($options['config']); |
76 | - foreach($content as $l) { |
|
76 | + foreach ($content as $l) { |
|
77 | 77 | if (preg_match('/^\s+$/', $l)) continue; // Empty lines. |
78 | 78 | if (preg_match('/^[#\/!;]/', $l)) continue; // Comments (any form). |
79 | 79 | if (preg_match('/^(.*?)=(.*)$/', $l, $matches)) { |
80 | - if (in_array($matches[1], $expectedoptions)){ |
|
80 | + if (in_array($matches[1], $expectedoptions)) { |
|
81 | 81 | $options[trim($matches[1])] = trim($matches[2]); |
82 | 82 | } |
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | -require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
88 | -require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
89 | -require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
90 | -require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
87 | +require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
88 | +require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
89 | +require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
90 | +require_once($_configuration['root_sys'].'/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
91 | 91 | |
92 | 92 | global $DB; |
93 | 93 | if ($options['verbose']) echo "building database manager\n"; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // Get main admin for further replacement. |
118 | 118 | $admin = $DB->get_record('user', array('username' => 'admin')); |
119 | 119 | |
120 | -foreach($nodes as $data) { |
|
120 | +foreach ($nodes as $data) { |
|
121 | 121 | |
122 | 122 | ctrace('Making node '.$data->root_web); |
123 | 123 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $settingrec->access_url = 1; |
164 | 164 | $settingrec->selected_value = $value; |
165 | 165 | ctrace("Setting up {$settingrec->variable}|{$settingrec->subkey} to $value\n"); |
166 | - if ($oldrec = $NDB->get_record('settings_current', array('variable' => $settingrec->variable, 'subkey' => $settingrec->subkey, 'type' => $settingrec->type))){ |
|
166 | + if ($oldrec = $NDB->get_record('settings_current', array('variable' => $settingrec->variable, 'subkey' => $settingrec->subkey, 'type' => $settingrec->type))) { |
|
167 | 167 | $settingrec->id = $oldrec->id; |
168 | 168 | $NDB->update_record('settings_current', $settingrec, 'id'); |
169 | 169 | } else { |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | if ($interactive) { |
210 | 210 | $input = readline("Continue (y/n|r) ?\n"); |
211 | - if ($input == 'r' || $input == 'R'){ |
|
211 | + if ($input == 'r' || $input == 'R') { |
|
212 | 212 | // do nothing, just continue |
213 | - } elseif ($input == 'n' || $input == 'N'){ |
|
213 | + } elseif ($input == 'n' || $input == 'N') { |
|
214 | 214 | echo "finishing\n"; |
215 | 215 | exit; |
216 | 216 | } |
@@ -74,8 +74,14 @@ discard block |
||
74 | 74 | |
75 | 75 | $content = file($options['config']); |
76 | 76 | foreach($content as $l) { |
77 | - if (preg_match('/^\s+$/', $l)) continue; // Empty lines. |
|
78 | - if (preg_match('/^[#\/!;]/', $l)) continue; // Comments (any form). |
|
77 | + if (preg_match('/^\s+$/', $l)) { |
|
78 | + continue; |
|
79 | + } |
|
80 | + // Empty lines. |
|
81 | + if (preg_match('/^[#\/!;]/', $l)) { |
|
82 | + continue; |
|
83 | + } |
|
84 | + // Comments (any form). |
|
79 | 85 | if (preg_match('/^(.*?)=(.*)$/', $l, $matches)) { |
80 | 86 | if (in_array($matches[1], $expectedoptions)){ |
81 | 87 | $options[trim($matches[1])] = trim($matches[2]); |
@@ -90,16 +96,22 @@ discard block |
||
90 | 96 | require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
91 | 97 | |
92 | 98 | global $DB; |
93 | -if ($options['verbose']) echo "building database manager\n"; |
|
99 | +if ($options['verbose']) { |
|
100 | + echo "building database manager\n"; |
|
101 | +} |
|
94 | 102 | $DB = new DatabaseManager(); |
95 | -if ($options['verbose']) echo "building plugin vchamilo\n"; |
|
103 | +if ($options['verbose']) { |
|
104 | + echo "building plugin vchamilo\n"; |
|
105 | +} |
|
96 | 106 | $plugininstance = VChamiloPlugin::create(); |
97 | 107 | |
98 | 108 | if (empty($options['nodes'])) { |
99 | 109 | cli_error('Missing node definition. Halt.'); |
100 | 110 | } |
101 | 111 | |
102 | -if ($options['verbose']) echo "parsing nodelist\n"; |
|
112 | +if ($options['verbose']) { |
|
113 | + echo "parsing nodelist\n"; |
|
114 | +} |
|
103 | 115 | $nodes = vchamilo_parse_csv_nodelist($options['nodes'], $plugininstance); |
104 | 116 | |
105 | 117 | if ($options['lint']) { |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | $CLI_VCHAMILO_PRECHECK = true; // force first config to be minimal |
24 | 24 | require(dirname(dirname(dirname(dirname(__FILE__)))).'/main/inc/conf/configuration.php'); // get boot config |
25 | -require_once($_configuration['root_sys'].'plugin/vchamilo/cli/clilib.php'); // cli only functions |
|
25 | +require_once($_configuration['root_sys'].'plugin/vchamilo/cli/clilib.php'); // cli only functions |
|
26 | 26 | |
27 | 27 | // Ensure errors are well explained |
28 | 28 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | echo "Chamilo Bulk Nodes Creation v.1.0\n"; |
19 | 19 | echo "=================================\n"; |
20 | 20 | require_once('../../../main/inc/global.inc.php'); |
21 | -require_once('clilib.php'); // cli only functions |
|
21 | +require_once('clilib.php'); // cli only functions |
|
22 | 22 | // Ensure errors are well explained |
23 | 23 | ini_set('debug_display', 1); |
24 | 24 | ini_set('debug_level', E_ALL); |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
93 | -require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
93 | +require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
94 | 94 | if ($options['verbose']) echo "loaded dbclass\n"; |
95 | -require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
95 | +require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
96 | 96 | if ($options['verbose']) echo "loaded textlib\n"; |
97 | -require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
97 | +require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
98 | 98 | if ($options['verbose']) echo "loaded moodle wrapping\n"; |
99 | -require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
99 | +require_once($_configuration['root_sys'].'/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
100 | 100 | if ($options['verbose']) echo "loaded vchamilo plugin\n"; |
101 | 101 | |
102 | 102 | global $DB; |
@@ -91,25 +91,39 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
94 | -if ($options['verbose']) echo "loaded dbclass\n"; |
|
94 | +if ($options['verbose']) { |
|
95 | + echo "loaded dbclass\n"; |
|
96 | +} |
|
95 | 97 | require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
96 | -if ($options['verbose']) echo "loaded textlib\n"; |
|
98 | +if ($options['verbose']) { |
|
99 | + echo "loaded textlib\n"; |
|
100 | +} |
|
97 | 101 | require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
98 | -if ($options['verbose']) echo "loaded moodle wrapping\n"; |
|
102 | +if ($options['verbose']) { |
|
103 | + echo "loaded moodle wrapping\n"; |
|
104 | +} |
|
99 | 105 | require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
100 | -if ($options['verbose']) echo "loaded vchamilo plugin\n"; |
|
106 | +if ($options['verbose']) { |
|
107 | + echo "loaded vchamilo plugin\n"; |
|
108 | +} |
|
101 | 109 | |
102 | 110 | global $DB; |
103 | -if ($options['verbose']) echo "building database manager\n"; |
|
111 | +if ($options['verbose']) { |
|
112 | + echo "building database manager\n"; |
|
113 | +} |
|
104 | 114 | $DB = new DatabaseManager(); |
105 | -if ($options['verbose']) echo "building plugin vchamilo\n"; |
|
115 | +if ($options['verbose']) { |
|
116 | + echo "building plugin vchamilo\n"; |
|
117 | +} |
|
106 | 118 | $plugininstance = VChamiloPlugin::create(); |
107 | 119 | |
108 | 120 | if (empty($options['nodes'])) { |
109 | 121 | cli_error(get_string('climissingnodes', 'block_vmoodle')); |
110 | 122 | } |
111 | 123 | |
112 | -if ($options['verbose']) echo "parsing nodelist\n"; |
|
124 | +if ($options['verbose']) { |
|
125 | + echo "parsing nodelist\n"; |
|
126 | +} |
|
113 | 127 | $nodes = vchamilo_parse_csv_nodelist($options['nodes'], $plugininstance); |
114 | 128 | |
115 | 129 | if ($options['lint']) { |
@@ -57,6 +57,6 @@ |
||
57 | 57 | |
58 | 58 | // create root storage directory for templates |
59 | 59 | global $_configuration; |
60 | -if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/templates')){ |
|
60 | +if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/templates')) { |
|
61 | 61 | mkdir($_configuration['root_sys'].'plugin/vchamilo/templates', 0777, true); |
62 | 62 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | if (isset($plugin_info['current_region'])) { |
7 | - switch($plugin_info['current_region']) { |
|
7 | + switch ($plugin_info['current_region']) { |
|
8 | 8 | case 'footer_left': |
9 | 9 | echo $plugin_info['settings']['customfooter_footer_left']; |
10 | 10 | break; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $config = api_get_settings_params(array('subkey = ? ' => 'customfooter', ' AND category = ? ' => 'Plugins')); |
39 | 39 | foreach ($config as $fooid => $configrecord) { |
40 | 40 | $canonic = preg_replace('/^customfooter_/', '', $configrecord['variable']); |
41 | - if (in_array($canonic, array('footer_left', 'footer_right'))){ |
|
41 | + if (in_array($canonic, array('footer_left', 'footer_right'))) { |
|
42 | 42 | $form_settings[$canonic] = $configrecord['selected_value']; |
43 | 43 | } |
44 | 44 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | parent::__construct('1.1', 'Valery Fremaux'); |
27 | 27 | } |
28 | 28 | |
29 | - function pix_url($pixname, $size = 16) { |
|
29 | + function pix_url($pixname, $size = 16) { |
|
30 | 30 | global $_configuration; |
31 | 31 | |
32 | 32 | if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png')){ |
@@ -29,13 +29,13 @@ |
||
29 | 29 | function pix_url($pixname, $size = 16) { |
30 | 30 | global $_configuration; |
31 | 31 | |
32 | - if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png')){ |
|
32 | + if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png')) { |
|
33 | 33 | return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.png'; |
34 | 34 | } |
35 | - if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg')){ |
|
35 | + if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg')) { |
|
36 | 36 | return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.jpg'; |
37 | 37 | } |
38 | - if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif')){ |
|
38 | + if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif')) { |
|
39 | 39 | return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.gif'; |
40 | 40 | } |
41 | 41 | return $_configuration['root_web'].'/main/img/icons/'.$size.'/'.$pixname.'.png'; |