/** * Render item pagination * * @param array $config An optional array with configuration options * @return string Html * @see http://developer.yahoo.com/ypatterns/navigation/pagination/ */ public function pagination($config = array()) { $config = new KObjectConfigJson($config); $config->append(array( 'limit' => 0, )); $translator = $this->getObject('translator'); $html = '<div class="container" id="files-paginator-container">'; $html .= '<div class="pagination pagination-toolbar" id="files-paginator">'; $html .= '<div class="limit">'.$this->limit($config->toArray()).'</div>'; $html .= '<span class="start hidden"><a></a></span>'; $html .= '<ul class="pagination-list">'; $html .= $this->_pages(array()); $html .= '</ul>'; $html .= '<span class="end hidden"><a></a></span>'; $html .= '<div class="limit pull-right"> '; $html .= sprintf($translator->translate('JLIB_HTML_PAGE_CURRENT_OF_TOTAL'), '<strong class="page-current">1</strong>', '<strong class="page-total">1</strong></div>'); $html .= '</div>'; $html .= '</div>'; return $html; }
/** * Render item pagination * * @param array $config An optional array with configuration options * @return string Html * @see http://developer.yahoo.com/ypatterns/navigation/pagination/ */ public function pagination($config = array()) { $config = new KObjectConfigJson($config); $config->append(array('limit' => 0)); $html = '<div class="k-pagination" id="files-paginator">'; $html .= '<div class="k-pagination__limit">' . $this->limit($config->toArray()) . '</div>'; $html .= '<span class="start hidden"><a></a></span>'; $html .= '<ul class="k-pagination__pages pagination">'; $html .= $this->_pages(array()); $html .= '</ul>'; $html .= '<span class="end hidden"><a></a></span>'; return $html; }
/** * Widget for picking an icon * * Renders as a button that toggles a dropdown menu, with a list over selectable icon thumbs at the top * and a Choose Custom button that triggers a modal popup with a file browser for choosing a custom image. * * Used in document and category forms next to the title input element * * @param array $config * @return string */ public function icon($config = array()) { $config = new KObjectConfigJson($config); $config->append(array('name' => '', 'attribs' => array(), 'visible' => true, 'link' => '', 'link_text' => $this->getObject('translator')->translate('Select custom icon…')))->append(array('options' => array('custom_icon_path' => 'icon://', 'blank_icon_path' => 'media://system/images/blank.png'), 'icons' => array('archive', 'audio', 'default', 'document', 'folder', 'image', 'pdf', 'spreadsheet', 'video'), 'id' => $config->name, 'value' => $config->name))->append(array('callback' => 'select_' . $config->id, 'options' => array('id' => $config->id))); if ($config->callback) { $config->options->callback = $config->callback; //This value is passed to the modal.icon helper $config->callback = 'Docman.Modal.request_map.' . $config->callback; } $image = $config->value; $font_icon = true; if (!$image) { $image = 'default'; } if (substr($image, 0, 5) === 'icon:') { $image = 'icon://' . substr($image, 5); $font_icon = false; } $html = $this->getTemplate()->helper('bootstrap.load', array('javascript' => true)); $html .= '<ktml:script src="media://com_docman/js/modal.js" />'; $html .= '<div class="docman_dropdown_grid"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span id="' . $config->id . '-font-preview" class="koowa_icon--' . ($font_icon ? $image : '') . '" style="display:' . ($font_icon ? 'inline-block' : 'none') . '" ></span> <img id="' . $config->id . '-preview" data-src="' . $image . '" ' . ($font_icon ? '' : 'src="' . $image . '"') . ' onerror="this.src=\'' . $config->options->blank_image_path . '\'" style="display:' . ($font_icon ? 'none' : 'inline-block') . '" /> <span class="caret"></span> </a> <ul class="dropdown-menu">'; foreach ($config->icons as $icon) { $html .= '<li class="icon"><a href="#" title="' . $this->getObject('translator')->translate($icon) . '" data-value="' . $icon . '">'; $html .= '<span class="koowa_icon--' . $icon . '"><i>' . $this->getObject('translator')->translate($icon) . '</i></span>'; $html .= '</a></li>'; } $html .= ' <li class="spacer"></li> <li class="divider"></li> <li>'; $html .= $this->getTemplate()->helper('modal.icon', $config->toArray()); $html .= '</li> </ul> </div>'; /** * str_replace helps convert the paths before the template filter transform media:// to full path */ $options = str_replace('\\/', '/', $config->options->toString()); $html .= $this->icon_map(); /** * str_replace helps convert the paths before the template filter transform media:// to full path */ $html .= "<script>kQuery(function(\$){new Docman.Modal.Icon(" . $options . ");});</script>"; return $html; }