Browse Source

Skype plugin deprecated - refs BT#11956

Angel Fernando Quiroz Campos 8 years ago
parent
commit
ba75a2b4e6

+ 31 - 1
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');
+```

+ 0 - 9
plugin/skype/config.php

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

+ 0 - 6
plugin/skype/index.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';

+ 0 - 10
plugin/skype/install.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();

+ 2 - 0
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'] = '<p>Please read the <a href="/plugin/skype/readme.txt" class="ajax" data-size="lg">Readme.txt file</a> to configure this plugin.</p>';

+ 2 - 0
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'] = '<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>';

+ 0 - 1
plugin/skype/plugin.php

@@ -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();

+ 40 - 1
plugin/skype/readme.txt

@@ -1,2 +1,41 @@
 <h1>Skype Plugin</h1>
-<p>Create Skype user field</p>
+
+<p>This pluging was integrated within Chamilo LMS core</p>
+
+<p>To configure this plugin you need execute this SQL queries:</p>
+
+<ul>
+<li>Enable the Skype extra field:</li>
+</ul>
+
+<pre><code>INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at)
+VALUES
+(1, 1, 'skype', 'Skype', 1, 1, now());
+</code></pre>
+
+<ul>
+<li>Enable the LinkedInURl extra field:</li>
+</ul>
+
+<pre><code>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());
+</code></pre>
+
+<ul>
+<li>Enable the configuration settings:</li>
+</ul>
+
+<pre><code>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);
+</code></pre>
+
+<pre><code>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');
+</code></pre>

+ 0 - 34
plugin/skype/src/HookSkype.php

@@ -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
-        }
-    }
-}

+ 6 - 61
plugin/skype/src/Skype.php

@@ -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);
-    }
-
 }

+ 0 - 10
plugin/skype/uninstall.php

@@ -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();