Exemple #1
0
 private function getNavigationHTML()
 {
     $login = $this->getLoginInfo();
     $text = "<div class=\"logininfo\">{$login}</div>";
     if ($this->modal) {
         return $text;
     }
     $level = Session::defaultPosition();
     global $GLOBAL_NAVIGATION;
     $name = Server::currentPageName();
     foreach ($GLOBAL_NAVIGATION as $link => $array) {
         $disp = $array[0];
         $imageFile = "images/nav/" . substr($link, 0, -4) . ".png";
         if (file_exists(realpath($imageFile))) {
             $imageHtml = "<img class=\"largeicon\" src=\"{$imageFile}\" />&nbsp;";
         } else {
             $imageHtml = '';
         }
         if ($level >= $array[1]) {
             if ($link == $name) {
                 $text .= "<a class=navsel href=\"{$link}\">";
             } else {
                 $text .= "<a class=nav href=\"{$link}\">";
             }
             $text .= $imageHtml . $disp . "</a>";
         }
     }
     return $text;
 }
Exemple #2
0
 /**
  * Constructs the UIForm.
  *
  * $name : Form name. Currently not used for anything important.
  * $method : Form method. GET by default
  * $action : Form action. Current page by default
  */
 public function __construct($name, $method = 'GET', $action = null)
 {
     parent::__construct();
     if ($action == null) {
         $action = Server::currentPageName();
     }
     $this->method = $method;
     $this->action = $action;
     $this->name = $name;
     $this->encoding = '';
     $this->hasDatePicker = false;
     $this->hasMultiSelect = false;
     require_js('validate');
     require_css('form');
 }
Exemple #3
0
 /**
  * $cells : cells of this table row
  * $name : name of the form (arbitrary at this point)
  * $buttonText : text of the confirm button
  * $buttonIconName : icon name of the confirm button, defaults to the buttonText
  * $method : form method, default GET
  * $action : form action, default current page
  */
 public function __construct($cells, $name, $buttonText, $buttonIconName = null, $method = 'GET', $action = null, $confirmmessage = null)
 {
     parent::__construct($cells);
     if ($action == null) {
         $action = Server::currentPageName();
     }
     $this->method = $method;
     $this->action = $action;
     $this->name = $name . self::nextID();
     if ($confirmmessage) {
         $js = "doConfirm('" . addslashes(htmlspecialchars($confirmmessage)) . "', document." . $this->name . ");";
     } else {
         $js = $this->name . ".submit();";
     }
     if (!$buttonIconName) {
         $buttonIconName = $buttonText;
     }
     $submitButton = UIButton::javascriptButton($buttonText, $js, $buttonIconName);
     $this->addButton($submitButton);
     require_js('validate');
     require_css('form');
 }
Exemple #4
0
 /**
  * Constructor.
  *
  * $name : raw button text
  * $message : dialog message to ask user
  * $formParams : associate array of form parameters
  * $icon : name of the icon: ~/images/icons/button_[$icon].png. Uses $name if not present
  * $hideText : true to have a text-less round button
  * $formMethod : the method of the form, POST by default
  * $formAction : the action of the form, current page by default
  */
 public function __construct($name, $message, $formParams, $icon = null, $hideText = false, $formMethod = 'POST', $formAction = null)
 {
     parent::__construct($name, '#', "doConfirm('" . js_reencode($message) . "', document." . ($id = 'confirm' . self::nextConfirmID()) . ");", $icon, $hideText);
     if ($formAction == null) {
         $formAction = Server::currentPageName();
     }
     $this->form = "<form class=inline name=\"{$id}\" method=\"{$formMethod}\" action=\"{$formAction}\">";
     foreach ($formParams as $name => $value) {
         $valueEsc = inputize($value);
         $this->form .= "<input type=\"hidden\" name=\"{$name}\" value=\"{$valueEsc}\" />";
     }
     $this->form .= "</form>";
     require_js('confirm');
     require_css('form');
 }