We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1932
    • 137 Posts
    I’ve created a new plugin which allows Flash TextArea to be used as a RTE for editing document content.

    While TinyMCE is full featured and its can be trimmed down, Flash TextArea has a very clean and simple interface and outputs strict xhtml which allows users to easily and quickly create and edit documents while retaining the styles originally intended by the designer.

    FlashTA is a WYSIWYG replacement text area for html forms. While there are various implementations done in javascript, most of them don´t work in this/that browser/os combo, and every time a browser vendor makes a change, they need to update the editor so it doesn´t break on every possible combination of browsers.

    FlashTA tries to overcome that problem by using flash. It also tries to adhere stricty to the (x)html specification. No presentation code is generated (so say bye bye to your idea of selecting text color, font face, etc).

    FlashTA features an easy integration and multiple browser support (Mozilla, MSIE, FireFox, Opera & Safari).

    To install, you will need to download and extract the support files. The zip file contains the folder ’flashtextarea’ which should be placed in the assets/plugins/ directory.

    Next, create a new plugin and copy and paste the code:

    Plugin name: Flash TextArea
    Description: <strong>0.1</strong> - Flash TextArea

    //<?php
    /**
    * Flash TextArea RTE Plugin
    * For more information about Flash TextArea, please visit their website: http://osflash.org/flashtextarea
    * Plugin written by: Brian Stanback (www.stanback.net)
    * Last modified: March 22, 2007
    * Version: 0.1
    *
    * Events: OnRichTextEditorInit, OnRichTextEditorRegister
    * Plugin configuration: &height=Editor Height;text;450px &lang=Language;list;en,es;en
    */
    
    // Directory to flash textarea plugin folder relative to modx installation directory
    $ftaPath = '/assets/plugins/flashtextarea/';
    
    // Handle event
    $e = &$modx->Event;
    switch ($e->name)
    {
    	case "OnRichTextEditorRegister": // register only for backend
    		$e->output("Flash TextArea");
    		break;
    
    	case "OnRichTextEditorInit":
    		if ($editor == "Flash TextArea")
    		{
    			include_once($modx->config['base_path'] . ltrim($ftaPath, '/') . 'fta.functions.php');
    			$base_url = rtrim($modx->config['base_url'], '/');
    			$fta_url = $base_url .  '/' . trim($ftaPath, '/');
    			$site_url = $modx->config['site_url'];
    
    			if ($modx->isFrontend())
    				$frontend = true;
    			else
    				$frontend = false;
    
    			$html = getFtaScript($frontend, $site_url, $base_url, $fta_url, $height, $lang);
    			$e->output($html);
    		}
    }


    Check the following events: OnRichTextEditorInit, OnRichTextEditorRegister

    Add the following to the plugin configuration: &height=Editor Height;text;450px &lang=Language;list;en,es;en



    Finally, in order to upload images you will need to edit the file within assets/plugins/flashtextarea/deploy/fileManager.php and change:

    ’diskPath’=>’’

    To the system path where your modx media/images folder lives:

    ’diskPath’=>’/path/to/modx/assets/media/’



    A demo of the RTE in action can be seen here: http://www.extremefx.com.ar/demos/fta/
    Thanks to Zi for originally finding/suggesting it. wink
      • 18397
      • 3,250 Posts
      This look awesome! Can’t wait to give it a try in the morning!
        • 4626
        • 57 Posts
        It seems really great though the filemanager-part is a bit too buggy – won’t load in Safari 2 and acts weird in Firefox 2. Hopefully Marcello Volmaro will update his code soon!

        Edit: I made a fast Swedish translation for all the Swedes out there...
          • 33337
          • 3,975 Posts
          Yay!

          You da man ApoXX! grin
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 25663 MODX Staff
            • 12,272 Posts
            Nice work. Ran into the buggy file browser thing too ... it kills Safari dead. Well that page is dead, doesn’t actually crash it.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 6726
              • 7,075 Posts
              I’ll sure try this out as I am desperate for a true clean RTE, great job I had vaguely heard about Flash powered RTEs but never tried one, now is the time !

              Thanks !!!
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I ran across one of these a few years ago, and even though I’m no fan of Flash, it was impressive.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 6726
                  • 7,075 Posts
                  I tried it, looks definitely nice (code seems really clean) and one of the advantages is, it has a filemanager which looks better than what we have, though I have some overlay issue with FF/Mac (and also, this filemanager is able to access the root of my web server which is NOT good at all... it seems though the path parameter is good, the filemanager ignores it undecided )

                  Definitely something to dig deeper into !
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 1932
                    • 137 Posts
                    The Safari issue may be due to the CSS used for displaying the file manager; the file manager functions fine in Firefox with the CSS removed (from fta.functions.php), however I don’t have a Mac with which to test. undecided

                    @davidm, I’ll have a look at the fileManager code, it was bundled with Flash TA and I was trying to make as few changes as possible for future upgrade-ability. The file manager seems to see the system path I enter (’diskPath’=>’/home/sites/mysite.com/assets/media/’) and restricts me to that directory, are you saying that it’s possible to get out of the restricted directory using relative paths or something?

                    Speaking of security, I think I will add a $_SESSION check to prevent the file manager from being accessed by users who are not (logged in) managers.
                      • 9805
                      • 8 Posts
                      works very well but only in the Backend. Is this a Bug or a feature ?

                      MODX - 0.9.5
                      FF 2.X

                      Thanks Flece