';
if ($installType == 'update') {
if ($allowSelfRegProf == 'true') {
@@ -1773,16 +1773,16 @@ function display_configuration_settings_form(
} else {
$label = get_lang('No');
}
- $html .= '
'. $label;
+ $html .= '
'.$label;
} else {
$html .= '
';
$html .= '';
$html .= '
';
}
@@ -1847,7 +1847,7 @@ function get_countries_list_from_array($combo = false)
"Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar",
"Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway",
"Oman",
- "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland","Portugal",
+ "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal",
"Qatar",
"Romania", "Russia", "Rwanda",
"Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria",
@@ -1894,11 +1894,11 @@ function updateDirAndFilesPermissions()
$permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770;
$permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660;
// use decoct() to store as string
- $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
+ $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."'
WHERE variable = 'permissions_for_new_directories'";
Database::query($sql);
- $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable = 'permissions_for_new_files'";
+ $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable = 'permissions_for_new_files'";
Database::query($sql);
if (isset($_SESSION['permissions_for_new_directories'])) {
@@ -1918,8 +1918,8 @@ function updateDirAndFilesPermissions()
function compare_setting_values($current_value, $wanted_value)
{
$current_value_string = $current_value;
- $current_value = (float)$current_value;
- $wanted_value = (float)$wanted_value;
+ $current_value = (float) $current_value;
+ $wanted_value = (float) $wanted_value;
if ($current_value >= $wanted_value) {
return Display::label($current_value_string, 'success');
@@ -1983,7 +1983,7 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
fwrite($fp, $out);
while (!feof($fp)) {
- $result = str_replace("\r\n", '',fgets($fp, 128));
+ $result = str_replace("\r\n", '', fgets($fp, 128));
if (!empty($result) && $result == '123') {
$output = true;
}
@@ -2006,7 +2006,7 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec ($ch);
+ $result = curl_exec($ch);
if (!empty($result) && $result == '123') {
$output = true;
}
@@ -2860,12 +2860,12 @@ function finishInstallation(
$adminPhoneForm,
'', //$picture_uri = '',
PLATFORM_AUTH_SOURCE,
- '',//$expirationDate,
+ '', //$expirationDate,
1,
0,
null,
'',
- false, //$send_mail = false,
+ false, //$send_mail = false,
true //$isAdmin = false
);
@@ -2887,7 +2887,7 @@ function finishInstallation(
0,
null,
'',
- false, //$send_mail = false,
+ false, //$send_mail = false,
false //$isAdmin = false
);
@@ -2922,7 +2922,7 @@ function finishInstallation(
Database::query($sql);
foreach ($files as $version) {
- $version = str_replace(['Version', '.php' ], '', $version->getFilename());
+ $version = str_replace(['Version', '.php'], '', $version->getFilename());
$sql = "INSERT INTO version (version) VALUES ('$version')";
Database::query($sql);
}
@@ -2968,7 +2968,7 @@ function installProfileSettings($installationProfile = '')
SET selected_value = '".$param->selected_value."'
WHERE variable = '".$param->variable."'";
if (!empty($param->subkey)) {
- $sql .= " AND subkey='" . $param->subkey . "'";
+ $sql .= " AND subkey='".$param->subkey."'";
}
Database::query($sql);
}
diff --git a/main/lp/lp_controller.php b/main/lp/lp_controller.php
index ddc5291480..614a289908 100755
--- a/main/lp/lp_controller.php
+++ b/main/lp/lp_controller.php
@@ -27,7 +27,7 @@ if (isset($_GET['action'])) {
// Including the global initialization file.
require_once __DIR__.'/../inc/global.inc.php';
-$current_course_tool = TOOL_LEARNPATH;
+$current_course_tool = TOOL_LEARNPATH;
$_course = api_get_course_info();
$glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools');
@@ -39,11 +39,11 @@ if ($showGlossary) {
) {
$htmlHeadXtra[] = '';
- $htmlHeadXtra[] = '';
- $htmlHeadXtra[] = '';
+ $htmlHeadXtra[] = '';
+ $htmlHeadXtra[] = '';
}
}
@@ -248,7 +248,7 @@ if (isset($_SESSION['lpobject'])) {
$course_id = api_get_course_int_id();
-if ($debug>0) error_log('New LP - Passed data remains check', 0);
+if ($debug > 0) error_log('New LP - Passed data remains check', 0);
if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) {
if ($debug > 0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new', 0);
@@ -272,7 +272,7 @@ if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $
if (Database::num_rows($res)) {
$row = Database::fetch_array($res);
$type = $row['lp_type'];
- if ($debug > 0) error_log('New LP - found row - type '.$type. ' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
+ if ($debug > 0) error_log('New LP - found row - type '.$type.' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
switch ($type) {
case 1:
if ($debug > 0) error_log('New LP - found row - type dokeos - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
@@ -707,8 +707,8 @@ switch ($action) {
$editPrerequisite = $_SESSION['oLP']->edit_item_prereq(
$_GET['id'],
$_POST['prerequisites'],
- $_POST['min_' . $_POST['prerequisites']],
- $_POST['max_' . $_POST['prerequisites']]
+ $_POST['min_'.$_POST['prerequisites']],
+ $_POST['max_'.$_POST['prerequisites']]
);
if ($editPrerequisite) {
@@ -968,7 +968,7 @@ switch ($action) {
$_SESSION['oLP']->setAccumulateScormTime($accumulateScormTime);
if (isset($_REQUEST['activate_start_date_check']) && $_REQUEST['activate_start_date_check'] == 1) {
- $publicated_on = $_REQUEST['publicated_on'];
+ $publicated_on = $_REQUEST['publicated_on'];
} else {
$publicated_on = null;
}
@@ -1148,8 +1148,8 @@ switch ($action) {
error_log('New LP - No learnpath given for view', 0);
require 'lp_list.php';
} else {
- if ($debug > 0) {error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0); }
- if ( !empty($_REQUEST['item_id']) ) {
+ if ($debug > 0) {error_log('New LP - Trying to set current item to '.$_REQUEST['item_id'], 0); }
+ if (!empty($_REQUEST['item_id'])) {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}
require 'lp_view.php';
@@ -1231,7 +1231,7 @@ switch ($action) {
break;
*/
case 'switch_attempt_mode':
- if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; }
+ if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
$_SESSION['refresh'] = 1;
$_SESSION['oLP']->switch_attempt_mode();
require 'lp_list.php';
@@ -1276,8 +1276,8 @@ switch ($action) {
error_log('New LP - No learnpath given for view', 0);
require 'lp_list.php';
} else {
- if ($debug > 0) {error_log('New LP - Trying to impress this LP item to ' . $_REQUEST['item_id'], 0); }
- if (!empty($_REQUEST['item_id']) ) {
+ if ($debug > 0) {error_log('New LP - Trying to impress this LP item to '.$_REQUEST['item_id'], 0); }
+ if (!empty($_REQUEST['item_id'])) {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}
require 'lp_impress.php';
@@ -1337,7 +1337,7 @@ switch ($action) {
$_SESSION['oLP']->lp_session_id
);
- $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id']: 0;
+ $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id'] : 0;
if (empty($forumCategoryId)) {
$forumCategoryId = store_forumcategory(
@@ -1369,7 +1369,7 @@ switch ($action) {
}
}
- header('Location:' . api_get_self() . '?' . http_build_query([
+ header('Location:'.api_get_self().'?'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => $_SESSION['oLP']->lp_id
@@ -1409,7 +1409,7 @@ switch ($action) {
}
}
- header('Location:' . api_get_self() . '?' . http_build_query([
+ header('Location:'.api_get_self().'?'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => $_SESSION['oLP']->lp_id
@@ -1429,7 +1429,7 @@ switch ($action) {
}
$_SESSION['oLP']->getFinalItemForm();
- $redirectTo = api_get_self() . '?' . api_get_cidreq().'&'.http_build_query([
+ $redirectTo = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => intval($_SESSION['oLP']->lp_id)
diff --git a/main/lp/openoffice_document.class.php b/main/lp/openoffice_document.class.php
index 4dc5a6d6f0..9491ee613e 100755
--- a/main/lp/openoffice_document.class.php
+++ b/main/lp/openoffice_document.class.php
@@ -58,9 +58,9 @@ abstract class OpenofficeDocument extends learnpath
///learning_path/ppt_dirname directory
$this->created_dir = $result['dir'];
if (substr($this->created_dir, -1, 1) == '/') {
- $this->file_path = $this->created_dir . api_replace_dangerous_char($file['name']);
+ $this->file_path = $this->created_dir.api_replace_dangerous_char($file['name']);
} else {
- $this->file_path = $this->created_dir . '/' . api_replace_dangerous_char($file['name']);
+ $this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']);
}
//var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir);
@@ -104,18 +104,18 @@ abstract class OpenofficeDocument extends learnpath
$perm = api_get_setting('permissions_for_new_files');
if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
- $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
- $class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar';
+ $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
+ $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar';
//$cmd = 'java -cp "'.$class_path.'" DokeosConverter';
- $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter';
+ $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter';
} else {
- $converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
+ $converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
//$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar';
$class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar';
- $cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter';
+ $cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter';
}
- $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
+ $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
// Call to the function implemented by child.
$cmd .= $this->add_command_parameters();
// To allow openoffice to manipulate docs.
@@ -124,7 +124,7 @@ abstract class OpenofficeDocument extends learnpath
@chmod($this->base_work_dir.$this->file_path, 0777);
$locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
- putenv('LC_ALL=' . $locale);
+ putenv('LC_ALL='.$locale);
$files = array();
$return = 0;
@@ -153,12 +153,12 @@ abstract class OpenofficeDocument extends learnpath
$result = $this->_get_remote_ppt2lp_files($file, $size);
$result = unserialize($result);
// Save remote images to server
- chmod($this->base_work_dir . $this->created_dir, api_get_permissions_for_new_directories());
+ chmod($this->base_work_dir.$this->created_dir, api_get_permissions_for_new_directories());
if (!empty($result['images'])) {
foreach ($result['images'] as $image => $img_data) {
$image_path = $this->base_work_dir.$this->created_dir;
- @file_put_contents($image_path . '/' . $image, base64_decode($img_data));
- @chmod($image_path . '/' . $image, 0777);
+ @file_put_contents($image_path.'/'.$image, base64_decode($img_data));
+ @chmod($image_path.'/'.$image, 0777);
}
}
@@ -202,7 +202,7 @@ abstract class OpenofficeDocument extends learnpath
$uri = '';
$result = preg_match('/^([a-zA-Z0-9]*):\/\/([^\/]*)\//', $ppt2lp_host, $matches);
if ($result) {
- $uri = $matches[1] . '://' . $matches[2] . '/';
+ $uri = $matches[1].'://'.$matches[2].'/';
} else {
$uri = $ppt2lp_host;
}
@@ -221,7 +221,7 @@ abstract class OpenofficeDocument extends learnpath
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9,
);
if (substr($ppt2lp_host, 0, 5) === 'https') {
- $options['ssl_method'] = SOAP_SSL_METHOD_TLS;
+ $options['ssl_method'] = SOAP_SSL_METHOD_TLS;
// If using SSL, please note that *not* supporting the SSLv2
// (broken in terms of security), the server tends to generate
// the following issue:
@@ -246,7 +246,7 @@ abstract class OpenofficeDocument extends learnpath
//error_log('['.time().'] Calling wsConvertPpt webservice on ' . $ppt2lp_host);
$result = $client->__call('wsConvertPpt', array('pptData' => $params));
} catch (Exception $e) {
- error_log('['.time().'] Chamilo SOAP call error: ' . $e->getMessage());
+ error_log('['.time().'] Chamilo SOAP call error: '.$e->getMessage());
}
// Make sure we destroy the SOAP client as it may generate SSL connection
// binding issue (if using SSL)
@@ -279,38 +279,38 @@ abstract class OpenofficeDocument extends learnpath
$ppt2lpHost = api_get_setting('service_ppt2lp', 'host');
$permissionFile = api_get_permissions_for_new_files();
$permissionFolder = api_get_permissions_for_new_directories();
- if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
+ if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
return $ids;
}
if ($ppt2lpHost == 'localhost') {
if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
- $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
- $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar';
- $cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"';
+ $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
+ $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar';
+ $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"';
} else {
- $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
+ $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
$classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar';
- $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' ';
+ $cmd = 'cd '.$converterPath.' && java '.$classPath.' ';
}
- $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
+ $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
// Call to the function implemented by child.
- $cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '" "' . $this->base_work_dir . '/' . $this->created_dir . '"';
+ $cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'" "'.$this->base_work_dir.'/'.$this->created_dir.'"';
// To allow openoffice to manipulate docs.
@chmod($this->base_work_dir, $permissionFolder);
- @chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile);
+ @chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile);
$locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
- putenv('LC_ALL=' . $locale);
+ putenv('LC_ALL='.$locale);
$files = array();
$return = 0;
$shell = exec($cmd, $files, $return);
// TODO: Chown is not working, root keep user privileges, should be www-data
- @chown($this->base_work_dir . '/' . $this->created_dir, 'www-data');
- @chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile);
+ @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data');
+ @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile);
if ($return != 0) { // If the java application returns an error code.
switch ($return) {
@@ -352,14 +352,14 @@ abstract class OpenofficeDocument extends learnpath
*/
}
- if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
+ if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
// Register Files to Document tool
$ids[] = add_document(
$_course,
- '/' . $this->created_dir,
+ '/'.$this->created_dir,
'file',
- filesize($this->base_work_dir . '/' . $this->created_dir),
+ filesize($this->base_work_dir.'/'.$this->created_dir),
$convertedTitle,
sprintf(
get_lang('FileConvertedFromXToY'),
diff --git a/main/lp/openoffice_presentation.class.php b/main/lp/openoffice_presentation.class.php
index 68ad7f214e..c60d9deab5 100755
--- a/main/lp/openoffice_presentation.class.php
+++ b/main/lp/openoffice_presentation.class.php
@@ -98,7 +98,7 @@ class OpenofficePresentation extends OpenofficeDocument
);
// Generating the thumbnail.
- $image = $this->base_work_dir.$dir . $file_name;
+ $image = $this->base_work_dir.$dir.$file_name;
$pattern = '/(\w+)\.png$/';
$replacement = '${1}_thumb.png';
@@ -114,7 +114,7 @@ class OpenofficePresentation extends OpenofficeDocument
$my_new_image = new Image($image);
$my_new_image->resize($thumb_width, $thumb_height);
- $my_new_image->send_image($this->base_work_dir.$dir . $thumb_name, -1, 'png');
+ $my_new_image->send_image($this->base_work_dir.$dir.$thumb_name, -1, 'png');
// Adding the thumbnail to documents.
$document_id_thumb = add_document(
@@ -140,7 +140,7 @@ class OpenofficePresentation extends OpenofficeDocument

-