/** * Load the main Searchtools libraries * * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.2 */ public static function main($debug = null) { // Only load once if (empty(static::$loaded[__METHOD__])) { // Requires jQuery but allows to skip its loading if ($loadJquery = !isset($options['loadJquery']) || $options['loadJquery'] != 0) { RHtml::_('rjquery.framework'); } // Load the jQuery plugin && CSS RHelperAsset::load('jquery.searchtools.css', static::EXTENSION); RHelperAsset::load('jquery.searchtools.min.js', static::EXTENSION); static::$loaded[__METHOD__] = true; } return; }
* @package Redcore * @subpackage Layouts * * @copyright Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later, see LICENSE. */ defined('JPATH_REDCORE') or die; $data = $displayData; // Receive overridable options $data['options'] = !empty($data['options']) ? $data['options'] : array(); // Set some basic options $customOptions = array('filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters), 'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->getCfg('list_limit', 20), 'searchFieldSelector' => '#filter_search', 'orderFieldSelector' => '#list_fullordering'); $data['options'] = array_unique(array_merge($customOptions, $data['options'])); $formSelector = !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm'; // Load search tools RHtml::_('rsearchtools.form', $formSelector, $data['options']); ?> <div class="js-stools clearfix"> <div class="clearfix"> <div class="js-stools-container-bar"> <?php echo RLayoutHelper::render('searchtools.default.bar', $data); ?> </div> <div class="js-stools-container-list hidden-xs hidden-sm"> <?php echo RLayoutHelper::render('searchtools.default.list', $data); ?> </div> </div> <!-- Filters div -->
/** * Method to get the field label markup. * * @return string The field label markup. * * @since 11.1 */ protected function getLabel() { $label = ''; if ($this->hidden) { return $label; } // Get the label text from the XML element, defaulting to the element name. $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name']; $text = $this->translateLabel ? JText::_($text) : $text; // Build the class for the label. $class = !empty($this->description) ? 'hasTooltip' : ''; $class = $this->required == true ? $class . ' required' : $class; $class = !empty($this->labelClass) ? $class . ' ' . $this->labelClass : $class; // Add the opening label tag and main attributes attributes. $label .= '<label id="' . $this->id . '-lbl" for="' . $this->id . '" class="' . $class . '"'; // If a description is specified, use it to build a tooltip. if (!empty($this->description)) { RHtml::_('rbootstrap.tooltip'); $label .= ' title="' . RHtml::tooltipText(trim($text, ':'), JText::_($this->description), 0) . '"'; } // Add the label text and closing tag. if ($this->required) { $label .= '>' . $text . '<span class="star"> *</span></label>'; } else { $label .= '>' . $text . '</label>'; } return $label; }
<?php /** * @package Redcore * @subpackage Layouts * * @copyright Copyright (C) 2012 - 2013 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later, see LICENSE. */ defined('JPATH_REDCORE') or die; $data = $displayData; $metatitle = RHtml::tooltipText(JText::_($data->tip ? $data->tip : $data->title), JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN'), 0); RHtml::_('rbootstrap.tooltip'); ?> <a href="#" onclick="return false;" class="js-stools-column-order hasTooltip" data-order="<?php echo $data->order; ?> " data-direction="<?php echo strtoupper($data->direction); ?> " data-name="<?php echo JText::_($data->title); ?> " title="<?php echo $metatitle;
/** * This event is triggered immediately before pushing the document buffers into the template placeholders, * retrieving data from the document and pushing it into the into the JResponse buffer. * http://docs.joomla.org/Plugin/Events/System * * @return void */ public function onBeforeRender() { if (!$this->isRedcoreComponent()) { return; } $doc = JFactory::getDocument(); RHtml::_('rbootstrap.framework'); if ($doc->_scripts) { // Remove Mootools if ($this->disableMootools()) { $doc->addScriptDeclaration("function do_nothing() { return; }"); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools.js']); unset($doc->_scripts[JURI::root(true) . '/plugins/system/mtupgrade/mootools.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core-uncompressed.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/core-uncompressed.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption-uncompressed.js']); } // Remove jQuery unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']); // Remove bootstrap unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js']); } if ($doc->_styleSheets) { // Disable mootools if ($this->disableMootools()) { unset($doc->_styleSheets[JURI::root(true) . '/media/system/css/modal.css']); } } }
/** * This event is triggered before the framework creates the Head section of the Document. * * @return void * * @todo Find a cleaner way to prioritise assets */ public function onBeforeCompileHead() { if (!$this->isRedcoreComponent()) { return; } $doc = JFactory::getDocument(); $isAdmin = JFactory::getApplication()->isAdmin(); RHtmlMedia::loadFrameworkJs(); if ($doc->_scripts) { $template = JFactory::getApplication()->getTemplate(); // Remove Mootools if asked by view, or if it's a site view and it has been asked via plugin parameters if ($this->disableMootools() || !$isAdmin && RBootstrap::$disableFrontendMootools) { $doc->addScriptDeclaration("function do_nothing() { return; }"); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools.js']); unset($doc->_scripts[JURI::root(true) . '/plugins/system/mtupgrade/mootools.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core-uncompressed.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption-uncompressed.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal-uncompressed.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more-uncompressed.js']); if ($doc->_styleSheets) { unset($doc->_styleSheets[JURI::root(true) . '/media/system/css/modal.css']); } if (!$isAdmin) { unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']); unset($doc->_scripts[JURI::root(true) . '/media/system/js/core-uncompressed.js']); } } // Remove jQuery in administration, or if it's frontend site and it has been asked via plugin parameters if ($isAdmin || !$isAdmin && RBootstrap::$loadFrontendjQuery) { unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']); $jQueryChosen = false; if (isset($doc->_scripts[JURI::root(true) . '/media/jui/js/chosen.jquery.js']) || isset($doc->_scripts[JURI::root(true) . '/media/jui/js/chosen.jquery.min.js'])) { $jQueryChosen = true; unset($doc->_scripts[JURI::root(true) . '/media/jui/js/chosen.jquery.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/chosen.jquery.min.js']); unset($doc->_styleSheets[JURI::root(true) . '/media/jui/css/chosen.css']); unset($doc->_styleSheets[JURI::root(true) . '/media/jui/css/chosen.min.css']); } // Template specific overrides for jQuery files (valid in Joomla 3.x) unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/jquery.min.js']); unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/jquery.js']); unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/jquery-noconflict.js']); if (isset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/chosen.jquery.js']) || isset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/chosen.jquery.min.js'])) { $jQueryChosen = true; unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/chosen.jquery.js']); unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/chosen.jquery.min.js']); unset($doc->_styleSheets[JURI::root(true) . '/templates/' . $template . '/css/jui/chosen.css']); unset($doc->_styleSheets[JURI::root(true) . '/templates/' . $template . '/css/jui/chosen.min.css']); } // Enables chosen when it was removed if ($jQueryChosen) { RHtml::_('rjquery.chosen', 'select'); } } // Remove jQuery Migrate in administration, or if it's frontend site and it has been asked via plugin parameters if ($isAdmin || !$isAdmin && RBootstrap::$loadFrontendjQueryMigrate) { unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.js']); // Template specific overrides for jQuery files (valid in Joomla 3.x) unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/jquery-migrate.min.js']); unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/jquery-migrate.js']); } // Remove Bootstrap in administration, or if it's frontend site and it has been asked via plugin parameters if ($isAdmin || !$isAdmin && RBootstrap::$loadFrontendCSS) { unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.js']); unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js']); // Template specific overrides for jQuery files (valid in Joomla 3.x) unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/bootstrap.js']); unset($doc->_scripts[JURI::root(true) . '/templates/' . $template . '/js/jui/bootstrap.min.js']); } } }