Beispiel #1
0
 public function __construct()
 {
     global $auth;
     global $PH;
     $this->children = array();
     /**
      * NOTE:
      * - adding the edit_request_time as form hidden field would
      *   cause additional entries in the from-handle file. So we
      *   add it as a none checked field.
      *
      */
     ### user might not be defined for anonymus pages like login
     if (isset($auth->cur_user)) {
         $this->add(new Form_HiddenField('edit_request_time', '', time()));
         $this->add(new Form_HiddenField('edit_request_token', '', createRandomString()));
     }
     $this->button_submit = __("Submit");
     parent::__construct();
 }
Beispiel #2
0
 public function __construct(BrowserSession $session, PageElement $container = NULL)
 {
     parent::__construct($session);
     $this->container = $container;
 }
 public function __construct($args = NULL)
 {
     parent::__construct($args);
     ### be sure id is present ###
     if (!$this->id) {
         $this->id = strToLower(preg_replace("/[^\\w\\d]/", "", $this->title));
         # remove all special chars
     } else {
         if (preg_match("/[^\\w\\d]/s", $this->id)) {
             trigger_error("removed invalid characters in blockid '{$this->id}'");
             $this->id = preg_replace("/[^\\w\\d]/", "", $this->id);
         }
     }
     $this->css_classes[] = $this->id;
     ### add current page id to id to make block unique for storing toggle-state as cookie ###
     global $PH;
     $this->id = $PH->cur_page->id . "_" . $this->id;
 }