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

  • ContactForm
  • DefaultsOperation
  • EditBlock
  • EmailComposer
  • Form
  • FormEditor
  • FormEditorElement
  • Hooks
  • ManageBlock
  • Model
  • Module
  • NotifyParams
  • PopForm
  • PostOperation
  • PressContactForm
  • QuickContactForm

Interfaces

  • AlterNotify
 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\Forms;
13 
14 use Brickrouge\Element;
15 
16 class PopForm extends Element
17 {
18     public function __toString()
19     {
20         global $core;
21 
22         try
23         {
24             $site = $core->site;
25             $value = (int) $this['value'];
26 
27             $options = $core->models['forms']->select('nid, title')
28             ->where('nid = ? OR ((siteid = 0 OR siteid = ?) AND (language = "" OR language = ?))', $value, $site->siteid, $site->language)
29             ->order('title')
30             ->pairs;
31 
32             if (!$options)
33             {
34                 $url = \Brickrouge\escape($core->site->path . '/admin/forms/new');
35 
36                 return <<<EOT
37 <a href="$url" class="btn btn-info">Créer un premier formulaire...</a>
38 EOT;
39             }
40 
41             if ($this->type == 'select')
42             {
43                 $options = array(null => '') + $options;
44             }
45 
46             $this[self::OPTIONS] = $options;
47         }
48         catch (\Exception $e)
49         {
50             return \Brickrouge\render_exception($e);
51         }
52 
53         return parent::__toString();
54     }
55 }
Autodoc API documentation generated by ApiGen 2.8.0