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

  • Hooks
  • Module
  • NodeLanguageElement
  • NodeNativeElement
 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\I18n;
13 
14 use Brickrouge\Element;
15 use Brickrouge\Form;
16 
17 /**
18  * An element to select the language of a node.
19  */
20 class NodeLanguageElement extends Element
21 {
22     public function __construct(array $attributes=array())
23     {
24         parent::__construct
25         (
26             'select', $attributes + array
27             (
28                 Form::LABEL => 'language',
29                 Element::DESCRIPTION => 'language',
30                 Element::OPTIONS => array
31                 (
32                     null => '.neutral'
33                 )
34 
35                 + $this->collect_options()
36             )
37         );
38     }
39 
40     static protected function add_assets(\Brickrouge\Document $document)
41     {
42         parent::add_assets($document);
43 
44         $document->js->add('elements.js');
45     }
46 
47     protected function collect_options()
48     {
49         global $core;
50 
51         $languages = $core->models['sites']->count('language');
52 
53         foreach ($languages as $language => $dummy)
54         {
55             $languages[$language] = $core->locale->conventions['localeDisplayNames']['languages'][$language];
56         }
57 
58         return $languages;
59     }
60 }
Autodoc API documentation generated by ApiGen 2.8.0