$Id: INSTALL.txt,v 1.4.4.1 2010/11/08 17:14:00 thepanz Exp $;

Authors:
  thePanz  (http://drupal.org/user/58689)
  Haimoura (http://drupal.org/user/139703)
  Alexpott (http://drupal.org/user/157725)

Notes:
  <modules> refer to Drupal modules folder
  <ktroot> refer to KnowledgeTree installation folder

  IMPORTANT: if you're upgrading from a previous installed Plugin version you MUST clean your
    KnowledgeTree cache! Refer to the "KT DrupalPlugin Upgrading" section


** Drupal Module Setup **

  1. Install kt and sub-modules as usual (refer to Drupal documentation)
  2. Check module settings in "admin/settings/kt" page
  3. Remember to check user-permissions for the new module (permission called "login to kt")


** KnowledgeTree Drupal Plugin Setup **

  1. Append lines from <modules>/kt/KnowledgeTree/kt_config.ini to the KnowledgeTree configuration file
    in the <ktroot>/config/config.ini
    The new lines MUST be edited to reflect your current KT and Drupal URLs.

  2. Install the DrupalPlugin into KnowledgeTree: copy the <modules>/kt/KnowledgeTree/DrupalPlugin folder
    to <krtoot>/plugins (three files named "DrupalPlugin.php", "DrupalInterceptor.php" and "Crypt.class.php")

  3. Check that the folder <ktroot>/thirdparty/xmlrpc-2.2 exists, if not you must install the XMLRPC class
    available form : http://sourceforge.net/projects/phpxmlrpc/files/
    You must create the missing directory called xmlrpc-2.2 and extract class files contents there

  4. Copy <modules>/kt/KnowledgeTree/logout.php file into the <ktroot>/presentation folder (backup and
    replace the existing one).
    The version of logout.php supplied is known to work with Knowledge Tree 3.4 - for more recent
    versions: the purpose of this change is to replace Knowledge Tree's redirect with a javascript
    snippet to log the user out from Drupal too.

  5. Enable the DrupalPlugin in KnowledgeTree: Administration -> Miscellaneous -> Manage Plugins

  6. If you want the KnowledgeTree pages to always load with the iframe you need to edit the
     <ktroot>/templates/kt3/standard_page.smarty adding the following lines just before the </head> tag

        <!-- Little script to force KT into drupal -->
        <script type="text/javascript">
        if (self.location == top.location && location.search.substring(1) != 'nf')
        top.location.href = '../DMS?kt_page=' + escape(self.location);
        </script>


** KT DrupalPlugin Upgrading **

  When updating a ALWAYS clear KT cache (/var/cache, /var/proxies)
  If this plugin is displayed twice, clear the KT plugin table for old Drupal plugin
   running these SQLs:

         DELETE FROM plugins WHERE namespace LIKE 'drupal.%';
         DELETE FROM plugin_helper WHERE namespace LIKE 'drupal.%';
         DELETE FROM interceptor_instances WHERE interceptor_namespace LIKE 'drupal.%';

  Then re-activate the plugin or follow the "Drupal Plugin Setup" section


** Throubleshoting **

  1. Check that the session names match. There will be a drupal message about this in the status log
     and KnowledgeTree settings page. IF they do not you need to alter the settings.php in the
     sites/default folder (if you are using drupal in a multi-domain set up this might not be true)
     and set the cookie domain by removing the comment from the beginning of this line:
           # $cookie_domain = 'example.com';
    and setting the value correctly for your site.

  2. Enable DrupalPlugin debug log in <ktroot>/config/config.ini, section [drupal], setting "debug = true"
     and check <ktroot>/plugins/DrupalPlugin/log.txt for error messages.
     Please clean your log from private informations before sending to TK module http://drupal.org/project/kt
     issue queue.
