Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ChangeOperation
  • Collection
  • FeedEditor
  • FeedEditorElement
  • ImageEditor
  • ImageEditorElement
  • Module
  • MultiEditorElement
  • NodeEditor
  • NodeEditorElement
  • PatronEditor
  • PatronEditorElement
  • PHPEditor
  • PHPEditorElement
  • RawEditor
  • RawEditorElement
  • RTEEditor
  • RTEEditorElement
  • SelectorElement
  • TabbableEditor
  • TabbableEditorElement
  • TabbableEditorRenderer
  • TabbableNewPaneOperation
  • TextEditor
  • TextEditorElement
  • TextmarkEditor
  • TextmarkEditorElement
  • WidgetsEditor
  • WidgetsEditorElement

Interfaces

  • Editor
  • EditorElement

Exceptions

  • EditorAlreadyInstantiated
  • EditorNotDefined
  1 <?php
  2 
  3 /*
  4  * This file is part of the Icybee package.
  5  *
  6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
  7  *
  8  * For the full copyright and license information, please view the LICENSE
  9  * file that was distributed with this source code.
 10  */
 11 
 12 namespace Icybee\Modules\Editor;
 13 
 14 use Brickrouge\Document;
 15 use Brickrouge\Element;
 16 
 17 /**
 18  * RTE editor element.
 19  */
 20 class RTEEditorElement extends Element implements EditorElement
 21 {
 22     const ACTIONS = '#rteeditorelement-actions';
 23 
 24     static protected function add_assets(Document $document)
 25     {
 26         parent::add_assets($document);
 27 
 28         $document->css->add('assets/editor.css');
 29         $document->js->add('assets/editor.js');
 30     }
 31 
 32     public function __construct(array $attributes=array())
 33     {
 34         parent::__construct
 35         (
 36             'textarea', $attributes + array
 37             (
 38                 'class' => 'editor moo',
 39 
 40                 'rows' => 16
 41             )
 42         );
 43     }
 44 
 45     /**
 46      * Alters the dataset with the `base-url`, `actions` and `external-css` attributes.
 47      *
 48      * @see Brickrouge.Element::alter_dataset()
 49      */
 50     public function alter_dataset(array $dataset)
 51     {
 52         global $core;
 53 
 54         $dataset = parent::alter_dataset($dataset);
 55 
 56         $document = $core->document;
 57 
 58         $css = $this[self::STYLESHEETS] ?: array();
 59 
 60         $css[] = Document::resolve_url(\Brickrouge\ASSETS . 'brickrouge.css');
 61 
 62         if (!$css)
 63         {
 64             $info = \Icybee\Modules\Pages\Module::get_template_info('page.html');
 65 
 66             if (isset($info[1]))
 67             {
 68                 $css = $info[1];
 69             }
 70         }
 71 
 72         array_unshift($css, Document::resolve_url('assets/body.css'));
 73 
 74         $try = \ICanBoogie\DOCUMENT_ROOT . 'public/page.css';
 75 
 76         if (file_exists($try))
 77         {
 78             $css[] = Document::resolve_url($try);
 79         }
 80 
 81         $actions = $this[self::ACTIONS] ?: 'standard';
 82 
 83         if ($actions == 'standard')
 84         {
 85             $actions = 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink | image | removeformat paste outline toggleview';
 86 
 87             if (0)
 88             {
 89                 $actions .= ' / tableadd | tableedit | tablerowspan tablerowsplit tablerowdelete | tablecolspan tablecolsplit tablecoldelete';
 90 
 91                 $document->css->add('mooeditable/Assets/MooEditable/MooEditable.Table.css');
 92                 $document->js->add('mooeditable/Source/MooEditable/MooEditable.Table.js');
 93             }
 94         }
 95         else if ($actions == 'minimal')
 96         {
 97             $actions = 'bold italic underline strikethrough | insertunorderedlist insertorderedlist | undo redo | createlink unlink | removeformat paste toggleview';
 98         }
 99 
100         $dataset['base-url'] = '/';
101         $dataset['actions'] = $actions;
102         $dataset['external-css'] = $css;
103 
104         return $dataset;
105     }
106 }
Autodoc API documentation generated by ApiGen 2.8.0