diff --git a/main/admin/access_url_edit_users_to_url.php b/main/admin/access_url_edit_users_to_url.php index 48678f0946..ec6c420e87 100755 --- a/main/admin/access_url_edit_users_to_url.php +++ b/main/admin/access_url_edit_users_to_url.php @@ -57,7 +57,7 @@ function add_user_to_url(code, content) { function send() { if (document.formulaire.access_url_id.value!=0) { document.formulaire.form_sent.value=0; - document.formulaire.add_type.value=\'' . $add_type . '\'; + document.formulaire.add_type.value=\'' . $add_type.'\'; document.formulaire.submit(); } } @@ -93,17 +93,17 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) { $result = UrlManager::update_urls_rel_user($UserList, $access_url_id); $url_info = UrlManager::get_url_data_from_id($access_url_id); if (!empty($result)) { - $message .= 'URL: ' . $url_info['url'] . '
'; + $message .= 'URL: '.$url_info['url'].'
'; } if (!empty($result['users_added'])) { - $message .= '

' . get_lang('UsersAdded') . ':

'; + $message .= '

'.get_lang('UsersAdded').':

'; $i = 1; $user_added_list = array(); foreach ($result['users_added'] as $user) { $user_info = api_get_user_info($user); if (!empty($user_info)) { - $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); + $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); $i++; } } @@ -113,13 +113,13 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) { } if (!empty($result['users_deleted'])) { - $message .= '

' . get_lang('UsersDeleted') . ':

'; + $message .= '

'.get_lang('UsersDeleted').':

'; $user_deleted_list = array(); $i = 1; foreach ($result['users_deleted'] as $user) { $user_info = api_get_user_info($user); if (!empty($user_info)) { - $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']); + $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']); $i++; } } @@ -140,7 +140,7 @@ if (!empty($message)) { echo '
'; echo Display::url( Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), - api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php' + api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php' ); echo '
'; @@ -165,7 +165,7 @@ if ($ajax_search) { } $sql = "SELECT u.user_id, lastname, firstname, username - FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " . + FROM $tbl_user u WHERE status <> ".ANONYMOUS." ". $order_clause; $result = Database::query($sql); $Users = Database::store_result($result); @@ -178,11 +178,11 @@ if ($ajax_search) { } if ($add_type == 'multiple') { - $link_add_type_unique = '' . get_lang('SessionAddTypeUnique') . ''; + $link_add_type_unique = ''.get_lang('SessionAddTypeUnique').''; $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); } else { $link_add_type_unique = get_lang('SessionAddTypeUnique'); - $link_add_type_multiple = '' . get_lang('SessionAddTypeMultiple') . ''; + $link_add_type_multiple = ''.get_lang('SessionAddTypeMultiple').''; } $url_list = UrlManager::get_url_data(); ?> @@ -194,7 +194,7 @@ $url_list = UrlManager::get_url_data();
> - + ' . get_lang('Yes') . ' + ' . get_lang('Yes').'
@@ -1373,8 +1373,8 @@ function displayDatabaseParameter( echo ''; echo api_htmlentities($parameterValue); } else { - echo '
' . "
"; - echo '
' . $extra_notice . '
'; + echo '
'."
"; + echo '
'.$extra_notice.'
'; } } } @@ -1408,12 +1408,12 @@ function display_database_settings_form( $dbNameForm = $_configuration['main_database']; $dbPortForm = isset($_configuration['db_port']) ? $_configuration['db_port'] : ''; - echo '

' . display_step_sequence() .get_lang('DBSetting') . '

'; + echo '

'.display_step_sequence().get_lang('DBSetting').'

'; echo '
'; echo get_lang('DBSettingUpgradeIntro'); echo '
'; } else { - echo '

' . display_step_sequence() .get_lang('DBSetting') . '

'; + echo '

'.display_step_sequence().get_lang('DBSetting').'

'; echo '
'; echo get_lang('DBSettingIntro'); echo '
'; @@ -1423,12 +1423,12 @@ function display_database_settings_form(
- +
- +
@@ -1437,12 +1437,12 @@ function display_database_settings_form(
- +
- +
@@ -1468,7 +1468,7 @@ function display_database_settings_form( 'panel-heading')); $panelBody = Display::div($content, array('class' => 'panel-body')); - $panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); + $panelParent = Display::div($panelTitle.$panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); } else { $panelBody = Display::div($html, array('class' => 'panel-body')); $panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); @@ -1587,9 +1587,9 @@ function display_configuration_parameter( $displayWhenUpdate = 'true' ) { $html = '
'; - $html .= ''; + $html .= ''; if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) { - $html .= '' . $parameterValue; + $html .= ''.$parameterValue; } else { $html .= '
'."
"; } @@ -1637,7 +1637,7 @@ function display_configuration_settings_form( $languageForm = $_SESSION['install_language']; } echo '
'; - echo "

" . display_step_sequence() . get_lang("CfgSetting") . "

"; + echo "

".display_step_sequence().get_lang("CfgSetting")."

"; echo '
'; echo '

'.get_lang('ConfigSettingsInfo').' app/config/configuration.php

'; @@ -1655,14 +1655,14 @@ function display_configuration_settings_form( // Parameters 3 and 4: administrator's names - $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName); - $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName); + $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName); + $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName); //Parameter 3: administrator's email - $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm); + $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm); //Parameter 6: administrator's telephone - $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm); + $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm); echo panel($html, get_lang('Administrator'), 'administrator'); @@ -1681,12 +1681,12 @@ function display_configuration_settings_form( $html .= display_language_selection_box('languageForm', $languageForm); $html .= '
'; } - $html.= "
"; + $html .= "
"; //Second parameter: Chamilo URL $html .= '
'; - $html .= ''; + $html .= ''; @@ -1710,34 +1710,34 @@ function display_configuration_settings_form( $html .= '
- +
'; if ($installType == 'update') { - $html .= ''. $encryptPassForm; + $html .= ''.$encryptPassForm; } else { $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= '
- +
'; if ($installType == 'update') { if ($allowSelfReg == 'true') { @@ -1747,17 +1747,17 @@ function display_configuration_settings_form( } else { $label = get_lang('AfterApproval'); } - $html .= ''. $label; + $html .= ''.$label; } else { $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; } @@ -1765,7 +1765,7 @@ function display_configuration_settings_form( $html .= '
'; $html .= '
'; - $html .= ' + $html .= '
'; 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 -'); // This indentation is to make the generated html files to look well. +'); // This indentation is to make the generated html files to look well. fclose($fp); $document_id = add_document( @@ -191,7 +191,7 @@ class OpenofficePresentation extends OpenofficeDocument foreach ($specific_fields as $specific_field) { if (isset($_REQUEST[$specific_field['code']])) { $sterms = trim($_REQUEST[$specific_field['code']]); - $all_specific_terms .= ' '. $sterms; + $all_specific_terms .= ' '.$sterms; if (!empty($sterms)) { $sterms = explode(',', $sterms); foreach ($sterms as $sterm) { @@ -200,7 +200,7 @@ class OpenofficePresentation extends OpenofficeDocument } } } - $slide_body = $all_specific_terms .' '. $slide_body; + $slide_body = $all_specific_terms.' '.$slide_body; $ic_slide->addValue('content', $slide_body); /* FIXME: cidReq:lp_id:doc_id al indexar */ // Add a comment to say terms separated by commas. @@ -212,7 +212,7 @@ class OpenofficePresentation extends OpenofficeDocument SE_COURSE_ID => $courseid, SE_TOOL_ID => TOOL_LEARNPATH, SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id), - SE_USER => (int)api_get_user_id(), + SE_USER => (int) api_get_user_id(), ); $ic_slide->xapian_data = serialize($xapian_data); $di->addChunk($ic_slide); @@ -250,7 +250,7 @@ class OpenofficePresentation extends OpenofficeDocument $_course = api_get_course_info(); foreach ($files as $file) { // '||' is used as separator between slide name (with accents) and file name (without accents). - list($slide_name,$file_name) = explode('||',$file); + list($slide_name, $file_name) = explode('||', $file); $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset); $slide_name = str_replace('’', '\'', $slide_name); $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset); diff --git a/main/permissions/blog_permissions.inc.php b/main/permissions/blog_permissions.inc.php index f635477d0f..76e3da16b8 100755 --- a/main/permissions/blog_permissions.inc.php +++ b/main/permissions/blog_permissions.inc.php @@ -46,7 +46,7 @@ $course_id = api_get_course_int_id(); $tbl_course_rel_user = $table = Database::get_main_table(TABLE_MAIN_COURSE_USER); $sql = "SELECT user_id FROM $tbl_course_rel_user - WHERE status = '1' AND c_id = '" . api_get_course_int_id() . "'"; + WHERE status = '1' AND c_id = '".api_get_course_int_id()."'"; $result = Database::query($sql); while ($user = Database::fetch_assoc($result)) { unset($blog_users[$user['user_id']]); @@ -110,7 +110,7 @@ if (api_get_setting('group_roles') == 'true') { } } -echo ""; +echo ""; // --------------------------------------------------- // DISPLAYING THE ROLES LIST @@ -118,7 +118,7 @@ echo "' . get_lang('UserRoles') . '
'; + echo ''.get_lang('UserRoles').'
'; $current_user_course_roles = get_roles('user', $user_id); $current_user_platform_roles = get_roles('user', $user_id, 'platform'); display_role_list($current_user_course_roles, $current_user_platform_roles); @@ -132,24 +132,24 @@ echo "\n"; // the header echo "\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; echo "\t\n"; // Subheader echo "\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; echo "\t\n"; // the main area with the checkboxes or images @@ -171,7 +171,7 @@ foreach ($blog_users as $user_id => $user_name) { // $blog_users contains all th display_image_matrix_for_blogs( $current_user_permissions, $user_id, - 'BLOG_' . $blog_id, + 'BLOG_'.$blog_id, $value, (isset($inherited_permissions) ? $inherited_permissions : null), (isset($course_admin) ? $course_admin : null) @@ -190,7 +190,7 @@ echo "
" . get_lang('Module') . "" . get_lang('ArticleManager') . "" . get_lang('CommentManager') . "" . get_lang('BlogManager') . "".get_lang('Module')."".get_lang('ArticleManager')."".get_lang('CommentManager')."".get_lang('BlogManager')."
" . get_lang('Add') . "" . get_lang('Delete') . "" . get_lang('Edit') . "" . get_lang('Rate') . "" . get_lang('Add') . "" . get_lang('Delete') . "" . get_lang('Rate') . "" . get_lang('Tasks') . "" . get_lang('Members') . "" . get_lang('Roles') . "".get_lang('Add')."".get_lang('Delete')."".get_lang('Edit')."".get_lang('Rate')."".get_lang('Add')."".get_lang('Delete')."".get_lang('Rate')."".get_lang('Tasks')."".get_lang('Members')."".get_lang('Roles')."
\n"; echo "
"; // LEGEND -echo '' . get_lang('Legend') . '
'; -echo ' ' . get_lang('UserHasPermissionNot') . '
'; -echo ' ' . get_lang('UserHasPermission') . '
'; -echo ' ' . get_lang('UserHasPermissionByRoleGroup') . '
'; +echo ''.get_lang('Legend').'
'; +echo ' '.get_lang('UserHasPermissionNot').'
'; +echo ' '.get_lang('UserHasPermission').'
'; +echo ' '.get_lang('UserHasPermissionByRoleGroup').'
'; diff --git a/main/reports/modules/quiz.php b/main/reports/modules/quiz.php index 7c05d4e9da..8aed3e55b9 100755 --- a/main/reports/modules/quiz.php +++ b/main/reports/modules/quiz.php @@ -16,10 +16,10 @@ function reports_modules_quiz_init_forEachCourses($course_code, $course_id, $cou array_push($reports_modules['quiz'], array( 'keys_query' => - 'select ' . $course_id . ' as course_id, ' . - $reports_modules_quiz_toolid . ' as tool_id, ' . - 'q.id as child_id, q.title as child_name, ' . - "'" . $course_code . "'" . ' as course_code from ' . Database::get_course_table(TABLE_QUIZ_TEST) . ' q ', + 'select '.$course_id.' as course_id, '. + $reports_modules_quiz_toolid.' as tool_id, '. + 'q.id as child_id, q.title as child_name, '. + "'".$course_code."'".' as course_code from '.Database::get_course_table(TABLE_QUIZ_TEST).' q ', 'values_query_function' => 'reports_modules_quiz_quizVal' )); } @@ -30,12 +30,12 @@ function reports_modules_quiz_quizVal($quiz, $key_id) return array( 'type' => 'sql', 'sql' => - 'select ' . $key_id . ', exe_user_id as uid, ' . - 'session_id, -1 as attempt, exe_result as score, ' . - REPORTS_PROGRESS_COMPLETED . ' as progress, ' . - 'exe_duration as time, exe_date as ts from ' . - Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . - ' where c_id = ' . $courseId . - ' and exe_exo_id=' . $quiz['child_id'] + 'select '.$key_id.', exe_user_id as uid, '. + 'session_id, -1 as attempt, exe_result as score, '. + REPORTS_PROGRESS_COMPLETED.' as progress, '. + 'exe_duration as time, exe_date as ts from '. + Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES). + ' where c_id = '.$courseId. + ' and exe_exo_id='.$quiz['child_id'] ); } diff --git a/main/social/friends.php b/main/social/friends.php index b7fd8df13e..49ca15fefd 100755 --- a/main/social/friends.php +++ b/main/social/friends.php @@ -118,8 +118,8 @@ if (count($friends) == 0) { while ($j < $number_friends) { if (isset($friends[$j])) { $friend = $friends[$j]; - $toolBar = ''; $url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$friend['friend_user_id']; $friend['user_info']['complete_name'] = Display::url($friend['user_info']['complete_name'], $url); diff --git a/main/timeline/index.php b/main/timeline/index.php index 8900958179..770bdf37a5 100755 --- a/main/timeline/index.php +++ b/main/timeline/index.php @@ -23,19 +23,19 @@ $token = Security::get_token(); switch ($action) { case 'add': - $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline')); - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); + $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline')); + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); break; case 'edit': - $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline')); - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); + $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline')); + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); break; case 'add_item': - $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline')); - $interbreadcrumb[]=array('url' => '#','name' => get_lang('TimelineItem')); + $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline')); + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TimelineItem')); break; default: - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Timeline')); + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Timeline')); } //jqgrid will use this URL to do the selects @@ -46,8 +46,8 @@ $columns = array(get_lang('Name'), get_lang('Actions')); //Column config $column_model = array( - array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'), - array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false') + array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false') ); //Autowidth $extra_params['autowidth'] = 'true'; @@ -55,11 +55,11 @@ $extra_params['autowidth'] = 'true'; $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid (edit, delete, etc) -$htmlHeadXtra[] =' +$htmlHeadXtra[] = ' '; $toolbarAction = ''; @@ -80,12 +80,12 @@ switch ($action) { $values = $form->exportValues(); $res = $timeline->save($values); if ($res) { - $message = Display::return_message(get_lang('ItemAdded'),'success'); + $message = Display::return_message(get_lang('ItemAdded'), 'success'); } } $content = $timeline->listing(); } else { - $actions .= ''.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).''; + $actions .= ''.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $content = $form->return_form(); @@ -106,7 +106,7 @@ switch ($action) { } $timeline->display(); } else { - $actions = ''.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).''; + $actions = ''.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $content = $form->return_form(); @@ -128,7 +128,7 @@ switch ($action) { } $timeline->display(); } else { - $actions = ''.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).''; + $actions = ''.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $content = $form->return_form(); diff --git a/plugin/bbb/listing.php b/plugin/bbb/listing.php index 094c350698..14f1de610e 100755 --- a/plugin/bbb/listing.php +++ b/plugin/bbb/listing.php @@ -11,14 +11,14 @@ $plugin = BBBPlugin::create(); $tool_name = $plugin->get_lang('Videoconference'); $htmlHeadXtra[] = api_get_js_simple( - api_get_path(WEB_PLUGIN_PATH) . 'bbb/resources/utils.js' + api_get_path(WEB_PLUGIN_PATH).'bbb/resources/utils.js' ); -$htmlHeadXtra[] = ""; +$htmlHeadXtra[] = ""; $tpl = new Template($tool_name); $isGlobal = isset($_GET['global']) ? true : false; -$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id']: false; +$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false; $bbb = new bbb('', '', $isGlobal, $isGlobalPerUser); $action = isset($_GET['action']) ? $_GET['action'] : null; @@ -80,22 +80,22 @@ if ($conferenceManager) { case 'end': $bbb->endMeeting($_GET['id']); $message = Display::return_message( - $plugin->get_lang('MeetingClosed') . '
' . $plugin->get_lang( + $plugin->get_lang('MeetingClosed').'
'.$plugin->get_lang( 'MeetingClosedComment' ), 'success', false ); - if (file_exists(__DIR__ . '/config.vm.php')) { - require __DIR__ . '/../../vendor/autoload.php'; + if (file_exists(__DIR__.'/config.vm.php')) { + require __DIR__.'/../../vendor/autoload.php'; - require __DIR__ . '/lib/vm/AbstractVM.php'; - require __DIR__ . '/lib/vm/VMInterface.php'; - require __DIR__ . '/lib/vm/DigitalOceanVM.php'; - require __DIR__ . '/lib/VM.php'; + require __DIR__.'/lib/vm/AbstractVM.php'; + require __DIR__.'/lib/vm/VMInterface.php'; + require __DIR__.'/lib/vm/DigitalOceanVM.php'; + require __DIR__.'/lib/VM.php'; - $config = require __DIR__ . '/config.vm.php'; + $config = require __DIR__.'/config.vm.php'; $vm = new VM($config); $vm->resizeToMinLimit(); @@ -191,7 +191,7 @@ $content = $tpl->fetch($listing_tpl); if (api_is_platform_admin()) { $actionLinks = Display::toolbarButton( $plugin->get_lang('AdminView'), - api_get_path(WEB_PLUGIN_PATH) . 'bbb/admin.php', + api_get_path(WEB_PLUGIN_PATH).'bbb/admin.php', 'list', 'primary' ); diff --git a/plugin/buycourses/src/buy_course_plugin.class.php b/plugin/buycourses/src/buy_course_plugin.class.php index eba2381e4d..db6fb3ed8d 100644 --- a/plugin/buycourses/src/buy_course_plugin.class.php +++ b/plugin/buycourses/src/buy_course_plugin.class.php @@ -125,7 +125,7 @@ class BuyCoursesPlugin extends Plugin return false; } - require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php'; + require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php'; } /** @@ -174,10 +174,10 @@ class BuyCoursesPlugin extends Plugin $item = $this->getItemByProduct(intval($productId), $productType); $return['html'] = '
'; if ($item) { - $return['html'] .= ''. $item['iso_code'] .' ' . $item['price'] . ''; + $return['html'] .= ''.$item['iso_code'].' '.$item['price'].''; $return['verificator'] = true; } else { - $return['html'] .= ''. $this->get_lang('Free'). ''; + $return['html'] .= ''.$this->get_lang('Free').''; $return['verificator'] = false; } $return['html'] .= '
'; @@ -196,15 +196,15 @@ class BuyCoursesPlugin extends Plugin */ public function returnBuyCourseButton($productId, $productType) { - $url = api_get_path(WEB_PLUGIN_PATH) . - 'buycourses/src/process.php?i=' . - intval($productId) . - '&t=' . + $url = api_get_path(WEB_PLUGIN_PATH). + 'buycourses/src/process.php?i='. + intval($productId). + '&t='. $productType ; - $html = ' ' . - Display::returnFontAwesomeIcon('fa fa-shopping-cart') . ''; + $html = ' '. + Display::returnFontAwesomeIcon('fa fa-shopping-cart').''; return $html; } @@ -749,7 +749,7 @@ class BuyCoursesPlugin extends Plugin ); if (!empty($sessionImage)) { - $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value']; + $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value']; } $sessionCourses = $session->getCourses(); @@ -1202,7 +1202,7 @@ class BuyCoursesPlugin extends Plugin $str = ''; - srand((double)microtime() * 1000000); + srand((double) microtime() * 1000000); for ($i = 0; $i < $length; $i++) { $numbers = rand(0, strlen($salt) - 1); @@ -1544,8 +1544,8 @@ class BuyCoursesPlugin extends Plugin */ public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false) { - $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : ''; - $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : ''; + $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : ''; + $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : ''; $typeResult = ($condition) ? 'first' : 'all'; $payoutsTable = Database::get_main_table(self::TABLE_PAYPAL_PAYOUTS); $saleTable = Database::get_main_table(self::TABLE_SALE); @@ -1572,14 +1572,14 @@ class BuyCoursesPlugin extends Plugin INNER JOIN $saleTable s ON s.id = p.sale_id INNER JOIN $currencyTable c ON s.currency_id = c.id LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id - AND field_id = " . intval($paypalExtraField['id']) . " + AND field_id = ".intval($paypalExtraField['id'])." "; $payouts = Database::select( "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code", "$payoutsTable p $innerJoins", [ - 'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status] + 'where' => ['p.status = ? '.$condition.' '.$condition2 => $status] ], $typeResult ); @@ -1642,7 +1642,7 @@ class BuyCoursesPlugin extends Plugin $platformCommission = $this->getPlatformCommission(); $sale = $this->getSale($saleId); - $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2); + $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2); $beneficiaries = $this->getBeneficiariesBySale($saleId); @@ -1654,7 +1654,7 @@ class BuyCoursesPlugin extends Plugin 'payout_date' => getdate(), 'sale_id' => intval($saleId), 'user_id' => $beneficiary['user_id'], - 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2), + 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2), 'status' => self::PAYOUT_STATUS_PENDING ] ); @@ -2252,17 +2252,17 @@ class BuyCoursesPlugin extends Plugin */ public function getPath($var) { - $pluginPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/'; + $pluginPath = api_get_path(WEB_PLUGIN_PATH).'buycourses/'; $paths = [ - 'SERVICE_IMAGES' => $pluginPath . 'uploads/services/images/', - 'SRC' => $pluginPath . 'src/', - 'VIEW' => $pluginPath . 'view/', - 'UPLOADS' => $pluginPath . 'uploads/', - 'LANGUAGES' => $pluginPath . 'lang/', - 'RESOURCES' => $pluginPath . 'resources/', - 'RESOURCES_IMG' => $pluginPath . 'resources/img/', - 'RESOURCES_CSS' => $pluginPath . 'resources/css/', - 'RESOURCES_JS' => $pluginPath . 'resources/js/', + 'SERVICE_IMAGES' => $pluginPath.'uploads/services/images/', + 'SRC' => $pluginPath.'src/', + 'VIEW' => $pluginPath.'view/', + 'UPLOADS' => $pluginPath.'uploads/', + 'LANGUAGES' => $pluginPath.'lang/', + 'RESOURCES' => $pluginPath.'resources/', + 'RESOURCES_IMG' => $pluginPath.'resources/img/', + 'RESOURCES_CSS' => $pluginPath.'resources/css/', + 'RESOURCES_JS' => $pluginPath.'resources/js/', ]; return $paths[$var]; diff --git a/plugin/buycourses/src/process.php b/plugin/buycourses/src/process.php index 2b0dbea605..00a0404ad6 100644 --- a/plugin/buycourses/src/process.php +++ b/plugin/buycourses/src/process.php @@ -33,7 +33,7 @@ if (!isset($_REQUEST['t'], $_REQUEST['i'])) { $buyingCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_COURSE; $buyingSession = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_SESSION; -$queryString = 'i=' . intval($_REQUEST['i']) . '&t=' . intval($_REQUEST['t']); +$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']); if ($buyingCourse) { $courseInfo = $plugin->getCourseInfo($_REQUEST['i']); @@ -54,7 +54,7 @@ if ($form->validate()) { Display::addFlash( Display::return_message($plugin->get_lang('NeedToSelectPaymentType'), 'error', false) ); - header('Location:' . api_get_self() . '?' . $queryString); + header('Location:'.api_get_self().'?'.$queryString); exit; } @@ -62,7 +62,7 @@ if ($form->validate()) { if ($saleId !== false) { $_SESSION['bc_sale_id'] = $saleId; - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/process_confirm.php'); + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process_confirm.php'); } exit; diff --git a/plugin/buycourses/src/sales_report.php b/plugin/buycourses/src/sales_report.php index a481dc844e..6b173af57d 100644 --- a/plugin/buycourses/src/sales_report.php +++ b/plugin/buycourses/src/sales_report.php @@ -25,7 +25,7 @@ if (isset($_GET['order'])) { api_not_allowed(true); } - $urlToRedirect = api_get_self() . '?'; + $urlToRedirect = api_get_self().'?'; switch ($_GET['action']) { case 'confirm': @@ -94,10 +94,10 @@ $form->addRadio( get_lang('Filter'), [$plugin->get_lang('ByStatus'), $plugin->get_lang('ByUser')] ); -$form->addHtml('
'); +$form->addHtml('
'); $form->addSelect('status', $plugin->get_lang('OrderStatus'), $saleStatuses); $form->addHtml('
'); -$form->addHtml('
'); +$form->addHtml('
'); $form->addText('user', get_lang('UserName'), false); $form->addHtml('
'); $form->addButtonFilter(get_lang('Search')); @@ -142,7 +142,7 @@ $template = new Template($templateName); if ($paypalEnable == "true" && $commissionsEnable == "true") { $toolbar = Display::toolbarButton( $plugin->get_lang('PaypalPayoutCommissions'), - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/paypal_payout.php', + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php', 'paypal', 'primary', ['title' => $plugin->get_lang('PaypalPayoutCommissions')] @@ -157,7 +157,7 @@ if ($paypalEnable == "true" && $commissionsEnable == "true") { if ($commissionsEnable == "true") { $toolbar = Display::toolbarButton( $plugin->get_lang('PayoutReport'), - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/payout_report.php', + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php', 'money', 'info', ['title' => $plugin->get_lang('PayoutReport')] diff --git a/plugin/buycourses/src/service_sales_report.php b/plugin/buycourses/src/service_sales_report.php index 4115efc8bc..382a6d583a 100644 --- a/plugin/buycourses/src/service_sales_report.php +++ b/plugin/buycourses/src/service_sales_report.php @@ -54,7 +54,7 @@ $template = new Template($templateName); if ($paypalEnable == 'true' && $commissionsEnable == 'true') { $toolbar = Display::toolbarButton( $plugin->get_lang('PaypalPayoutCommissions'), - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/paypal_payout.php', + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php', 'paypal', 'primary', ['title' => $plugin->get_lang('PaypalPayoutCommissions')] @@ -69,7 +69,7 @@ if ($paypalEnable == 'true' && $commissionsEnable == 'true') { if ($commissionsEnable == 'true') { $toolbar = Display::toolbarButton( $plugin->get_lang('PayoutReport'), - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/payout_report.php', + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php', 'money', 'info', ['title' => $plugin->get_lang('PayoutReport')] diff --git a/plugin/openmeetings/lib/openmeetings_rest_service.php b/plugin/openmeetings/lib/openmeetings_rest_service.php index 09fe318308..4411d58337 100755 --- a/plugin/openmeetings/lib/openmeetings_rest_service.php +++ b/plugin/openmeetings/lib/openmeetings_rest_service.php @@ -40,31 +40,31 @@ class OpenMeetingsRestService // $request // Initialize the session by passing the request as a parameter - $session = curl_init ( $request ); + $session = curl_init($request); // Set curl options by passing session and flags // CURLOPT_HEADER allows us to receive the HTTP header - curl_setopt ( $session, CURLOPT_HEADER, true ); + curl_setopt($session, CURLOPT_HEADER, true); // CURLOPT_RETURNTRANSFER will return the response - curl_setopt ( $session, CURLOPT_RETURNTRANSFER, true ); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Make the request - $response = curl_exec ( $session ); + $response = curl_exec($session); // Close the curl session - curl_close ( $session ); + curl_close($session); // Confirm that the request was transmitted to the OpenMeetings! Image Search Service - if (! $response) { - die ( "Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()' ); + if (!$response) { + die ("Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()'); } // Create an array to store the HTTP response codes - $status_code = array (); + $status_code = array(); // Use regular expressions to extract the code from the header - preg_match ( '/\d\d\d/', $response, $status_code ); + preg_match('/\d\d\d/', $response, $status_code); $bt = debug_backtrace(); $caller = array_shift($bt); $extra = ' (from '.$caller['file'].' at line '.$caller['line'].') '; @@ -74,24 +74,24 @@ class OpenMeetingsRestService // Success break; case 503 : - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503. + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503. That means: Service unavailable. An internal problem prevented us from returning data to you.' ); return false; break; case 403 : - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403. + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403. That means: Forbidden. You do not have permission to access this resource, or are over your rate limit.' ); return false; break; case 400 : // You may want to fall through here and read the specific XML error - error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400. + error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400. That means: Bad request. The parameters passed to the service did not match as expected. The exact error is returned in the XML response.' ); return false; break; default: - error_log( 'Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: ' . $status_code [0] . " Request " . $request ); + error_log('Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: '.$status_code [0]." Request ".$request); return false; } diff --git a/plugin/vchamilo/views/syncparams.php b/plugin/vchamilo/views/syncparams.php index daeb2cc25f..745b2914b1 100644 --- a/plugin/vchamilo/views/syncparams.php +++ b/plugin/vchamilo/views/syncparams.php @@ -46,7 +46,7 @@ foreach ($settings as $param) { isset($param['subkey']) && !empty($param['subkey']) ? $param['variable'].' ['.$param['subkey'].']' : $param['variable'], $param['category'], $param['access_url'], - ''. + ''. '
Master value: '.$param['selected_value'], $syncButton, ); @@ -56,8 +56,8 @@ foreach ($settings as $param) { $content = '
'; $content .= ''; -$content .= $table->toHtml(); -$content .= '
'; +$content .= $table->toHtml(); +$content .= ''; Display::addFlash(Display::return_message($plugin->get_lang('Sync your master settings to all instances.'))); diff --git a/src/Chamilo/CoreBundle/Component/Editor/Connector.php b/src/Chamilo/CoreBundle/Component/Editor/Connector.php index 9ce1f5db1e..f340171e60 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/Connector.php +++ b/src/Chamilo/CoreBundle/Component/Editor/Connector.php @@ -328,7 +328,7 @@ class Connector { return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot) ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true - : null; // else elFinder decide it itself + : null; // else elFinder decide it itself } /** diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Wiki.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Wiki.php index b6bb7a09d7..16c9ce269b 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Wiki.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Wiki.php @@ -63,6 +63,6 @@ class Wiki extends Resource public function show() { parent::show(); - echo $this->reflink.' ('. (empty($this->group_id) ? get_lang('Everyone') : get_lang('Group') . ' ' . $this->group_id) .') ' . '(' . $this->dtime . ')'; + echo $this->reflink.' ('.(empty($this->group_id) ? get_lang('Everyone') : get_lang('Group').' '.$this->group_id).') '.'('.$this->dtime.')'; } }