Skype plugin deprecated - refs BT#11956

ofaj
Angel Fernando Quiroz Campos 9 years ago
parent bab90178a5
commit 1f8caef326
  1. 32
      plugin/skype/README.md
  2. 9
      plugin/skype/config.php
  3. 6
      plugin/skype/index.php
  4. 10
      plugin/skype/install.php
  5. 2
      plugin/skype/lang/english.php
  6. 2
      plugin/skype/lang/spanish.php
  7. 1
      plugin/skype/plugin.php
  8. 34
      plugin/skype/src/HookSkype.php
  9. 67
      plugin/skype/src/Skype.php
  10. 10
      plugin/skype/uninstall.php

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

@ -1,9 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
require_once api_get_path(SYS_PATH) . 'main/inc/global.inc.php';

@ -1,8 +1,2 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
require_once __DIR__ . '/config.php';

@ -1,10 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Initialization install
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
require_once __DIR__ . '/config.php';
Skype::create()->install();

@ -7,3 +7,5 @@
*/
$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>';

@ -7,3 +7,5 @@
*/
$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>';

@ -5,6 +5,5 @@
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
require_once __DIR__.'/config.php';
$plugin_info = Skype::create()->get_info();

@ -1,34 +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 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
}
}
}

@ -7,7 +7,7 @@
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @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);
}
}

@ -1,10 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Initialization uninstall
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.skype
*/
require_once __DIR__ . '/config.php';
Skype::create()->uninstall();
Loading…
Cancel
Save