/** * @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; }
public function __construct() { parent::__construct('Head'); $this->_title = Wax_Document::createElement('title', $this)->setTagType(Wax_Document_Element::TAG_OPEN); $this->_meta = array(); $this->_script = array(); $this->_style = array(); $this->appendMeta($this->_contentType . ';' . ' charset=' . $this->_charset, null, 'Content-Type'); }
/** * @return Standard8_Sidebar */ public function appendLine($label = null) { $li = Wax_Document::createElement('li')->setClassName('line'); if (!empty($label)) { $li->appendChild(Wax_Document::createElement('span')->innerHTML($label)); } else { $li->appendChild(Wax_Document::createComment('')); } $this->_pagesnav->appendChild($li); }
/** * @return Wax_Document_Body_Table_THead */ public function appendColumn($name, $label, $type = null, $protected = false, $size = null, $extras = null) { $nameColumn = $name . 'Column'; if (!is_null($size)) { if (is_numeric($size)) { $size .= 'px'; } } $this->_data[$name] = array('type' => $type, 'protected' => $protected); $this->_rows[$this->_index]->appendChild(Wax_Document::createElement('th')->innerHTML($label)->setId($nameColumn)->setAttribute('scope', 'col')->setAttributes($extras)->setStyle('width', $size)); 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; }
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 static function parseString($string, $parameters) { if (strpos($string, '?') === false && strpos($string, '#') === false) { return $string; } $retval = ''; $uri = ''; $uriText = ''; $uriFlag = false; for ($i = 0, $l = strlen($string); $i < $l; $i++) { $char = $string[$i]; if ($char == self::PLACEHOLDER) { $replace = array_shift($parameters); if (strlen($replace) > 0) { if ($uriFlag) { $uriText .= $replace; } else { $retval .= $replace; } } } elseif ($char == self::PLACEHOLDER_URI) { if ($uriFlag) { $uriFlag = false; $uri = array_shift($parameters); if (strlen($uriText) > 0) { $replace = Wax_Document::createElement('a')->setAttribute('href', $uri)->innerHTML($uriText)->__toString(); $retval .= $replace; } } else { $uriFlag = true; $uriText = ''; } } else { if ($uriFlag) { $uriText .= $char; } else { $retval .= $char; } } } return $retval; }
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++; } }
public function __construct(Standard8 $Standard8) { parent::__construct('div'); $this->appendChild($Standard8->createTitleNav(__('Modulos')))->appendChild(Wax_Document::createElement('div')->innerHTML('404 Not Found')); }
/** * @return Wax_Document_Body_Form */ public function appendSubmitRow($addAnother = true, $continue = true, $delete = true) { $div = Wax_Document::createElement('div')->setClassName('submit'); return $this->appendChild($div); }