Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->setTitle("Error");
     $this->build("P4A_Frame", "frame");
     $this->build("P4A_Box", "box")->setStyleProperty("border", "1px solid #c6d3de")->setStyleProperty("padding", "10px");
     $this->build("P4A_Button", "restart_button")->setLabel("restart application")->addAction("onclick");
     $this->frame->anchor($this->box)->newRow()->anchorCenter($this->restart_button);
     $this->display("main", $this->frame);
 }
Example #2
0
 /**
  * @return string
  */
 public function getAsString()
 {
     $id = $this->getId();
     if (!$this->isVisible()) {
         return "<div id='{$id}' class='hidden'></div>";
     }
     $properties = $this->composeStringProperties();
     $actions = $this->composeStringActions();
     $class = $this->composeStringClass(array("ui-corner-all"));
     $string = "<fieldset id='{$id}' {$class} {$properties} {$actions}>";
     if ($this->getLabel()) {
         $string .= "<legend>" . __($this->getLabel()) . "</legend>";
     }
     $string .= parent::getChildrenAsString();
     $string .= "<div class='br'></div>";
     $string .= "</fieldset>\n\n";
     return $string;
 }
Example #3
0
 /**
  * @return string
  */
 public function getAsString()
 {
     $parent = P4A::singleton()->getObject($this->getParentID());
     $this->buttons->page_number->setLabel('Go to page');
     $this->buttons->page_number->setNewValue($parent->getCurrentPageNumber());
     $num_pages = $parent->data->getNumPages();
     if ($num_pages == 0) {
         $num_pages = 1;
     }
     $current_page = __('Page');
     $current_page .= ' ';
     $current_page .= $parent->getCurrentPageNumber();
     $current_page .= ' ';
     $current_page .= __('of');
     $current_page .= ' ';
     $current_page .= $num_pages;
     $current_page .= ' ';
     $this->buttons->current_page->setHTML($current_page);
     $this->buttons->elements_page->setValue($parent->data->getPageLimit());
     return parent::getAsString();
 }