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 ICanBoogie\I18n;
15 
16 /**
17  * Returns a new pane for the {@link TabbableEditor}.
18  */
19 class TabbableNewPaneOperation extends \ICanBoogie\Operation
20 {
21     /**
22      * The `control_name` parameter is request.
23      *
24      * @see ICanBoogie.Operation::validate()
25      */
26     protected function validate(\ICanBoogie\Errors $errors)
27     {
28         if (!$this->request['control_name'])
29         {
30             $errors['control_name'] = I18n\t('The %identifier is required.', array('identifier' => 'control_name'));
31         }
32 
33         return true;
34     }
35 
36     /**
37      * Returns a pane HTML string.
38      *
39      * Adds the following response properties:
40      *
41      * - (string) tab: The tab element associated with the pane.
42      * - (array) assets: The assets required by the elements.
43      *
44      * @see ICanBoogie.Operation::process()
45      */
46     protected function process()
47     {
48         global $core;
49 
50         $request = $this->request;
51         $properties = array
52         (
53             'name' => $request['control_name'] . '[' . uniqid() . ']',
54             'title' => 'New tab',
55             'editor_id' => 'rte',
56             'serialized_content' => null
57         );
58 
59         $tab = TabbableEditorElement::create_tab($properties);
60         $pane = TabbableEditorElement::create_pane($properties);
61 
62         $tab->add_class('active');
63         $pane->add_class('active');
64 
65         $tab = (string) $tab;
66         $pane = (string) $pane;
67 
68         $this->response['tab'] = $tab;
69         $this->response['assets'] = $core->document->assets;
70 
71         return $pane;
72     }
73 }
Autodoc API documentation generated by ApiGen 2.8.0