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\Errors;
15 use ICanBoogie\Exception;
16 use ICanBoogie\Operation;
17 
18 /**
19  * Changes multieditor editor.
20  */
21 class ChangeOperation extends Operation
22 {
23     protected function get_controls()
24     {
25         return array
26         (
27             self::CONTROL_AUTHENTICATION => true
28         )
29 
30         + parent::get_controls();
31     }
32 
33     protected function validate(Errors $errors)
34     {
35         $request = $this->request;
36 
37         if (!$this->key)
38         {
39             $errors['editor_id'] = $errors->format('The %property is required.', array('property' => 'editor_id'));
40         }
41 
42         if (empty($request['selector_name']))
43         {
44             $errors['selector_name'] = $errors->format('The %property is required.', array('property' => 'selector_name'));
45         }
46 
47         if (empty($request['contents_name']))
48         {
49             $errors['contents_name'] = $errors->format('The %property is required.', array('property' => 'contents_name'));
50         }
51 
52         return !$errors->count();
53     }
54 
55     protected function process()
56     {
57         global $core;
58 
59         $request = $this->request;
60 
61         $editor = (string) new MultiEditorElement
62         (
63             $this->key, array
64             (
65                 MultiEditorElement::SELECTOR_NAME => $request['selector_name'],
66 
67                 'name' => $request['contents_name'],
68                 'value' => $request['contents']
69             )
70         );
71 
72         $this->response['assets'] = $core->document->assets;
73 
74         return $editor;
75     }
76 }
Autodoc API documentation generated by ApiGen 2.8.0