Example #1
0
 /**
  * @return Standard8_Location
  */
 public function appendLocation($label, $uri, $inside = false, $icon = null)
 {
     $li = Wax_Document::createElement('li');
     $a = Wax_Document::createElement('a', $li)->setAttribute('href', $uri);
     if (!empty($icon)) {
         $li->appendClassName('image');
         $a->appendChild(Wax_Document::createElement('em')->appendChild(Wax_Document::$body->createImage(Standard8_Uri::createUriIcon($icon), $label))->appendChild(Wax_Document::createTextNode($label)));
     } else {
         $a->appendChild(Wax_Document::createElement('em')->innerHTML($label));
     }
     if (!is_null($this->_lastLi) && $inside) {
         $this->_lastLi->appendClassName('drop');
         $ul = $this->_lastLi->getElementsByTagName('ul');
         if (sizeof($ul) == 0) {
             $ul = Wax_Document::createElement('ul', $this->_lastLi)->appendChild($li);
         } elseif (sizeof($ul) == 1) {
             $ul = array_shift($ul);
             if ($ul instanceof Wax_Document_Element) {
                 $ul->appendChild($li);
             }
         }
     } else {
         $this->_lastLi = $li;
         $this->appendChild($li);
     }
     return $this;
 }
Example #2
0
 /**
  * @return Standard8_TitleNav
  */
 public function appendNav($label, $uri, $default = false, $icon = null)
 {
     if (is_null($this->_ul)) {
         $this->_ul = Wax_Document::createElement('ul', $this);
     }
     if (is_string($icon)) {
         $icon = Wax_Document::$body->createImage(Standard8_Uri::createUriIcon($icon), $label);
     }
     settype($default, 'boolean');
     if ($default) {
         Wax_Document::createElement('li', $this->_ul)->setClassName('active')->appendChild(Wax_Document::createElement('span')->appendChild($icon)->appendChild(Wax_Document::createTextNode($label)));
     } else {
         Wax_Document::createElement('li', $this->_ul)->appendChild(Wax_Document::createElement('a')->setAttribute('href', $uri)->appendChild(Wax_Document::createElement('span')->appendChild($icon)->appendChild(Wax_Document::createTextNode($label))));
     }
     return $this;
 }
Example #3
0
 /**
  * @return Standard8_Sidebar
  */
 public function appendNav($label, $uri, $selected = false, $icon = null)
 {
     $li = Wax_Document::createElement('li');
     if ($selected) {
         $li->setClassName('selected');
         $a = Wax_Document::createElement('span', $li);
     } else {
         $a = Wax_Document::createElement('a', $li)->setAttribute('href', $uri);
     }
     if (!empty($icon)) {
         $a->appendChild(Wax_Document::$body->createImage(Standard8_Uri::createUriIcon($icon), $label));
     }
     $a->appendChild(Wax_Document::createTextNode($label));
     $this->_pagesnav->appendChild($li);
     return $this;
 }
Example #4
0
 public function __construct()
 {
     parent::__construct('div');
     $this->_locationBar = Wax_Factory::createObject(array('Standard8', 'Standard8_Location'));
     if (Standard8_Session::getSID()) {
         $username = Standard8_Session::getData('usuario');
         $this->_locationLogout = Wax_Document::createElement('div')->setClassName('logout')->appendChild(Wax_Document::createElement('a')->appendChild(Wax_Document::$body->createImage(Standard8_Uri::createUriIcon('user'), $username))->appendChild(Wax_Document::createTextNode($username))->setAttribute('href', Standard8_Uri::createUriProfile($username)))->appendChild(Wax_Document::createTextNode(' - '))->appendChild(Wax_Document::createElement('a')->setAttribute('href', Standard8_Uri::createUri('Personas_Salir', 'Standard8'))->innerHTML(__('Salir')));
     }
     $this->_locationDiv = Wax_Document::createElement('div', $this)->setClassName('location')->appendChild(Wax_Document::createElement('strong')->innerHTML('Standard8'))->appendChild($this->_locationBar)->appendChild($this->_locationLogout);
     $this->_sidebar = Wax_Factory::createObject(array('Standard8', 'Standard8_Sidebar'));
     $this->appendChild($this->_sidebar);
     $SID = Standard8_Session::getSID();
     if (!empty($SID)) {
         $this->appendLocation(__('Administracion'), '', 'Administracion')->appendLocation(__('Configuracion'), 'Configuracion', 'Administracion', true, 'cog')->appendLocation(__('Personas'), 'Personas', 'Administracion', true, 'user');
     }
     $this->_container = Wax_Document::createElement('div', $this)->setClassName('container');
     $this->_bottom = Wax_Document::createElement('div')->setClassName('bottom')->appendChild(Wax_Document::createComment(' '));
 }
Example #5
0
 /**
  * @return Wax_Document_Body_Form
  */
 public function appendMessage($name, $message, $visible = false)
 {
     $code = null;
     $event = '';
     if (strpos($name, ':') !== false) {
         list($name, $event) = explode(':', $name);
         return $this;
     }
     if (is_null($this->_ul)) {
         $this->_ul = Wax_Document::createElement('ul')->setTagType(Wax_Document_Element::TAG_OPEN)->isContainer(true);
         $this->insertBefore(Wax_Document::createElement('div')->setStyle('display', 'none')->setClassName('messages')->appendChild(Wax_Document::createElement('a')->setClassName('dismiss')->appendChild(Wax_Document::$body->createImage(Standard8_Uri::createUriIcon('cross'), __('Cerrar'))))->appendChild($this->_ul)->isContainer(true), $this->_dl[0]);
     }
     $li = Wax_Document::createElement('li');
     if (!$visible) {
         $li->setStyle('display', 'none');
     }
     if (!is_null($code)) {
         $li->appendChild(Wax_Document::createElement('span')->setClassName('code')->innerHTML($code));
     }
     $li->appendChild(Wax_Document::createElement('label')->setAttribute('for', $name)->setClassName('invalid')->innerHTML($message));
     $this->_ul->appendChild($li);
     return $this;
 }