Remove Skype plugin - refs BT#10956

ofaj
Angel Fernando Quiroz Campos 9 years ago
parent 1f8caef326
commit 2c07f65099
  1. 92
      app/Migrations/Schema/V111/Version20160610142700.php
  2. 34
      plugin/skype/README.md
  3. 2
      plugin/skype/index.php
  4. 11
      plugin/skype/lang/english.php
  5. 11
      plugin/skype/lang/spanish.php
  6. 9
      plugin/skype/plugin.php
  7. 36
      plugin/skype/src/Skype.php

@ -0,0 +1,92 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V111;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Type;
/**
* Class Version20160610142700
* Integrate the Skype plugin and create new settings current to enable it
* @package Application\Migrations\Schema\V111
*/
class Version20160610142700 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function up(Schema $schema)
{
$dataList = $this
->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)
{
}
}

@ -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');
```

@ -1,2 +0,0 @@
<?php
/* For licensing terms, see /license.txt */

@ -1,11 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Strings to english L10n
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
$strings['plugin_title'] = 'Skype';
$strings['plugin_comment'] = 'This plugin creates a Skype user field.';
$strings['ReadTheReadmeFile'] = '<p>Please read the <a href="/plugin/skype/readme.txt" class="ajax" data-size="lg">Readme.txt file</a> to configure this plugin.</p>';

@ -1,11 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Strings to spanish L10n
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
$strings['plugin_title'] = 'Skype';
$strings['plugin_comment'] = 'Este plugin crea un campo de usuario Skype.';
$strings['ReadTheReadmeFile'] = '<p>Por favor, lee el<a href="/plugin/skype/readme.txt" class="ajax" data-size="lg">archivo Readme.txt</a> para configurar este plugin.</p>';

@ -1,9 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Get the plugin info
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
$plugin_info = Skype::create()->get_info();

@ -1,36 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Create Skype user field
*
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @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();
}
}
Loading…
Cancel
Save