Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent c8c4f40fa0
commit b093287dc6
  1. 10
      plugin/vchamilo/index.php
  2. 2
      plugin/vchamilo/install.php
  3. 5
      plugin/vchamilo/lib/Virtual.php
  4. 6
      plugin/vchamilo/plugin.php
  5. 2
      plugin/vchamilo/template.tpl
  6. 5
      plugin/vchamilo/uninstall.php
  7. 5
      plugin/vchamilo/vcron.php

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

@ -60,6 +60,6 @@ api_add_setting(0, 'vchamilo_vcrontickperiod', 'vchamilo', 'setting', 'Plugins')
// create root storage directory for templates // create root storage directory for templates
global $_configuration; 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); mkdir($_configuration['root_sys'].'plugin/vchamilo/templates', 0777, true);
} }

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

@ -1,7 +1,9 @@
<?php <?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). * This script is a configuration file for the vchamilo plugin.
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins) * 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 * @package chamilo.plugin
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */

@ -4,7 +4,7 @@
<div class="vchamilo-host-list"> <div class="vchamilo-host-list">
<ul> <ul>
{% for host in hosts %} {% 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 %} {% endfor %}
</ul> </ul>
</div> </div>

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

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

Loading…
Cancel
Save