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

  • AdminDecorator
  • AdminIndexController
  • BlockController
  • BlockDecorator
  • ConfigBlock
  • ConfigController
  • ConfigOperation
  • Core
  • DeleteBlock
  • DeleteController
  • Document
  • DocumentDecorator
  • EditBlock
  • EditController
  • FormBlock
  • Hooks
  • InterlockBlock
  • Kses
  • ManageBlock
  • Module
  • Modules
  • StatsDecorator

Constants

  • OPERATION_SAVE_MODE
  • OPERATION_SAVE_MODE_CONTINUE
  • OPERATION_SAVE_MODE_DISPLAY
  • OPERATION_SAVE_MODE_LIST
  • OPERATION_SAVE_MODE_NEW

Functions

  • slugize
  • start
  • strip_stopwords
 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;
13 
14 use Brickrouge\Element;
15 
16 /**
17  * An interlock block, displayed instead of the edit block when another user has locked the record
18  * to edit.
19  */
20 class InterlockBlock extends Element
21 {
22     /**
23      * The module managing the record.
24      *
25      * @var Module
26      */
27     protected $module;
28 
29     /**
30      * Element attributes.
31      *
32      * @var array
33      */
34     protected $attributes;
35 
36     protected $lock;
37 
38     public function __construct(Module $module, array $attributes, array $params)
39     {
40         $this->module = $module;
41         $this->attributes = $attributes;
42 
43         $this->parse_params($params);
44 
45         parent::__construct('div', array('class' => 'block-alert block--interlock'));
46     }
47 
48     protected function parse_params(array $params)
49     {
50         $this->lock = $params['lock'];
51     }
52 
53     public function render_inner_html()
54     {
55         global $core;
56 
57         $lock = $this->lock;
58         $luser = $core->models['users'][$lock['uid']];
59         $luser_url = \ICanBoogie\Routing\contextualize("/admin/users/{$luser->uid}/edit");
60         $url = $core->request->path;
61 
62         $time = round((strtotime($lock['until']) - time()) / 60);
63         $message = $time ? "Le verrou devrait disparaitre dans $time minutes." : "Le verrou devrait disparaitre dans moins d'une minutes.";
64 
65         return <<<EOT
66 <h1 class="block-title">Édition impossible</h1>
67 
68 <form method="get" action="">
69     <input type="hidden" name="retry" value="1" />
70 
71     <p>Impossible d'éditer l'enregistrement parce qu'il est en cours d'édition par
72     <a title="Username: $luser->username" href="$luser_url">$luser->name</a>.</p>
73 
74     <div class="form-actions">
75     <button class="btn btn-success">Réessayer</button> <span class="small light">$message</span>
76     </div>
77 </form>
78 EOT;
79     }
80 }
Autodoc API documentation generated by ApiGen 2.8.0