OTRS mailing lists
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
newer
Workflow patches

How to Integrate OTRS with htmlArea

older
FW: [dev] Diff to provide patch...

Robert Kehl

2 Jul 2004 2 Jul '04
8:20 a.m.

How to Integrate OTRS with htmlArea htmlArea is a JavaScript based WYSIWYG editor replacement for any <textarea> field. It features a word processor like interface to compose HTML without even knowing about it. This way your users may compose HTML-FAQs on the fly with a convenient GUI, for example. htmlArea is published by interactivetools.com http://www.interactivetools.com/ under a BSD-style license http://www.interactivetools.com/products/htmlarea/license.html. You can download htmlArea from the homepage: http://www.interactivetools.com/products/htmlarea/ Install htmlArea. See htmlArea's documentation for this. Make it accessible via the URI "/htmlarea/". Basically, this means inserting an alias definition to your httpd.conf. The following line assumes you installed htmlArea to /usr/local/htmlarea, which may not be the case with your installation, so please adapt: Alias /htmlarea/ "/usr/local/htmlarea/" Make sure it is working by visiting http://localhost/htmlarea/examples/. You may later want to delete the examples, but have a look at them to get an impression of what's possible with the software. Create a new theme. Refer to http://doc.otrs.org/1.2/en/html/dtl-theme.html on how to do this. We will refer to MyTheme in the following as the new Theme. Create /Kernel/Output/HTML/MyTheme/htmlarea.dtl with the following content. Again, adapt the URI of htmlarea if needed. ---snip--- # -- # htmlarea.dtl - Implements htmlArea in OTRS # Copyright (C) 2004- Dipl.-Ing. Robert Kehl # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you # did not receive this file, see http://www.gnu.org/licenses/gpl.txt. # -- <script type="text/javascript"> _editor_url = "/htmlarea/"; _editor_lang = "$Env{"UserLanguage"}"; </script> <script type="text/javascript" src="/htmlarea/htmlarea.js"></script> <script type="text/javascript"> function initDocument(myTextArea) { var editor = new HTMLArea(myTextArea); editor.generate(); with(document.getElementById(myTextArea+"_on").style){ if(visibility!="hidden"){visibility="hidden"} } } </script> ----snap---- Edit /Kernel/Output/HTML/MyTheme/FAQArticleForm.dtl and include the following line somewhere to load the above: $Include{"htmlarea"} Now locate a textarea, let's say the one named "Field1". Here's what it looks like: <tr> <td class="table1" valign="top">$Text{"$Config{"FAQ::Field1"}"}: </td> <td class="table1">