/** * @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; }
/** * @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; }
/** * @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; }
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(' ')); }
public function __construct($options, $name = null, $value = null, $listsep = null) { parent::__construct('Div'); if (empty($listsep)) { $listsep = Wax_Document::createTextNode(' '); } elseif (is_string($listsep)) { $listsep = Wax_Document::createElement($listsep); } $i = 0; foreach ((array) $options as $radioValue => $radioLabel) { $radioId = $name . ucfirst($radioValue); $radio = Wax_Factory::createObject('Wax_Document_Body_Form_Element_Input_Radio', $name, $radioValue); if ($value == $radioValue) { $radio->setAttribute('checked', 'checked'); } $radio->setId($radioId); $this->appendChild($radio)->appendChild(Wax_Document::createTextNode(' '))->appendChild(Wax_Document::createElement('label')->innerHTML($radioLabel)->setAttribute('for', $radioId))->appendChild($listsep); $i++; } }
/** * @return Wax_Document_Body_Form */ public function appendSubmitOrCancel($name, $label = null, $cancelUri = null, $cancelExtras = null) { $this->appendSubmit($name, $label)->appendElementInline(Wax_Document::createTextNode(__('OAcentuada')))->appendElementInline(Wax_Document::createElement('a')->setAttribute('href', $cancelUri)->setAttributes($cancelExtras)->innerHTML(__('Cancelar'))); return $this; }