Browse Source

Minor - format code

jmontoyaa 8 years ago
parent
commit
b093287dc6

+ 5 - 5
plugin/vchamilo/index.php

@@ -14,14 +14,14 @@ $plugin = VChamiloPlugin::create();
 $_template['show_message'] = true;
 $_template['title'] = $plugin->get_lang('hostlist');
 
-$tablename = Database::get_main_table('vchamilo');
-$sql = "SELECT sitename, root_web FROM $tablename WHERE visible = 1";
+$table = Database::get_main_table('vchamilo');
+$sql = "SELECT sitename, root_web FROM $table WHERE visible = 1";
 
-if ($virtualChamilo == '%'){
+if ($virtualChamilo == '%') {
     $result = Database::query($sql);
     $_template['hosts'] = array();
-    if ($result){
-        while($vchamilo = Database::fetch_assoc($result)){
+    if ($result) {
+        while ($vchamilo = Database::fetch_assoc($result)) {
             $_template['hosts'][] = $vchamilo;
         }
     }

+ 1 - 1
plugin/vchamilo/install.php

@@ -60,6 +60,6 @@ api_add_setting(0, 'vchamilo_vcrontickperiod', 'vchamilo', 'setting', 'Plugins')
 
 // create root storage directory for templates
 global $_configuration;
-if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/templates')){
+if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/templates')) {
     mkdir($_configuration['root_sys'].'plugin/vchamilo/templates', 0777, true);
 }

+ 0 - 5
plugin/vchamilo/lib/Virtual.php

@@ -28,7 +28,6 @@ class Virtual
 
         $virtualChamilo = [];
         if ($_configuration['root_web'] == $virtualChamiloWebRoot) {
-
             return;
         }
 
@@ -445,7 +444,6 @@ class Virtual
 
             // executing all commands
             foreach ($cmds as $cmd) {
-
                 // Final command.
                 $cmd = $pgm.' '.$cmd;
                 // Prints log messages in the page and in 'cmd.log'.
@@ -475,7 +473,6 @@ class Virtual
     {
         $file = api_get_path(SYS_PATH).'/plugin/vchamilo/templates/'.$version.'/manifest.php';
         if (file_exists($file)) {
-
             include $file;
 
             $manifest = new stdClass();
@@ -541,7 +538,6 @@ class Virtual
                 if (is_dir($dir->getPathname())) {
                     // A template is considered when a dump.sql exists.
                     if (file_exists($dir->getPathname().'/dump.sql')) {
-
                         $templateName = $dir->getRelativePathname();
                         if ($templateName == $template) {
                             $templateName .= ' (default)';
@@ -559,7 +555,6 @@ class Virtual
     * this function set will map standard moodle API calls to chamilo
     * internal primitives. This avoids too many changes to do in imported
     * code
-    *
     */
     public static function getConfig($module, $key, $isplugin = true)
     {

+ 4 - 2
plugin/vchamilo/plugin.php

@@ -1,7 +1,9 @@
 <?php
 /**
- * This script is a configuration file for the vchamilo plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
- * These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
+ * This script is a configuration file for the vchamilo plugin.
+ * You can use it as a master for other platform plugins (course plugins are slightly different).
+ * These settings will be used in the administration interface for plugins
+ * (Chamilo configuration settings->Plugins)
  * @package chamilo.plugin
  * @author Julio Montoya <gugli100@gmail.com>
  */

+ 1 - 1
plugin/vchamilo/template.tpl

@@ -4,7 +4,7 @@
 <div class="vchamilo-host-list">
 	<ul>
 	{% for host in hosts %}
-	<li class="vchamilo-host"> <a href="{{host.url}}">{{host.name}}</a></li>
+	    <li class="vchamilo-host"> <a href="{{host.url}}">{{host.name}}</a></li>
 	{% endfor %}
 	</ul>
 </div>

+ 2 - 3
plugin/vchamilo/uninstall.php

@@ -3,8 +3,7 @@
 
 api_protect_admin_script();
 
-$table = 'vchamilo';
-$tablename = Database::get_main_table($table);
-$sql = " DROP TABLE IF EXISTS $tablename ";
+$table = Database::get_main_table('vchamilo');
+$sql = " DROP TABLE IF EXISTS $table";
 
 Database::query($sql);

+ 2 - 3
plugin/vchamilo/vcron.php

@@ -1,5 +1,4 @@
 <?php
-
 /**
  * This file is a cron microclock script.
  * It will be used as replacement of setting individual
@@ -29,7 +28,7 @@ define('LOWEST_POSSIBLE_GAP', 1);
 
 global $VCRON;
 
-$VCRON = new StdClass;
+$VCRON = new stdClass();
 $VCRON->ACTIVATION = 'cli';                         // choose how individual cron are launched, 'cli' or 'web'
 $VCRON->STRATEGY = ROUND_ROBIN ;                    // choose vcron rotation mode
 $VCRON->PERIOD = 15 * MINSECS ;                     // used if LOWEST_POSSIBLE_GAP to setup the max gap
@@ -71,7 +70,7 @@ function fire_vhost_cron($vhost) {
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
     // Check for proxy.
-    if (!empty($http_proxy_host) and !is_proxybypass($uri)) {
+    if (!empty($http_proxy_host) && !is_proxybypass($uri)) {
 
         curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);