@@ -13,7 +13,7 @@ |
||
13 | 13 | * |
14 | 14 | * @author Angel Fernando Quiroz Campos <[email protected]> |
15 | 15 | */ |
16 | -class SkillRepository extends EntityRepository{ |
|
16 | +class SkillRepository extends EntityRepository { |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Get the last acquired skill by a user on course and/or session |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach ($from as $subVertex) { |
53 | 53 | $vertexId = $subVertex->getId(); |
54 | 54 | $sessionInfo = api_get_session_info($vertexId); |
55 | - $sessionInfo['admin_link'] = '<a href="' . \SessionManager::getAdminPath($vertexId) . '">' . $sessionInfo['name'] . '</a>'; |
|
55 | + $sessionInfo['admin_link'] = '<a href="'.\SessionManager::getAdminPath($vertexId).'">'.$sessionInfo['name'].'</a>'; |
|
56 | 56 | $result['requirements'][] = $sessionInfo; |
57 | 57 | } |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | foreach ($to as $subVertex) { |
61 | 61 | $vertexId = $subVertex->getId(); |
62 | 62 | $sessionInfo = api_get_session_info($vertexId); |
63 | - $sessionInfo['admin_link'] = '<a href="' . \SessionManager::getAdminPath($vertexId) . '">' . $sessionInfo['name'] . '</a>'; |
|
63 | + $sessionInfo['admin_link'] = '<a href="'.\SessionManager::getAdminPath($vertexId).'">'.$sessionInfo['name'].'</a>'; |
|
64 | 64 | $result['dependencies'][] = $sessionInfo; |
65 | 65 | } |
66 | 66 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | //the plugin title |
13 | -$plugin_info['title'] = 'Hide/Unhide the Login/Password default form'; |
|
13 | +$plugin_info['title'] = 'Hide/Unhide the Login/Password default form'; |
|
14 | 14 | |
15 | 15 | //the comments that go with the plugin |
16 | 16 | $plugin_info['comment'] = "If you use another way of authentication than local, you may want to hide the Login/Password default Form to avoid users mistakes. This plugin replace the Login/Password form with a text that unhide the Login/Password form if you click on it."; |
@@ -31,4 +31,4 @@ discard block |
||
31 | 31 | $plugin_info['settings_form'] = $form; |
32 | 32 | |
33 | 33 | //set the templates that are going to be used |
34 | -$plugin_info['templates'] = array('template.tpl'); |
|
34 | +$plugin_info['templates'] = array('template.tpl'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $data = $hook->getEventData(); |
30 | 30 | |
31 | 31 | $drupalDomain = CreateDrupalUser::create()->get('drupal_domain'); |
32 | - $drupalDomain = rtrim($drupalDomain, '/') . '/'; |
|
32 | + $drupalDomain = rtrim($drupalDomain, '/').'/'; |
|
33 | 33 | |
34 | 34 | if ($data['type'] === HOOK_EVENT_TYPE_POST) { |
35 | 35 | $return = $data['return']; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | ); |
51 | 51 | |
52 | 52 | $options = array( |
53 | - 'location' => $drupalDomain . 'sites/all/modules/chamilo/soap.php?wsdl', |
|
53 | + 'location' => $drupalDomain.'sites/all/modules/chamilo/soap.php?wsdl', |
|
54 | 54 | 'uri' => $drupalDomain |
55 | 55 | ); |
56 | 56 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $form = new FormValidator('form'); |
36 | 36 | |
37 | - $renderer =& $form->defaultRenderer(); |
|
37 | + $renderer = & $form->defaultRenderer(); |
|
38 | 38 | $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>'); |
39 | 39 | $renderersetCustomElementTemplate->setCustomElementTemplate('<tr><td>{element}</td></tr>'); |
40 | 40 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $form2 = new FormValidator('form'); |
55 | 55 | |
56 | 56 | if (!empty($option2) && !empty($urlOption2)) { |
57 | - $renderer =& $form2->defaultRenderer(); |
|
57 | + $renderer = & $form2->defaultRenderer(); |
|
58 | 58 | $renderer->setHeaderTemplate(''); |
59 | 59 | $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>'); |
60 | 60 | $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>'); |
@@ -41,9 +41,9 @@ |
||
41 | 41 | $defaults['option1_url'] = api_get_plugin_setting('before_login', 'option1_url'); |
42 | 42 | $defaults['option2_url'] = api_get_plugin_setting('before_login', 'option2_url'); |
43 | 43 | |
44 | -$plugin_info['templates'] = array('template.tpl'); |
|
44 | +$plugin_info['templates'] = array('template.tpl'); |
|
45 | 45 | if (file_exists(__DIR__.'/custom.template.tpl')) { |
46 | - $plugin_info['templates'] = array( 'custom.template.tpl'); |
|
46 | + $plugin_info['templates'] = array('custom.template.tpl'); |
|
47 | 47 | } |
48 | 48 | $form->setDefaults($defaults); |
49 | 49 |
@@ -24,13 +24,13 @@ |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | //the plugin title |
27 | -$plugin_info['title']='PENS'; |
|
27 | +$plugin_info['title'] = 'PENS'; |
|
28 | 28 | //the comments that go with the plugin |
29 | -$plugin_info['comment']="PENS implementation for Chamilo"; |
|
29 | +$plugin_info['comment'] = "PENS implementation for Chamilo"; |
|
30 | 30 | //the locations where this plugin can be shown |
31 | -$plugin_info['location']=array(); |
|
31 | +$plugin_info['location'] = array(); |
|
32 | 32 | //the plugin version |
33 | -$plugin_info['version']='1.1'; |
|
33 | +$plugin_info['version'] = '1.1'; |
|
34 | 34 | //the plugin author |
35 | -$plugin_info['author']='Guillaume Viguier-Just, Yannick Warnier'; |
|
35 | +$plugin_info['author'] = 'Guillaume Viguier-Just, Yannick Warnier'; |
|
36 | 36 | $plugin_info = PENSPlugin::create()->get_info(); |
37 | 37 | \ No newline at end of file |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | * @licence http://www.gnu.org/licenses/gpl.txt |
26 | 26 | */ |
27 | 27 | |
28 | -require_once __DIR__ . '/../../main/inc/global.inc.php'; |
|
29 | -require_once __DIR__ . '/lib/pens.php'; |
|
28 | +require_once __DIR__.'/../../main/inc/global.inc.php'; |
|
29 | +require_once __DIR__.'/lib/pens.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * ChamiloPens |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param PENSRequest Request |
115 | 115 | */ |
116 | 116 | public function __construct($request) { |
117 | - if($request instanceof PENSRequest) { |
|
117 | + if ($request instanceof PENSRequest) { |
|
118 | 118 | $this->_id = 0; |
119 | 119 | $this->_pens_version = $request->getPensVersion(); |
120 | 120 | $this->_package_type = $request->getPackageType(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $this->_client = $request->getClient(); |
125 | 125 | $this->_vendor_data = $request->getVendorData(); |
126 | 126 | $this->_package_name = $request->getFilename(); |
127 | - } else if(is_array($request)) { |
|
127 | + } else if (is_array($request)) { |
|
128 | 128 | $this->_id = $request['id']; |
129 | 129 | $this->_pens_version = $request['pens_version']; |
130 | 130 | $this->_package_type = $request['package_type']; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $this->_vendor_data = $request['vendor_data']; |
136 | 136 | $this->_package_name = $request['package_name']; |
137 | 137 | $this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC')); |
138 | - if(!empty($request['updated_at'])) { |
|
138 | + if (!empty($request['updated_at'])) { |
|
139 | 139 | $this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC')); |
140 | 140 | } |
141 | 141 | } |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | $clean_vendor_data = Database::escape_string($this->_vendor_data); |
152 | 152 | $created_at = api_get_utc_datetime(); |
153 | 153 | $table = Database::get_main_table(ChamiloPens::TABLE_NAME); |
154 | - $sql_query = "INSERT INTO $table (pens_version, package_type, package_type_version, package_format, package_id, client, vendor_data, package_name, created_at) VALUES (" . |
|
155 | - "'". $this->_pens_version. "', " . |
|
156 | - "'".$this->_package_type. "', " . |
|
157 | - "'".$clean_package_type_version. "', " . |
|
158 | - "'".$this->_package_format. "', " . |
|
159 | - "'".$clean_package_id. "', " . |
|
160 | - "'".$clean_client."', " . |
|
161 | - "'".$clean_vendor_data."', " . |
|
162 | - "'".$this->_package_name."', " . |
|
163 | - "'".$created_at."') ON DUPLICATE KEY UPDATE " . |
|
154 | + $sql_query = "INSERT INTO $table (pens_version, package_type, package_type_version, package_format, package_id, client, vendor_data, package_name, created_at) VALUES (". |
|
155 | + "'".$this->_pens_version."', ". |
|
156 | + "'".$this->_package_type."', ". |
|
157 | + "'".$clean_package_type_version."', ". |
|
158 | + "'".$this->_package_format."', ". |
|
159 | + "'".$clean_package_id."', ". |
|
160 | + "'".$clean_client."', ". |
|
161 | + "'".$clean_vendor_data."', ". |
|
162 | + "'".$this->_package_name."', ". |
|
163 | + "'".$created_at."') ON DUPLICATE KEY UPDATE ". |
|
164 | 164 | "pens_version = VALUES(pens_version), ". |
165 | 165 | "package_type = VALUES(package_type), ". |
166 | 166 | "package_type_version = VALUES(package_type_version), ". |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';"; |
183 | 183 | $results = Database::query($sql_query); |
184 | 184 | $number = Database::num_rows($results); |
185 | - if($number == 1) { |
|
185 | + if ($number == 1) { |
|
186 | 186 | $obj = Database::fetch_assoc($results); |
187 | 187 | return new ChamiloPens($obj); |
188 | 188 | } else { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $sql_query = "SELECT * FROM $table ORDER BY created_at;"; |
201 | 201 | $results = Database::query($sql_query); |
202 | 202 | $return = array(); |
203 | - while($assoc = Database::fetch_assoc($results)) { |
|
203 | + while ($assoc = Database::fetch_assoc($results)) { |
|
204 | 204 | $return[] = new ChamiloPens($assoc); |
205 | 205 | } |
206 | 206 | return $return; |
@@ -24,19 +24,19 @@ |
||
24 | 24 | * @licence http://www.gnu.org/licenses/gpl.txt |
25 | 25 | */ |
26 | 26 | |
27 | -require_once __DIR__ . '/../../main/inc/global.inc.php'; |
|
28 | -require_once __DIR__ . '/lib/pens.php'; |
|
29 | -require_once __DIR__ . '/chamilo_pens.php'; |
|
27 | +require_once __DIR__.'/../../main/inc/global.inc.php'; |
|
28 | +require_once __DIR__.'/lib/pens.php'; |
|
29 | +require_once __DIR__.'/chamilo_pens.php'; |
|
30 | 30 | |
31 | 31 | class ChamiloPackageHandler extends PENSPackageHandler { |
32 | 32 | public function processPackage($request, $path_to_package) { |
33 | 33 | $server = PENSServer::singleton(); |
34 | 34 | // Moves the package to archive/pens |
35 | - $path_to_archives = api_get_path(SYS_ARCHIVE_PATH) . 'pens'; |
|
36 | - if(!is_dir($path_to_archives)) { |
|
35 | + $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
|
36 | + if (!is_dir($path_to_archives)) { |
|
37 | 37 | mkdir($path_to_archives, 0777, true); |
38 | 38 | } |
39 | - rename($path_to_package, $path_to_archives . '/' . $request->getFilename()); |
|
39 | + rename($path_to_package, $path_to_archives.'/'.$request->getFilename()); |
|
40 | 40 | // Insert the request in the database |
41 | 41 | $chamilo_pens = new ChamiloPens($request); |
42 | 42 | $chamilo_pens->save(); |