From 6b5937c48c0ceaca1ba26232eae134434b7147a6 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 10 Jun 2016 10:40:49 -0500 Subject: [PATCH 1/6] Fix link to translate extra field options - refs BT#11015 --- main/extrafield/translate.php | 3 ++- main/inc/lib/extra_field.lib.php | 21 +++++++++++++-------- main/inc/lib/extra_field_option.lib.php | 13 +++++-------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/main/extrafield/translate.php b/main/extrafield/translate.php index 4521522f67..55ad9143fe 100644 --- a/main/extrafield/translate.php +++ b/main/extrafield/translate.php @@ -10,6 +10,7 @@ api_protect_admin_script(); $em = Database::getManager(); $extraFieldInfo = null; +$extraFieldOptionInfo = null; $variableLanguage = null; $originalName = null; @@ -23,7 +24,7 @@ if (isset($_GET['extra_field'])) { $originalName = $extraFieldOptionInfo['display_text']; } -if (empty($extraFieldInfo) || empty($variableLanguage) || empty($originalName)) { +if ((empty($extraFieldInfo) && empty($extraFieldOptionInfo)) || empty($variableLanguage) || empty($originalName)) { api_not_allowed(true); } diff --git a/main/inc/lib/extra_field.lib.php b/main/inc/lib/extra_field.lib.php index 5088b2edf7..a9e82106b0 100755 --- a/main/inc/lib/extra_field.lib.php +++ b/main/inc/lib/extra_field.lib.php @@ -1763,14 +1763,19 @@ EOF; $form->addElement('header', $header); - $translateUrl = api_get_path(WEB_CODE_PATH) . 'extrafield/translate.php?' . http_build_query([ - 'extra_field' => $id - ]); - $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link'); - $form->addText( - 'display_text', - [get_lang('Name'), $translateButton] - ); + if ($action == 'edit') { + $translateUrl = api_get_path(WEB_CODE_PATH) . 'extrafield/translate.php?' . http_build_query([ + 'extra_field' => $id + ]); + $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link'); + + $form->addText( + 'display_text', + [get_lang('Name'), $translateButton] + ); + } else { + $form->addElement('text', 'display_text', get_lang('Name')); + } // Field type $types = self::get_field_types(); diff --git a/main/inc/lib/extra_field_option.lib.php b/main/inc/lib/extra_field_option.lib.php index b9ca30ce4d..3098ad4c50 100755 --- a/main/inc/lib/extra_field_option.lib.php +++ b/main/inc/lib/extra_field_option.lib.php @@ -616,18 +616,15 @@ class ExtraFieldOption extends Model $form->addElement('hidden', 'field_id', $this->field_id); if ($action == 'edit') { - $platformLanguage = api_get_setting('platformLanguage'); - $languageId = api_get_language_id($platformLanguage); - $languageInfo = api_get_language_info($languageId); - $translateUrl = api_get_path(WEB_CODE_PATH) . 'admin/sub_language.php?' . http_build_query([ - 'id' => $languageInfo['parent_id'], - 'action' => 'registersublanguage', - 'sub_language_id' => $languageInfo['id'], + $translateUrl = api_get_path(WEB_CODE_PATH) . 'extrafield/translate.php?' . http_build_query([ 'extra_field_option' => $id ]); $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link'); - $form->addElement('text', 'display_text', [get_lang('Name'), $translateButton]); + $form->addText( + 'display_text', + [get_lang('Name'), $translateButton] + ); } else { $form->addElement('text', 'display_text', get_lang('Name')); } From 2f5df59223dcbd41d24b939ee5b944dbf18db121 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 10 Jun 2016 13:21:15 -0500 Subject: [PATCH 2/6] Show extra field options display-text translated - refs BT#11015 --- main/admin/extra_field_options.php | 2 +- main/inc/ajax/model.ajax.php | 14 ++-- main/inc/lib/extra_field_option.lib.php | 83 +++++++++++++++---- src/Chamilo/CoreBundle/Entity/ExtraField.php | 2 +- .../CoreBundle/Entity/ExtraFieldOptions.php | 2 +- 5 files changed, 74 insertions(+), 29 deletions(-) diff --git a/main/admin/extra_field_options.php b/main/admin/extra_field_options.php index 82d0e89224..3257b51770 100755 --- a/main/admin/extra_field_options.php +++ b/main/admin/extra_field_options.php @@ -172,7 +172,7 @@ switch ($action) { if ($check) { $values = $form->exportValues(); $res = $obj->update($values); - Display::display_confirmation_message(sprintf(get_lang('ItemUpdated'), $values['name']), false); + Display::display_confirmation_message(sprintf(get_lang('ItemUpdated'), $values['display_text']), false); } $obj->display(); } else { diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index 656c0a0d6a..68e56206f2 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -1526,15 +1526,11 @@ switch ($action) { case 'get_extra_field_options': $obj = new ExtraFieldOption($type); $columns = array('display_text', 'option_value', 'option_order'); - $result = Database::select( - '*', - $obj->table, - array( - 'where' => array("field_id = ? " => $field_id), - 'order' => "$sidx $sord", - 'LIMIT' => "$start , $limit", - ) - ); + $result = $obj->get_all([ + 'where' => array("field_id = ? " => $field_id), + 'order' => "$sidx $sord", + 'LIMIT' => "$start , $limit" + ]); break; case 'get_usergroups_teacher': $columns = array('name', 'users', 'status', 'group_type', 'actions'); diff --git a/main/inc/lib/extra_field_option.lib.php b/main/inc/lib/extra_field_option.lib.php index 3098ad4c50..245c85af9d 100755 --- a/main/inc/lib/extra_field_option.lib.php +++ b/main/inc/lib/extra_field_option.lib.php @@ -411,36 +411,70 @@ class ExtraFieldOption extends Model * Gets an array of options for a specific field * @param int $field_id The field ID * @param bool $add_id_in_array Whether to add the row ID in the result - * @param string $ordered_by Extra ordering query bit - * @result mixed Row on success, false on failure - * @assert (0, '') === false + * @param null $ordered_by Extra ordering query bit + * @return array The options if they exists. Otherwise return false */ public function get_field_options_by_field($field_id, $add_id_in_array = false, $ordered_by = null) { $field_id = intval($field_id); - $sql = "SELECT * FROM {$this->table} - WHERE field_id = $field_id "; + $orderBy = null; + + switch ($ordered_by) { + case 'id': + $orderBy = ['id' => 'ASC']; + break; + case 'field_id': + $orderBy = ['fieldId' => 'ASC']; + break; + case 'option_value': + $orderBy = ['optionValue' => 'ASC']; + break; + case 'display_text': + $orderBy = ['displayText' => 'ASC']; + break; + case 'priority': + $orderBy = ['priority' => 'ASC']; + break; + case 'priority_message': + $orderBy = ['priorityMessage' => 'ASC']; + break; + case 'option_order': + $orderBy = ['optionOrder' => 'ASC']; + break; + } + + $result = Database::getManager() + ->getRepository('ChamiloCoreBundle:ExtraFieldOptions') + ->findBy(['field' => $field_id], $orderBy); - if (!empty($ordered_by)) { - $sql .= " ORDER BY $ordered_by "; + if (!$result) { + return false; } - $result = Database::query($sql); - if (Database::num_rows($result) > 0) { + $options = []; + + foreach ($result as $row) { + $option = [ + 'id' => $row->getId(), + 'field_id' => $row->getField()->getId(), + 'option_value' => $row->getValue(), + 'display_text' => $row->getDisplayText(), + 'priority' => $row->getPriority(), + 'priority_message' => $row->getPriorityMessage(), + 'option_order' => $row->getOptionOrder() + ]; + if ($add_id_in_array) { - $options = array(); - while ($row = Database::fetch_array($result, 'ASSOC')) { - $options[$row['id']] = $row; - } + $options[$row->getId()] = $option; - return $options; - } else { - return Database::store_result($result, 'ASSOC'); + continue; } + + $options[] = $option; } - return false; + return $options; } /** @@ -772,4 +806,19 @@ class ExtraFieldOption extends Model return $objExtraField->get($extraField->getId(), $translateDisplayText); } + + /** + * @param null $options + * @return array + */ + public function get_all($options = null) + { + $result = parent::get_all($options); + + foreach ($result as &$row) { + $row['display_text'] = self::translateDisplayName($row['display_text']); + } + + return $result; + } } diff --git a/src/Chamilo/CoreBundle/Entity/ExtraField.php b/src/Chamilo/CoreBundle/Entity/ExtraField.php index 8a8d0e3334..14abc61fe6 100644 --- a/src/Chamilo/CoreBundle/Entity/ExtraField.php +++ b/src/Chamilo/CoreBundle/Entity/ExtraField.php @@ -185,7 +185,7 @@ class ExtraField extends BaseAttribute */ public function getDisplayText() { - return $this->displayText; + return \ExtraField::translateDisplayName($this->variable, $this->displayText); } /** diff --git a/src/Chamilo/CoreBundle/Entity/ExtraFieldOptions.php b/src/Chamilo/CoreBundle/Entity/ExtraFieldOptions.php index 3e8fddfe9e..f27f993384 100644 --- a/src/Chamilo/CoreBundle/Entity/ExtraFieldOptions.php +++ b/src/Chamilo/CoreBundle/Entity/ExtraFieldOptions.php @@ -139,7 +139,7 @@ class ExtraFieldOptions */ public function getDisplayText() { - return $this->displayText; + return \ExtraFieldOption::translateDisplayName($this->displayText); } /** From bab90178a55f1dfc5c34f61732c161534852b6bc Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 9 Jun 2016 18:18:39 -0500 Subject: [PATCH 3/6] Integrate Skype plugin - refs BT#11956 --- main/inc/lib/social.lib.php | 1 + main/social/profile.php | 17 ++++++----- main/template/default/social/user_block.tpl | 32 +++++++++++++++++++-- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index d309982b36..9e430d440d 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -1735,6 +1735,7 @@ class SocialManager extends UserManager $template->assign('chat_enabled', $chatEnabled); $template->assign('user_relation', $userRelationType); $template->assign('user_relation_type_friend', USER_RELATION_TYPE_FRIEND); + $template->assign('show_full_profile', $show_full_profile); $templateName = $template->get_template('social/user_block.tpl'); if (in_array($groupBlock, ['groups', 'group_edit', 'member_list'])) { diff --git a/main/social/profile.php b/main/social/profile.php index d8a1312543..0db6242417 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -346,6 +346,9 @@ if ($show_full_profile) { $extra_information_value = '
    '; $extraField = new ExtraField('user'); foreach ($extra_user_data as $key => $data) { + if (empty($data)) { + continue; + } // Avoiding parameters if (in_array( $key, @@ -364,6 +367,10 @@ if ($show_full_profile) { $field_variable ); + if (in_array($extraFieldInfo['variable'], ['skype', 'linkedin_url'])) { + break; + } + if ($extraFieldInfo['visible'] != 1) { continue; } @@ -420,15 +427,7 @@ if ($show_full_profile) { $extra_information_value .= '
  • '.$data.'
  • '; break; default: - if (!empty($data)) { - $extra_field_title = ucfirst($extraFieldInfo['display_text']); - if ($extra_field_title == 'Skype') { - $data = '' . get_lang('Chat') . ''; - $extra_information_value .= '
  • '.Display::return_icon('skype.png', $extraFieldInfo['display_text'], null, ICON_SIZE_TINY, false) . ' ' . $data.'
  • '; - } else { - $extra_information_value .= '
    '.ucfirst($extraFieldInfo['display_text']).':
    '.$data.'
    '; - } - } + $extra_information_value .= '
  • '.ucfirst($extraFieldInfo['display_text']) . ': ' . $data . '
  • '; break; } } diff --git a/main/template/default/social/user_block.tpl b/main/template/default/social/user_block.tpl index 607e74f4bb..731ff2af67 100644 --- a/main/template/default/social/user_block.tpl +++ b/main/template/default/social/user_block.tpl @@ -17,7 +17,7 @@
  • {{ user.complete_name }}
  • - {% if vcard_user_link %} + {% if show_full_profile %}
  • {{ @@ -30,6 +30,34 @@ {{ "BusinessCard" | get_lang }}
  • + + {% set skype_account = '' %} + {% set linkedin_url = '' %} + {% for extra in user.extra %} + {% if extra.value.getField().getVariable() == 'skype' %} + {% set skype_account = extra.value.getValue() %} + {% endif %} + + {% if extra.value.getField().getVariable() == 'linkedin_url' %} + {% set linkedin_url = extra.value.getValue() %} + {% endif %} + {% endfor %} + + {% if 'allow_show_skype_account'|get_setting == 'true' and not skype_account is empty %} +
  • + + {{ 'Skype'|get_lang }} + +
  • + {% endif %} + + {% if 'allow_show_linkedin_url'|get_setting == 'true' and not linkedin_url is empty %} +
  • + + {{ 'LinkedIn'|get_lang }} + +
  • + {% endif %} {% endif %} {% if chat_enabled == 1 %} {% if user.user_is_online_in_chat != 0 %} @@ -49,7 +77,7 @@ {% if not profile_edition_link is empty %}
  • - + {{ "EditProfile" | get_lang }}
  • From 1f8caef326f2717252fe2dbe0a5cd7d59e62111b Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 9 Jun 2016 18:29:08 -0500 Subject: [PATCH 4/6] Skype plugin deprecated - refs BT#11956 --- plugin/skype/README.md | 32 +++++++++++++++- plugin/skype/config.php | 9 ----- plugin/skype/index.php | 6 --- plugin/skype/install.php | 10 ----- plugin/skype/lang/english.php | 2 + plugin/skype/lang/spanish.php | 2 + plugin/skype/plugin.php | 1 - plugin/skype/src/HookSkype.php | 34 ----------------- plugin/skype/src/Skype.php | 67 +++------------------------------- plugin/skype/uninstall.php | 10 ----- 10 files changed, 41 insertions(+), 132 deletions(-) delete mode 100644 plugin/skype/config.php delete mode 100644 plugin/skype/install.php delete mode 100644 plugin/skype/src/HookSkype.php delete mode 100644 plugin/skype/uninstall.php diff --git a/plugin/skype/README.md b/plugin/skype/README.md index 52581bb158..85690145c4 100644 --- a/plugin/skype/README.md +++ b/plugin/skype/README.md @@ -1,4 +1,34 @@ Skype Plugin ============== -Create Skype user field +This pluging was integrated within Chamilo LMS core + +To configure this plugin you need execute this SQL queries: + +* Enable the Skype extra field: +``` +INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) +VALUES +(1, 1, 'skype', 'Skype', 1, 1, now()); +``` +* Enable the LinkedInURl extra field: +``` +INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) +VALUES +(1, 1, 'linkedin_url', 'LinkedInUrl', 1, 1, now()); +``` +* Enable the configuration settings: +``` +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, access_url_changeable) +VALUES +('allow_show_skype_account', NULL, 'radio', 'Course', 'true', 'AllowShowSkypeAccountTitle', 'AllowShowSkypeAccountComment', 1), +('allow_show_linkedin_url', NULL, 'radio', 'Course', 'true', 'AllowShowLinkedInUrlTitle', 'AllowShowLinkedInUrlComment', 1); +``` +``` +INSERT INTO settings_options (variable, value, display_text) +VALUES +('allow_show_skype_account', 'true', 'Yes'), +('allow_show_skype_account', 'false', 'No'), +('allow_show_linkedin_url', 'true', 'Yes'), +('allow_show_linkedin_url', 'false', 'No'); +``` diff --git a/plugin/skype/config.php b/plugin/skype/config.php deleted file mode 100644 index 4fd8b4a6d1..0000000000 --- a/plugin/skype/config.php +++ /dev/null @@ -1,9 +0,0 @@ - - * @package chamilo.plugin.skype - */ - -require_once api_get_path(SYS_PATH) . 'main/inc/global.inc.php'; diff --git a/plugin/skype/index.php b/plugin/skype/index.php index a9c71a002f..bcecba1566 100644 --- a/plugin/skype/index.php +++ b/plugin/skype/index.php @@ -1,8 +1,2 @@ - * @package chamilo.plugin.skype - */ -require_once __DIR__ . '/config.php'; diff --git a/plugin/skype/install.php b/plugin/skype/install.php deleted file mode 100644 index 23be3530f3..0000000000 --- a/plugin/skype/install.php +++ /dev/null @@ -1,10 +0,0 @@ - - * @package chamilo.plugin.skype - */ -require_once __DIR__ . '/config.php'; - -Skype::create()->install(); diff --git a/plugin/skype/lang/english.php b/plugin/skype/lang/english.php index 0af54a0d32..e23104a67c 100644 --- a/plugin/skype/lang/english.php +++ b/plugin/skype/lang/english.php @@ -7,3 +7,5 @@ */ $strings['plugin_title'] = 'Skype'; $strings['plugin_comment'] = 'This plugin creates a Skype user field.'; + +$strings['ReadTheReadmeFile'] = '

    Please read the Readme.txt file to configure this plugin.

    '; diff --git a/plugin/skype/lang/spanish.php b/plugin/skype/lang/spanish.php index 01bfdc4407..adbdeaafe7 100644 --- a/plugin/skype/lang/spanish.php +++ b/plugin/skype/lang/spanish.php @@ -7,3 +7,5 @@ */ $strings['plugin_title'] = 'Skype'; $strings['plugin_comment'] = 'Este plugin crea un campo de usuario Skype.'; + +$strings['ReadTheReadmeFile'] = '

    Por favor, lee elarchivo Readme.txt para configurar este plugin.

    '; diff --git a/plugin/skype/plugin.php b/plugin/skype/plugin.php index 687ba24e1f..9a7c9dfe7f 100644 --- a/plugin/skype/plugin.php +++ b/plugin/skype/plugin.php @@ -5,6 +5,5 @@ * @author Imanol Losada Oriol * @package chamilo.plugin.skype */ -require_once __DIR__.'/config.php'; $plugin_info = Skype::create()->get_info(); diff --git a/plugin/skype/src/HookSkype.php b/plugin/skype/src/HookSkype.php deleted file mode 100644 index f5e9c7b54c..0000000000 --- a/plugin/skype/src/HookSkype.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @package chamilo.plugin.skype - */ -class HookObserverSkype extends HookObserver implements HookSkypeObserverInterface -{ - - /** - * Class constructor - */ - public function __construct() - { - parent::__construct( - 'plugin/skype/src/Skype.php', 'skype' - ); - } - - /** - * Create Skype user field when plugin is enabled - * @param HookSkypeEventInterface $hook The hook - */ - public function hookEventSkype(HookSkypeEventInterface $hook) - { - $data = $hook->getEventData(); - if ($data['type'] === HOOK_EVENT_TYPE_PRE) { - // Code - } - } -} diff --git a/plugin/skype/src/Skype.php b/plugin/skype/src/Skype.php index a96d7235ec..0d57b19e2f 100644 --- a/plugin/skype/src/Skype.php +++ b/plugin/skype/src/Skype.php @@ -7,7 +7,7 @@ * @author Imanol Losada Oriol * @package chamilo.plugin.skype */ -class Skype extends Plugin implements HookPluginInterface +class Skype extends Plugin { /** @@ -15,7 +15,11 @@ class Skype extends Plugin implements HookPluginInterface */ protected function __construct() { - parent::__construct('0.1', 'Imanol Losada Oriol'); + parent::__construct( + '0.2', + 'Imanol Losada Oriol', + [$this->get_lang('ReadTheReadmeFile') => 'html'] + ); } /** @@ -29,63 +33,4 @@ class Skype extends Plugin implements HookPluginInterface return $result ? $result : $result = new self(); } - - /** - * Install the plugin - */ - public function install() - { - $this->installHook(); - - $result = Database::select( - 'variable', - Database::get_main_table(TABLE_EXTRA_FIELD), - array( - 'where'=> array( - 'variable = ?' => array( - 'skype' - ) - ) - ) - ); - - if (empty($result)) { - $extraField = new ExtraField('user'); - $extraField->save(array( - 'field_type' => ExtraField::FIELD_TYPE_TEXT, - 'variable' => 'skype', - 'display_text' => 'Skype', - 'visible' => 1, - 'changeable' => 1 - )); - } - } - - /** - * Uninstall the plugin - * @return void - */ - public function uninstall() - { - $this->uninstallHook(); - } - - /** - * Install the Skype hook - */ - public function installHook() - { - $hook = HookObserverSkype::create(); - HookEventSkype::create()->attach($hook); - } - - /** - * Uninstall the Skype hook - */ - public function uninstallHook() - { - $hook = HookObserverSkype::create(); - HookEventSkype::create()->detach($hook); - } - } diff --git a/plugin/skype/uninstall.php b/plugin/skype/uninstall.php deleted file mode 100644 index 7ca4b44a8e..0000000000 --- a/plugin/skype/uninstall.php +++ /dev/null @@ -1,10 +0,0 @@ - - * @package chamilo.plugin.skype - */ -require_once __DIR__ . '/config.php'; - -Skype::create()->uninstall(); From 2c07f650994022a53849a78ed6bee1d483c8212c Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 10 Jun 2016 15:11:56 -0500 Subject: [PATCH 5/6] Remove Skype plugin - refs BT#10956 --- .../Schema/V111/Version20160610142700.php | 92 +++++++++++++++++++ plugin/skype/README.md | 34 ------- plugin/skype/index.php | 2 - plugin/skype/lang/english.php | 11 --- plugin/skype/lang/spanish.php | 11 --- plugin/skype/plugin.php | 9 -- plugin/skype/src/Skype.php | 36 -------- 7 files changed, 92 insertions(+), 103 deletions(-) create mode 100644 app/Migrations/Schema/V111/Version20160610142700.php delete mode 100644 plugin/skype/README.md delete mode 100644 plugin/skype/index.php delete mode 100644 plugin/skype/lang/english.php delete mode 100644 plugin/skype/lang/spanish.php delete mode 100644 plugin/skype/plugin.php delete mode 100644 plugin/skype/src/Skype.php diff --git a/app/Migrations/Schema/V111/Version20160610142700.php b/app/Migrations/Schema/V111/Version20160610142700.php new file mode 100644 index 0000000000..d89ba8c733 --- /dev/null +++ b/app/Migrations/Schema/V111/Version20160610142700.php @@ -0,0 +1,92 @@ +connection + ->executeQuery(" + SELECT id FROM extra_field + WHERE variable = 'skype' AND extra_field_type = 1 + ") + ->fetchAll(); + + if (empty($dataList)) { + $this->addSql(" + INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) + VALUES (1, 1, 'skype', 'Skype', 1, 1, now()) + "); + } + + $this->addSql(" + INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) + VALUES (1, 1, 'linkedin_url', 'LinkedInUrl', 1, 1, now()) + "); + + $this->addSettingCurrent( + 'allow_show_skype_account', + null, + 'radio', + 'Platform', + 'true', + 'AllowShowSkypeAccountTitle', + 'AllowShowSkypeAccountComment', + null, + null, + 1, + true, + false, + [ + ['value' => 'false', 'text' => 'No'], + ['value' => 'true', 'text' => 'Yes'] + ] + ); + + $this->addSettingCurrent( + 'allow_show_linkedin_url', + null, + 'radio', + 'Platform', + 'true', + 'AllowShowLinkedInUrlTitle', + 'AllowShowLinkedInUrlComment', + null, + null, + 1, + true, + false, + [ + ['value' => 'false', 'text' => 'No'], + ['value' => 'true', 'text' => 'Yes'] + ] + ); + } + + /** + * @param Schema $schema + * @throws \Doctrine\DBAL\DBALException + * @throws \Doctrine\DBAL\Schema\SchemaException + */ + public function down(Schema $schema) + { + + } +} \ No newline at end of file diff --git a/plugin/skype/README.md b/plugin/skype/README.md deleted file mode 100644 index 85690145c4..0000000000 --- a/plugin/skype/README.md +++ /dev/null @@ -1,34 +0,0 @@ -Skype Plugin -============== - -This pluging was integrated within Chamilo LMS core - -To configure this plugin you need execute this SQL queries: - -* Enable the Skype extra field: -``` -INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) -VALUES -(1, 1, 'skype', 'Skype', 1, 1, now()); -``` -* Enable the LinkedInURl extra field: -``` -INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) -VALUES -(1, 1, 'linkedin_url', 'LinkedInUrl', 1, 1, now()); -``` -* Enable the configuration settings: -``` -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, access_url_changeable) -VALUES -('allow_show_skype_account', NULL, 'radio', 'Course', 'true', 'AllowShowSkypeAccountTitle', 'AllowShowSkypeAccountComment', 1), -('allow_show_linkedin_url', NULL, 'radio', 'Course', 'true', 'AllowShowLinkedInUrlTitle', 'AllowShowLinkedInUrlComment', 1); -``` -``` -INSERT INTO settings_options (variable, value, display_text) -VALUES -('allow_show_skype_account', 'true', 'Yes'), -('allow_show_skype_account', 'false', 'No'), -('allow_show_linkedin_url', 'true', 'Yes'), -('allow_show_linkedin_url', 'false', 'No'); -``` diff --git a/plugin/skype/index.php b/plugin/skype/index.php deleted file mode 100644 index bcecba1566..0000000000 --- a/plugin/skype/index.php +++ /dev/null @@ -1,2 +0,0 @@ - - * @package chamilo.plugin.skype - */ -$strings['plugin_title'] = 'Skype'; -$strings['plugin_comment'] = 'This plugin creates a Skype user field.'; - -$strings['ReadTheReadmeFile'] = '

    Please read the Readme.txt file to configure this plugin.

    '; diff --git a/plugin/skype/lang/spanish.php b/plugin/skype/lang/spanish.php deleted file mode 100644 index adbdeaafe7..0000000000 --- a/plugin/skype/lang/spanish.php +++ /dev/null @@ -1,11 +0,0 @@ - - * @package chamilo.plugin.skype - */ -$strings['plugin_title'] = 'Skype'; -$strings['plugin_comment'] = 'Este plugin crea un campo de usuario Skype.'; - -$strings['ReadTheReadmeFile'] = '

    Por favor, lee elarchivo Readme.txt para configurar este plugin.

    '; diff --git a/plugin/skype/plugin.php b/plugin/skype/plugin.php deleted file mode 100644 index 9a7c9dfe7f..0000000000 --- a/plugin/skype/plugin.php +++ /dev/null @@ -1,9 +0,0 @@ - - * @package chamilo.plugin.skype - */ - -$plugin_info = Skype::create()->get_info(); diff --git a/plugin/skype/src/Skype.php b/plugin/skype/src/Skype.php deleted file mode 100644 index 0d57b19e2f..0000000000 --- a/plugin/skype/src/Skype.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package chamilo.plugin.skype - */ -class Skype extends Plugin -{ - - /** - * Class constructor - */ - protected function __construct() - { - parent::__construct( - '0.2', - 'Imanol Losada Oriol', - [$this->get_lang('ReadTheReadmeFile') => 'html'] - ); - } - - /** - * Instance the plugin - * @staticvar null $result - * @return Skype - */ - static function create() - { - static $result = null; - - return $result ? $result : $result = new self(); - } -}