function build() { $html = ''; $ctrl = $this->ctrl ? $this->ctrl . '.' : ''; $html = JDom::_('html.grid.bool', array_merge($this->options, array('strNO' => $this->togglable ? 'JTOOLBAR_PUBLISH' : 'JNO', 'strYES' => $this->togglable ? 'JTOOLBAR_UNPUBLISH' : 'JYES'))); return $html; }
function build() { $html = "\n" . "<div id='" . $this->ajaxWrapper . "'" . ($this->required ? " class='ajax-required'" : "") . "></div>"; $html .= LN . '<%VALIDOR_ICON%>' . LN . '<%MESSAGE%>'; $html .= JDom::_('html.form.input.hidden', array_merge($this->options, array('dataValue' => $this->dataValue == 0 ? "" : $this->dataValue))); return $html; }
function build() { $jinput = new JInput(); //Initialize default form $keys = array('option' => $this->getExtension(), 'view' => $this->getView(), 'layout' => $jinput->get('layout', null, 'CMD'), 'task' => ""); //For item layout if (isset($this->dataObject)) { $keys['id'] = isset($this->dataObject->id) ? $this->dataObject->id : 0; //Deprecated $keys['cid[]'] = isset($this->dataObject->id) ? $this->dataObject->id : 0; } //Specifics values or overrides if (isset($this->values)) { foreach ($this->values as $key => $value) { $keys[$key] = $value; } } //Reproduce current query in the form $followers = array('lang', 'Itemid', 'tmpl'); //Cmd types only for the moment foreach ($followers as $follower) { $val = $jinput->get($follower, null, 'CMD'); if ($val) { $keys[$follower] = $val; } } $html = ""; foreach ($keys as $key => $value) { $html .= JDom::_('html.form.input.hidden', array('dataKey' => $key, 'dataValue' => $value)); } //Token $html .= JHTML::_('form.token'); return $html; }
/** * Execute and display ajax queries * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayAjax($tpl = null) { $jinput = JFactory::getApplication()->input; $render = $jinput->get('render', null, 'CMD'); $token = $jinput->get('token', null, 'BASE64'); $values = $jinput->get('values', null, 'ARRAY'); switch ($render) { case 'filter3': /* Ajax Filter : Manufacturer > Name * Called from: view:printers, layout:default * Group Level : 1 */ $model = $this->getModel(); $model->addSelect('a.name'); $items = $model->getItems(); $selected = is_array($values) ? $values[count($values) - 1] : $values; $ajaxNamespace = "rtiprint.printermdls.ajax.filter3"; $wrapper = "_ajax_printermdls_{$render}"; $event = 'jQuery("#filter_printer_model").val("");' . 'if(this.value != ""){' . 'jQuery("#' . $wrapper . '").jdomAjax({namespace:"' . $ajaxNamespace . '", vars:{"filter_manufacturer":this.value}})' . '}else{' . 'jQuery("#' . $wrapper . '").innerHTML = "";' . '}'; echo '<div class="ajaxchain-filter ajaxchain-filter-hz">'; echo JDom::_('html.form.input.select', array('dataKey' => 'filter_printer_model_manufacturer', 'dataValue' => $selected, 'domClass' => 'span-2 element-filter', 'labelKey' => 'name', 'list' => $items, 'listKey' => 'id', 'nullLabel' => 'RTIPRINT_FILTER_NULL_MANUFACTURER', 'selectors' => array('onchange' => $event), 'ui' => 'chosen')); echo '</div>'; //Ajax chain on load -> Follows the values echo JDom::_('html.form.input.ajax.chain', array('ajaxWrapper' => $wrapper, 'ajaxContext' => $ajaxNamespace, 'ajaxVars' => array('filter_manufacturer' => $selected, 'values' => $values), 'ajaxToken' => $token)); //Wrapper Div echo "<div id='" . $wrapper . "' class='ajaxchain-wrapper ajaxchain-wrapper-hz'></div>"; break; } exit; }
/** * Execute and display ajax queries * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayAjax($tpl = null) { $jinput = JFactory::getApplication()->input; $render = $jinput->get('render', null, 'CMD'); $token = $jinput->get('token', null, 'BASE64'); $values = $jinput->get('values', null, 'ARRAY'); switch ($render) { case 'filter3': /* Ajax Filter : Printer Model > Name * Called from: view:printers, layout:default * Group Level : 0 */ $model = $this->getModel(); $model->addSelect('a.name'); $items = $model->getItems(); $selected = is_array($values) ? $values[count($values) - 1] : $values; $event = 'jQuery("#filter_printer_model").val(this.value);return Joomla.submitform();'; echo '<div class="ajaxchain-filter ajaxchain-filter-hz">'; echo '<div class="separator">'; echo JDom::_('html.form.input.select', array('dataKey' => '__ajx_printer_model', 'dataValue' => $selected, 'domClass' => 'span-2 element-filter', 'labelKey' => 'name', 'list' => $items, 'listKey' => 'id', 'nullLabel' => 'RTIPRINT_FILTER_NULL_PRINTERMDL', 'selectors' => array('onchange' => $event), 'ui' => 'chosen')); echo '</div>'; echo '</div>'; break; } exit; }
function build() { $dir = $this->pathToUrl($this->systemImagesDir(), true); $task = $this->ctrl . '.saveorder'; $alt = JText::_('JGRID_HEADING_ORDERING'); $htmlIcon = '<div style="background-image:url(' . $dir . '/filesave.png); width:16px; height:16px; display:inline-block"></div>'; $html = JDom::_('html.link', array('content' => $htmlIcon, 'title' => JText::_('Save Order'), 'task' => $task)); return $html; }
function build() { if ($this->viewType == 'text') { //Text alone $html = JDom::_('html.fly', array('dataValue' => JText::_($this->label), 'task' => $this->task, 'num' => $this->num, 'tooltip' => $this->tooltip, 'title' => JText::_($this->label), 'description' => $this->description)); return $html; } return JHTML::_('jgrid.action', $this->num, $this->task, array('active_title' => JText::_($this->label) . '::' . JText::_($this->description), 'inactive_title' => JText::_($this->label) . '::' . JText::_($this->description), 'tip' => $this->tooltip, 'active_class' => $this->taskIcon, 'inactive_class' => $this->taskIcon, 'enabled' => $this->enabled, 'translate' => true, 'checkbox' => 'cb', 'prefix' => $this->ctrl ? $this->ctrl . '.' : '')); }
function build() { // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal'); $id = $this->dataKey; $name = $this->name; $label = JText::_($this->nullLabel); $link = $this->getRoute($this->route, 'modal'); $rel = '{handler: \'iframe\', size: {x: ' . $this->width . ', y: ' . $this->height . '}}'; $title = $this->title; if (empty($title)) { $title = $label; } $scriptReset = "document.id('" . $id . "_id').value = '';"; $scriptReset .= "document.id('" . $id . "_name').value = '" . htmlspecialchars($label, ENT_QUOTES, 'UTF-8') . "';"; $html = array(); //Remove button $htmlReset = ' <a class="btn"' . ' title="' . htmlspecialchars($label, ENT_QUOTES, 'UTF-8') . '"' . ' onclick="' . htmlspecialchars($scriptReset, ENT_QUOTES, 'UTF-8') . '"' . '>' . LN; $htmlReset .= ' <i class="icon-delete"></i>' . LN; $htmlReset .= ' </a>' . LN; //Input area (readonly) $htmlInput = JDom::_('html.form.input.text', array('dataKey' => $id . '_name', 'dataValue' => $title, 'domClass' => 'inputbox input-medium', 'selectors' => array('disabled' => 'disabled', 'readonly' => 'readonly'), 'size' => 40)); //Select button $htmlSelect = ' <a class="modal btn btn-primary" title="' . $label . '" href="' . $link . '" rel="' . $rel . '">' . LN; $htmlSelect .= ' <i class="icon-list icon-white"></i> ' . JText::_('JSELECT') . LN; $htmlSelect .= ' </a>' . LN; // Hidden field $htmlHidden = JDom::_('html.form.input.hidden', array('dataKey' => $this->dataKey . '_id', 'domName' => $this->domName, 'dataValue' => $this->dataValue)); $htmlTasks = ''; //Extra tasks buttons if (count($this->tasks)) { foreach ($this->tasks as $taskName => $task) { $label = isset($task['label']) ? JText::_($task['label']) : ''; $desc = isset($task['description']) ? JText::_($task['description']) : $label; $jsCommand = isset($task['jsCommand']) ? $task['jsCommand'] : null; $icon = isset($task['icon']) ? $task['icon'] : $taskName; $caption = ''; if (in_array($this->display, array('icon', 'both'))) { $caption .= ' <i class="icon-' . $icon . '"></i> '; } if (in_array($this->display, array('text', 'both'))) { $caption .= $label; } $htmlTasks .= ' <a class="btn hasTooltip" title="' . htmlspecialchars($desc, ENT_QUOTES, 'UTF-8') . '"' . ($jsCommand ? ' onclick="' . htmlspecialchars($jsCommand, ENT_QUOTES, 'UTF-8') . '"' : '') . '>' . LN; $htmlTasks .= $caption; $htmlTasks .= ' </a>' . LN; } } // Construct the control $html = $htmlReset . $htmlInput . $htmlSelect . $htmlTasks; // Embed in bootsrap btn-group $html = '<span class="input-append input-prepend">' . $html . '</span>'; // Add the hidden field (storing the value) $html .= $htmlHidden; return $html; }
function build() { $html = ""; if (isset($this->dataValue) && isset($this->list[$this->dataValue][$this->labelKey])) { $html = $this->list[$this->dataValue][$this->labelKey]; } //Embed in a bootstrap label $html = JDom::_('html.label', array('content' => $html)); return $html; }
function build() { //Requires jQuery JDom::_('framework.jquery'); if ($this->live) { $this->addScript($this->hostedSource); } else { $this->attachJs[] = 'jquery.ui.min.js'; } }
function build() { if ($this->position == 'top') { //Must reverse the order of filters of the right side $filtersLeft = array(); $filtersRight = array(); if (!empty($this->list)) { foreach ($this->list as $filter) { if ($filter->align && $filter->align == 'right') { $filtersRight[] = $filter; } else { $filtersLeft[] = $filter; } } } $filtersRight = array_reverse($filtersRight); $this->list = array_merge($filtersLeft, $filtersRight); } if (empty($this->list)) { return; } $html = array(); $i = 0; foreach ($this->list as $filter) { // Horizontal separator if ($i > 0 && $this->position == 'sidebar') { $html[] = '<hr class="hr-condensed" />'; } $htmlControl = ''; // Label is invisible $htmlControl .= '<label class="element-invisible">'; $htmlControl .= $filter->label; $htmlControl .= '</label>'; // Render the input $htmlControl .= $filter->input; $classes = array(); //Wrap in a div for horizontal alignement if ($filter->align && in_array($filter->align, array('left', 'right'))) { $classes[] = 'btn-group'; $classes[] = 'pull-' . $filter->align; } if ($responsive = $filter->responsive) { $classes[] = $this->getResponsiveClass($responsive); } if (count($classes)) { $htmlControl = JDom::_('html.fly', array('domClass' => implode(' ', $classes), 'dataValue' => $htmlControl, 'markup' => 'div')); } $html[] = $htmlControl; $i++; } return implode('', $html); }
function build() { if (empty($this->list)) { return; } $html = ''; $html .= '<ul id="submenu" class="nav nav-list">'; foreach ($this->list as $item) { $html .= JDom::_('html.link.menu.submenu', array('content' => JText::_($item[0]), 'href' => $item[1], 'active' => $item[2])); } $html .= '</ul>'; return $html; }
function build() { if ($this->groupBy) { $options = $this->buildOptionsGroup(); } else { $options = $this->buildOptions(); } if ($this->ui == 'chosen') { JDom::_('framework.jquery.chosen'); $this->addClass('chzn-select'); } $html = '<select id="<%DOM_ID%>" name="<%INPUT_NAME%>"<%STYLE%><%CLASS%><%SELECTORS%>' . ((int) $this->size > 1 ? ' size="' . (int) $this->size . '"' : '') . '>' . LN . $this->indent($this->buildDefault(), 1) . $this->indent($options, 1) . '</select>' . LN . '<%VALIDOR_ICON%>' . LN . '<%MESSAGE%>'; return $html; }
function build() { return JDom::_('html.fly.datetime', $this->options); //DEPRECATED : Use fly.datetime $formatedDate = ""; if ($this->dataValue && $this->dataValue != "0000-00-00" && $this->dataValue != "00:00:00" && $this->dataValue != "0000-00-00 00:00:00") { jimport("joomla.utilities.date"); $date = new JDate($this->dataValue); $formatedDate = $date->toFormat($this->dateFormat); } $this->addClass('grid-date'); $html = '<span <%STYLE%><%CLASS%><%SELECTORS%>>' . $formatedDate . '</span>'; return $html; }
function build() { //Only for bootstrap if (!$this->useFramework('bootstrap')) { echo $this->error('Bootstrap is required'); return; } if (!$this->href) { $this->href = '#'; } JDom::_('framework.bootstrap'); $this->addSelector('rel', $this->rel); $this->link_title = $this->title; $html = '<a<%ID%><%CLASS%><%STYLE%><%TITLE%><%HREF%><%JS%><%TARGET%><%SELECTORS%>' . ' data-title="' . $this->title . '"' . ' data-content="' . $this->contents . '"' . '>' . $this->content . '</a>'; return $html; }
function build() { //Icon alone if ($this->viewType == 'icon') { $html .= JDom::_('html.icon', array('icon' => $this->icon, 'tooltip' => true, 'title' => $this->text)); return $html; } //Icon if ($this->viewType == 'both') { $html .= JDom::_('html.icon', array('icon' => $this->icon)); } $html .= $this->text; //Embed in label $html = JDom::_('html.label', array('content' => $html, 'color' => $this->color)); return $html; }
/** * Method to get the field input markup. * * @access public * * @return string The field input markup. * * @since 11.1 */ public function getInput() { $options = array(); if (!isset($this->jdomOptions['list'])) { //Get the options from XML foreach ($this->element->children() as $option) { $opt = new stdClass(); foreach ($option->attributes() as $attr => $value) { $opt->{$attr} = (string) $value; } $opt->text = JText::_(trim((string) $option)); $options[] = $opt; } } $this->input = JDom::_('html.form.input.select.limit', array_merge(array('dataKey' => $this->getOption('name'), 'domClass' => $this->getOption('class'), 'domId' => $this->id, 'domName' => $this->name, 'dataValue' => (string) $this->value, 'labelKey' => $this->getOption('labelKey'), 'list' => $options, 'listKey' => $this->getOption('listKey'), 'nullLabel' => $this->getOption('nullLabel'), 'responsive' => $this->getOption('responsive'), 'size' => $this->getOption('size', 1, 'int'), 'submitEventName' => $this->getOption('submit') == 'true' ? 'onchange' : null, 'ui' => $this->getOption('ui')), $this->jdomOptions)); return parent::getInput(); }
function build() { $htmlInput = JDom::_('html.form.input', array_merge($this->options, array('placeholder' => $this->label, 'title' => $this->label))); $html = '<div class=" form-search btn-group">'; //Button group $html .= '<div class="input-append">'; $html .= $htmlInput; //Search Button $html .= JDom::_('html.link.button.icon', array('icon' => 'search', 'link_title' => JText::_('JSEARCH_FILTER_SUBMIT'), 'submitEventName' => 'onclick')); $html .= '</div>'; //Clear Button $html .= '<div class="btn-group">'; $html .= JDom::_('html.link.button.icon', array('icon' => 'remove', 'link_title' => JText::_('JSEARCH_FILTER_CLEAR'), 'link_js' => 'Joomla.resetFilters();', 'domClass' => '')); $html .= '</div>'; $html .= '</div>'; return $html; }
function build() { if (!$this->href) { $this->href = '#'; } JDom::_('framework.bootstrap'); if ($this->useFramework('bootstrap')) { $this->addSelector('rel', $this->rel); $this->link_title = $this->contents; } else { //Legacy MooTools tooltips $this->addClass('hasTip'); $this->addSelector('rel', $this->contents); } $html = '<a<%ID%><%CLASS%><%STYLE%><%TITLE%><%HREF%><%JS%><%TARGET%><%SELECTORS%>>' . $this->content . '</a>'; return $html; }
function buildItems() { $htmlItems = ''; if ($this->align == 'right') { $this->items = array_reverse($this->items); } foreach ($this->items as $item) { if (!count($item)) { continue; } $itemNameSpace = 'html.link.button.toolbar.' . strtolower($item[0]); $htmlItems .= JDom::_($itemNameSpace, array('item' => $item, 'checkList' => $this->list != null, 'ui' => $this->ui, 'display' => $this->display)) . LN; } $html = '<ul<%STYLE%><%CLASS%>>' . $htmlItems . '</ul>'; $html .= '<br clear="all"/>'; return $html; }
function build() { if (empty($this->list)) { return; } $html = ''; $html .= '<div class="cpanel">'; foreach ($this->list as $item) { $title = JText::_($item[0]); if ($this->maxLength && strlen($title) > $this->maxLength) { $title = substr($title, 0, $this->maxLength - 1) . '...'; } $class = 'ico-' . $this->iconSize . '-' . (isset($item[3]) ? $item[3] : null); $html .= JDom::_('html.link.menu.cpanel', array('content' => $title, 'href' => $item[1], 'link_title' => $item[0], 'imageClass' => $class, 'iconSize' => $this->iconSize, 'buttonWidth' => $this->buttonWidth, 'buttonHeight' => $this->buttonHeight)); } $html .= '</div>'; return $html; }
public function buildJs() { if ($this->jVersion('3.0')) { if ($this->enabled && $this->domId) { JHtml::_('sortablelist.sortable', $this->domId, $this->formId, strtolower($this->listDirn), $this->saveOrderingUrl, $this->proceedSaveOrderButton); } else { if ($this->proceedSaveOrderButton) { $this->buildJsSaveButton(); } } //JDom only create the saving button return; } //Legacy JDom::_('framework.jquery.ui', array('lib' => 'sortable')); $this->buildJsSortables(); $this->buildJsSaveButton(); }
function build() { $html = ''; //Image $image = JDom::_('html.fly.image', array('domClass' => $this->imageClass, 'width' => $this->iconSize, 'height' => $this->iconSize, 'title' => $this->link_title)); $html .= $image; //Label $html .= "<span>" . $this->content . "</span>"; //Too keep icon in middle, and little bit up. Javascript could be better here $paddingTop = ($this->buttonHeight - $this->iconSize) / 2 - $this->buttonHeight / 8; $paddingBottom = 0; //Embed html in a link $html = JDom::_('html.link', array_merge($this->options, array('content' => $html, 'styles' => array('width' => $this->buttonWidth . 'px', 'height' => $this->buttonHeight - $paddingTop . 'px', 'padding-top' => $paddingTop . 'px', 'padding-bottom' => $paddingBottom . 'px')))); //Embed html in button $html = JDom::_('html.fly', array('markup' => 'div', 'domClass' => 'button', 'dataValue' => $html)); //Embed html in floating $html = '<div style="float:left;">' . $html . '</div>'; return $html; }
function build() { //Chosen should not be used if (!$this->useFramework('chosen')) { return; } //Chosen is already in the core since Joomla 3.0. Load it from the class. if ($this->jVersion('3.0')) { JHtmlFormbehavior::chosen(); return; } JDom::_('framework.jquery.ui'); // Add chosen.jquery.js language strings JText::script('JGLOBAL_SELECT_SOME_OPTIONS'); JText::script('JGLOBAL_SELECT_AN_OPTION'); JText::script('JGLOBAL_SELECT_NO_RESULTS_MATCH'); $this->attachJs[] = 'chosen.jquery.min.js'; $this->attachCss[] = 'chosen.css'; }
function build() { $namespace = $size = null; switch ($this->display) { case 'combo': $size = null; $namespace = 'html.form.input.select.combo'; break; case 'radio': $namespace = 'html.form.input.select.radio'; break; case 'list': default: $namespace = 'html.form.input.select'; $size = 3; break; } $html = JDom::_($namespace, array_merge($this->options, array('list' => $this->list, 'listKey' => 'value', 'size' => $size, 'viewType' => 'text'))); return $html; }
function build() { if (!isset($this->rangeNameSpace)) { return; } $hz = $this->alignHz; $jDomFrom = JDom::_($this->rangeNameSpace, array_merge($this->options, array('dataKey' => $this->dataKey . '_from', 'dataValue' => isset($this->dataValueFrom) ? $this->dataValueFrom : null))); $jDomTo = JDom::_($this->rangeNameSpace, array_merge($this->options, array('dataKey' => $this->dataKey . '_to', 'dataValue' => isset($this->dataValueTo) ? $this->dataValueTo : null))); $html = ""; //FROM $html .= $hz ? '<div style="float:left">' . "\n" : ''; $html .= $this->JText($this->labelFrom) . "\n"; $html .= $jDomFrom; $html .= $hz ? '</div>' . "\n" : ''; //TO $html .= $hz ? '<div style="float:left">' . "\n" : ''; $html .= $this->JText($this->labelTo) . "\n"; $html .= $jDomTo; $html .= $hz ? '</div>' . "\n" : ''; return $html; }
function build() { $html = ''; $disableClassName = ''; $disabledLabel = ''; $handlerClass = 'inactive'; if ($this->canChange) { $handlerClass = 'sortable-handler hasTooltip'; } if (!$this->enabled) { $disabledLabel = JText::_('PLG_JDOM_ORDERING_DISABLED'); $disableClassName = 'inactive tip-top'; } $htmlIcon = JDom::_('html.icon', array('icon' => 'icomoon-menu')); $html .= JDom::_('html.fly', array('markup' => 'span', 'domClass' => $handlerClass . ' ' . $disableClassName, 'selectors' => array('title' => $disabledLabel), 'dataValue' => $htmlIcon)); if ($this->enabled) { //TEXT INPUT $html .= $this->buildInput($this->showInput); } return $html; }
function build() { $html = ''; $disableClassName = ''; $disabledLabel = ''; $handlerClass = 'inactive'; if ($this->canChange) { $handlerClass = 'hasTooltip'; } if (!$this->enabled) { $disabledLabel = JText::_('JORDERINGDISABLED'); $disableClassName = 'inactive tip-top'; } $htmlIcon = JDom::_('html.icon', array('icon' => $this->jVersion('3.0') ? 'menu' : 'move')); $html .= JDom::_('html.fly', array('markup' => 'span', 'domClass' => 'sortable-handler ' . $handlerClass . ' ' . $disableClassName, 'selectors' => array('title' => $disabledLabel), 'dataValue' => $htmlIcon)); if ($this->enabled) { $htmlInput = JDom::_('html.form.input', array('domName' => 'order[]', 'dataValue' => $this->dataValue, 'size' => 5, 'styles' => array('display' => 'none'), 'domClass' => 'width-20 text-area-order')); $html .= $htmlInput; } return $html; }
function getContent(&$type) { $type = ''; //Dispatcher switch ($this->getFileExt()) { case 'png': case 'jpg': case 'jpeg': case 'gif': case 'bmp': $type = 'image'; break; default: $type = 'path'; break; } $this->buildHref($type); if (!$this->thumb) { return JDom::_('html.fly.file.path', $this->options); } return JDom::_('html.fly.file.' . $type, $this->options); }
/** * Execute and display ajax queries * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayAjax($tpl = null) { $jinput = JFactory::getApplication()->input; $render = $jinput->get('render', null, 'CMD'); $token = $jinput->get('token', null, 'BASE64'); $values = $jinput->get('values', null, 'ARRAY'); switch ($render) { case 'select3': /* Ajax List : Manufacturers * Called from: view:printermdl, layout:printermodel */ $model = $this->getModel(); $model->addSelect('a.name'); $items = $model->getItems(); $selected = is_array($values) ? $values[count($values) - 1] : $values; $event = 'jQuery("#jform_manufacturer").val(this.value);'; echo '<div class="ajaxchain-filter ajaxchain-filter-hz">'; echo JDom::_('html.form.input.select', array('dataKey' => '__ajx_manufacturer', 'dataValue' => $selected, 'labelKey' => 'name', 'list' => $items, 'listKey' => 'id', 'nullLabel' => 'RTIPRINT_FILTER_NULL_MANUFACTURER', 'selectors' => array('onchange' => $event))); echo '</div>'; break; } exit; }