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

  • Blocks
  • QueryOperation
 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\Operation\Module;
13 
14 use ICanBoogie\I18n;
15 use ICanBoogie\Operation;
16 
17 class Blocks extends Operation
18 {
19     protected function get_controls()
20     {
21         return array
22         (
23             self::CONTROL_AUTHENTICATION => true
24         )
25 
26         + parent::get_controls();
27     }
28 
29     protected function validate(\ICanboogie\Errors $errors)
30     {
31         if (!$this->request['name'])
32         {
33             $errors['name'] = I18n\t('Missing block name');
34 
35             return false;
36         }
37 
38         return true;
39     }
40 
41     protected function process()
42     {
43         global $core, $document;
44 
45         // TODO: add block access restriction
46 
47         $document = $core->document;
48 
49         if ($core->user_id && $core->user->language)
50         {
51             $core->locale = $core->user->language;
52         }
53 
54         $request = $this->request;
55         $name = $request['name'];
56         $module = $core->modules[$request['module']];
57 
58         $block = $module->getBlock($name, $request->params);
59 
60         $this->response['assets'] = $document->assets;
61 
62         return (string) $block;
63     }
64 }
Autodoc API documentation generated by ApiGen 2.8.0