From fc52af24f1418d6590a2d37a0d8cc31b123e38f6 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Tue, 19 Aug 2014 12:08:35 -0400
Subject: [PATCH] Fix merge error that disabled contact drag'n'drop

---
 plugins/help/help.php |   96 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/plugins/help/help.php b/plugins/help/help.php
new file mode 100644
index 0000000..4b11dce
--- /dev/null
+++ b/plugins/help/help.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * Help Plugin
+ *
+ * @author Aleksander 'A.L.E.C' Machniak
+ * @license GNU GPLv3+
+ *
+ * Configuration (see config.inc.php.dist)
+ * 
+ **/
+
+class help extends rcube_plugin
+{
+    // all task excluding 'login' and 'logout'
+    public $task = '?(?!login|logout).*';
+    // we've got no ajax handlers
+    public $noajax = true;
+    // skip frames
+    public $noframe = true;
+
+    function init()
+    {
+        $rcmail = rcmail::get_instance();
+
+        $this->add_texts('localization/', false);
+
+        // register task
+        $this->register_task('help');
+
+        // register actions
+        $this->register_action('index', array($this, 'action'));
+        $this->register_action('about', array($this, 'action'));
+        $this->register_action('license', array($this, 'action'));
+
+        // add taskbar button
+        $this->add_button(array(
+            'command'    => 'help',
+            'class'      => 'button-help',
+            'classsel'   => 'button-help button-selected',
+            'innerclass' => 'button-inner',
+            'label'      => 'help.help',
+        ), 'taskbar');
+
+        // add style for taskbar button (must be here) and Help UI
+        $skin_path = $this->local_skin_path();
+        if (is_file($this->home . "/$skin_path/help.css")) {
+            $this->include_stylesheet("$skin_path/help.css");
+        }
+    }
+
+    function action()
+    {
+        $rcmail = rcmail::get_instance();
+
+        $this->load_config();
+
+        // register UI objects
+        $rcmail->output->add_handlers(array(
+            'helpcontent' => array($this, 'content'),
+        ));
+
+        if ($rcmail->action == 'about')
+            $rcmail->output->set_pagetitle($this->gettext('about'));
+        else if ($rcmail->action == 'license')
+            $rcmail->output->set_pagetitle($this->gettext('license'));
+        else
+            $rcmail->output->set_pagetitle($this->gettext('help'));
+
+        $rcmail->output->send('help.help');
+    }
+
+    function content($attrib)
+    {
+        $rcmail = rcmail::get_instance();
+
+        if ($rcmail->action == 'about') {
+            return @file_get_contents($this->home.'/content/about.html');
+        }
+        else if ($rcmail->action == 'license') {
+            return @file_get_contents($this->home.'/content/license.html');
+        }
+
+        // default content: iframe
+        if ($src = $rcmail->config->get('help_source'))
+            $attrib['src'] = $src;
+
+        if (empty($attrib['id']))
+            $attrib['id'] = 'rcmailhelpcontent';
+
+        $attrib['name'] = $attrib['id'];
+
+        return $rcmail->output->frame($attrib);
+    }
+
+}

--
Gitblit v1.9.1