From c7d5d8ef313b7d7e7210661ea52ed10fcba87441 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 17 Jun 2021 09:51:11 +0200 Subject: [PATCH] Minor - format code --- .../vue/components/course/CourseToolList.vue | 2 +- .../lib/fe/linkaddeditform.class.php | 3 +- .../main/inc/lib/internationalization.lib.php | 93 +------------------ public/main/lp/LearnPathItemForm.php | 3 +- public/main/lp/learnpath.class.php | 3 +- src/CoreBundle/Component/Editor/Editor.php | 11 --- 6 files changed, 7 insertions(+), 108 deletions(-) diff --git a/assets/vue/components/course/CourseToolList.vue b/assets/vue/components/course/CourseToolList.vue index 8e4268cdf8..2f4c251fc0 100644 --- a/assets/vue/components/course/CourseToolList.vue +++ b/assets/vue/components/course/CourseToolList.vue @@ -46,7 +46,7 @@ import {mapGetters} from "vuex"; export default { - name: 'HomeCourseCard', + name: 'CourseToolList', props: { course: Object, tool: Object, diff --git a/public/main/gradebook/lib/fe/linkaddeditform.class.php b/public/main/gradebook/lib/fe/linkaddeditform.class.php index 58482f8e42..f3836cda73 100644 --- a/public/main/gradebook/lib/fe/linkaddeditform.class.php +++ b/public/main/gradebook/lib/fe/linkaddeditform.class.php @@ -184,7 +184,8 @@ class LinkAddEditForm extends FormValidator // ELEMENT: visible $visible = (self::TYPE_EDIT == $form_type && $link->is_visible()) ? '1' : '0'; - $this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible); + //$this->addCheckBox('visible', null, get_lang('Visible'), $visible); + $this->addCheckBox('visible', null, get_lang('Visible')); if (self::TYPE_EDIT == $form_type) { $defaults['visible'] = $link->is_visible(); } diff --git a/public/main/inc/lib/internationalization.lib.php b/public/main/inc/lib/internationalization.lib.php index 918e27fafc..9a15f46f9f 100644 --- a/public/main/inc/lib/internationalization.lib.php +++ b/public/main/inc/lib/internationalization.lib.php @@ -768,7 +768,7 @@ function api_is_western_name_order($format = null, $language = null) } if (empty($language)) { - $language = api_get_language_isocode(false, true); + $language = api_get_language_isocode(); } if (!isset($order[$format][$language])) { $test_name = api_get_person_name('%f', '%l', '%t', $format, $language); @@ -798,7 +798,7 @@ function api_sort_by_first_name($language = null) static $sort_by_first_name = []; if (empty($language)) { - $language = api_get_language_isocode(false, true); + $language = api_get_language_isocode(); } if (!isset($sort_by_first_name[$language])) { $sort_by_first_name[$language] = _api_get_person_name_convention($language, 'sort_by'); @@ -1202,23 +1202,6 @@ function api_strrchr($haystack, $needle, $before_needle = false, $encoding = nul return strrchr($haystack, $needle); } -/** - * Reverses a string. - * - * @param string $string the string to be reversed - * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the - * platform character set will be used by default. - * - * @return string Returns the reversed string. - * This function is aimed at replacing the function strrev() for human-language strings. - * - * @see http://php.net/manual/en/function.strrev - */ -function api_strrev($string, $encoding = null) -{ - return strrev($string); -} - /** * Finds the position of last occurrence (case insensitive) of a string in a string. * @@ -1953,78 +1936,6 @@ function &_api_get_day_month_names($language = null) return $date_parts[$language]; } -function getIsoToLegacy() -{ - return array_flip(getLegacyToIso()); -} - -function getLegacyToIso() -{ - return [ - 'asturian' => 'ast_ES', - 'basque' => 'eu_ES', - 'bengali' => 'bn', - 'bosnian' => 'bs', - 'brazilian' => 'pt_BR', - 'bulgarian' => 'bg', - 'catalan' => 'ca_ES', - 'croatian' => 'hr', - 'czech' => 'cs', - 'danish' => 'da', - 'dari' => 'fa_AF', - 'dutch' => 'nl', - 'english' => 'en_US', - 'estonian' => 'et', - 'esperanto' => 'eo', - 'faroese' => 'fo', - 'finnish' => 'fi', - 'french' => 'fr', - 'friulian' => 'fur_IT', - 'galician' => 'gl_ES', - 'georgian' => 'ka', - 'german' => 'de', - 'greek' => 'el', - 'hebrew' => 'he', - 'hindi' => 'hi', - 'hungarian' => 'hu', - 'indonesian' => 'id', - 'italian' => 'it', - 'japanese' => 'ja', - 'korean' => 'ko', - 'latvian' => 'lv', - 'lithuanian' => 'lt', - 'macedonian' => 'mk', - 'malay' => 'ms', - 'norwegian' => 'nn', - 'occitan' => 'oc_FR', - 'pashto' => 'ps', - 'persian' => 'fa', - 'polish' => 'pl', - 'portuguese' => 'pt', - 'quechua_cusco' => 'qu', - 'romanian' => 'ro', - 'russian' => 'ru', - 'serbian' => 'sr', - 'simpl_chinese' => 'zh_CN', - 'slovak' => 'sk', - 'slovenian' => 'sl', - 'somali' => 'so', - 'spanish' => 'es', - 'spanish_latin' => 'es_MX', - 'swahili' => 'sw', - 'swedish' => 'sv', - 'tagalog' => 'tl', - 'thai' => 'th', - 'tibetan' => 'bo', - 'trad_chinese' => 'zh_TW', - 'turkish' => 'tr', - 'ukrainian' => 'uk', - 'vietnamese' => 'vi', - 'xhosa' => 'xh', - 'yoruba' => 'yo', - ]; -} - /** * Returns returns person name convention for a given language. * diff --git a/public/main/lp/LearnPathItemForm.php b/public/main/lp/LearnPathItemForm.php index 1d28421800..0d99019246 100644 --- a/public/main/lp/LearnPathItemForm.php +++ b/public/main/lp/LearnPathItemForm.php @@ -39,9 +39,8 @@ class LearnPathItemForm $itemDescription = $lpItem->getDescription(); $parentItemId = $lpItem->getParentItemId(); $itemType = $lpItem->getItemType(); - $previousItemId = $lpItem->getPreviousItemId(); + //$previousItemId = $lpItem->getPreviousItemId(); - $count = count($arrLP); // Parent $parentSelect = $form->addSelect( 'parent', diff --git a/public/main/lp/learnpath.class.php b/public/main/lp/learnpath.class.php index 8c658ea0bb..72562ab0ab 100644 --- a/public/main/lp/learnpath.class.php +++ b/public/main/lp/learnpath.class.php @@ -6588,8 +6588,7 @@ class learnpath $form->setDefaults(['if_exists' => $defaultFileExistsOption]); // Check box options - $form->addElement( - 'checkbox', + $form->addCheckBox( 'unzip', get_lang('Options'), get_lang('Uncompress zip') diff --git a/src/CoreBundle/Component/Editor/Editor.php b/src/CoreBundle/Component/Editor/Editor.php index c52c7ec722..154a1fc876 100644 --- a/src/CoreBundle/Component/Editor/Editor.php +++ b/src/CoreBundle/Component/Editor/Editor.php @@ -24,9 +24,6 @@ class Editor */ public string $toolbarSet; - /** - * Initial value. - */ public string $value; public array $config; @@ -144,14 +141,6 @@ class Editor } } - /** - * @return string - */ - public function getLocale() - { - return api_get_language_isocode(); - } - /** * Converts a PHP variable into its Javascript equivalent. * The code of this method has been "borrowed" from the function drupal_to_js() within the Drupal CMS.