protected function getInput()
 {
     $this->params = $this->element->attributes();
     RLFunctions::stylesheet('regularlabs/style.min.css');
     require_once __DIR__ . '/toggler.php';
     $toggler = new RLFieldToggler();
     $this->value = (int) $this->value;
     $label = $this->get('label');
     $param_name = $this->get('name');
     $noshow = $this->get('noshow', 0);
     $showclose = $this->get('showclose', 0);
     $html = array();
     if (!$label) {
         if (!$noshow) {
             $html[] = $toggler->getInput(array('div' => 1));
         }
         $html[] = $toggler->getInput(array('div' => 1));
         return '</div>' . implode('', $html);
     }
     $label = RLText::html_entity_decoder(JText::_($label));
     $html[] = '</div>';
     if (!$noshow) {
         $html[] = $toggler->getInput(array('div' => 1, 'param' => 'show_assignments|' . $param_name, 'value' => '1|1,2'));
     }
     $class = 'well well-small rl_well';
     if ($this->value === 1) {
         $class .= ' alert-success';
     } else {
         if ($this->value === 2) {
             $class .= ' alert-error';
         }
     }
     $html[] = '<div class="' . $class . '">';
     if ($showclose && JFactory::getUser()->authorise('core.admin')) {
         $html[] = '<button type="button" class="close rl_remove_assignment">&times;</button>';
     }
     $html[] = '<div class="control-group">';
     $html[] = '<div class="control-label">';
     $html[] = '<label><h4 class="rl_assignmentselection-header">' . $label . '</h4></label>';
     $html[] = '</div>';
     $html[] = '<div class="controls">';
     $html[] = '<fieldset id="' . $this->id . '"  class="radio btn-group">';
     $onclick = ' onclick="RegularLabsScripts.setToggleTitleClass(this, 0)"';
     $html[] = '<input type="radio" id="' . $this->id . '0" name="' . $this->name . '" value="0"' . (!$this->value ? ' checked="checked"' : '') . $onclick . '>';
     $html[] = '<label class="rl_btn-ignore" for="' . $this->id . '0">' . JText::_('RL_IGNORE') . '</label>';
     $onclick = ' onclick="RegularLabsScripts.setToggleTitleClass(this, 1)"';
     $html[] = '<input type="radio" id="' . $this->id . '1" name="' . $this->name . '" value="1"' . ($this->value === 1 ? ' checked="checked"' : '') . $onclick . '>';
     $html[] = '<label class="rl_btn-include" for="' . $this->id . '1">' . JText::_('RL_INCLUDE') . '</label>';
     $onclick = ' onclick="RegularLabsScripts.setToggleTitleClass(this, 2)"';
     $onclick .= ' onload="RegularLabsScripts.setToggleTitleClass(this, ' . $this->value . ', 7)"';
     $html[] = '<input type="radio" id="' . $this->id . '2" name="' . $this->name . '" value="2"' . ($this->value === 2 ? ' checked="checked"' : '') . $onclick . '>';
     $html[] = '<label class="rl_btn-exclude" for="' . $this->id . '2">' . JText::_('RL_EXCLUDE') . '</label>';
     $html[] = '</fieldset>';
     $html[] = '</div>';
     $html[] = '</div>';
     $html[] = '<div class="clearfix"> </div>';
     $html[] = $toggler->getInput(array('div' => 1, 'param' => $param_name, 'value' => '1,2'));
     $html[] = '<div><div>';
     return '</div>' . implode('', $html);
 }
Esempio n. 2
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $title = $this->get('label');
     $description = $this->get('description');
     $class = $this->get('class');
     $showclose = $this->get('showclose', 0);
     $start = $this->get('start', 0);
     $end = $this->get('end', 0);
     $html = array();
     if ($start || !$end) {
         $html[] = '</div>';
         if (strpos($class, 'alert') !== false) {
             $html[] = '<div class="alert ' . $class . '">';
         } else {
             $html[] = '<div class="well well-small ' . $class . '">';
         }
         if ($showclose && JFactory::getUser()->authorise('core.admin')) {
             $html[] = '<button type="button" class="close rl_remove_assignment">&times;</button>';
         }
         if ($title) {
             $html[] = '<h4>' . $this->prepareText($title) . '</h4>';
         }
         if ($description) {
             $html[] = '<div>' . $this->prepareText($description) . '</div>';
         }
         $html[] = '<div><div>';
     }
     if (!$start && !$end) {
         $html[] = '</div>';
     }
     return '</div>' . implode('', $html);
 }
Esempio n. 3
0
 protected function getInput()
 {
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $this->params = $this->element->attributes();
     $value = $this->value;
     if (!is_array($value)) {
         $value = explode(',', $value);
     }
     $classes = array('reglab icon-contenttemplater', 'home', 'user', 'locked', 'comments', 'comments-2', 'out', 'plus', 'pencil', 'pencil-2', 'file', 'file-add', 'file-remove', 'copy', 'folder', 'folder-2', 'picture', 'pictures', 'list-view', 'power-cord', 'cube', 'puzzle', 'flag', 'tools', 'cogs', 'cog', 'equalizer', 'wrench', 'brush', 'eye', 'star', 'calendar', 'calendar-2', 'help', 'support', 'warning', 'checkmark', 'mail', 'mail-2', 'drawer', 'drawer-2', 'box-add', 'box-remove', 'search', 'filter', 'camera', 'play', 'music', 'grid-view', 'grid-view-2', 'menu', 'thumbs-up', 'thumbs-down', 'plus-2', 'minus-2', 'key', 'quote', 'quote-2', 'database', 'location', 'zoom-in', 'zoom-out', 'health', 'wand', 'refresh', 'vcard', 'clock', 'compass', 'address', 'feed', 'flag-2', 'pin', 'lamp', 'chart', 'bars', 'pie', 'dashboard', 'lightning', 'move', 'printer', 'color-palette', 'camera-2', 'cart', 'basket', 'broadcast', 'screen', 'tablet', 'mobile', 'users', 'briefcase', 'download', 'upload', 'bookmark', 'out-2');
     $html = array();
     if ($this->get('show_none')) {
         $checked = in_array('0', $value) ? ' checked="checked"' : '';
         $html[] = '<fieldset>';
         $html[] = '<input type="radio" id="' . $this->id . '0" name="' . $this->name . '"' . ' value="0"' . $checked . '>';
         $html[] = '<label for="' . $this->id . '0">' . JText::_('RL_NO_ICON') . '</label>';
         $html[] = '</fieldset>';
     }
     foreach ($classes as $i => $class) {
         $checked = in_array($class, $value) ? ' checked="checked"' : '';
         $html[] = '<fieldset class="pull-left">';
         $html[] = '<input type="radio" id="' . $this->id . $class . '" name="' . $this->name . '"' . ' value="' . htmlspecialchars($class, ENT_COMPAT, 'UTF-8') . '"' . $checked . '>';
         $html[] = '<label for="' . $this->id . $class . '" class="btn btn-small"><span class="icon-' . $class . '"></span></label>';
         $html[] = '</fieldset>';
     }
     return '<div id="' . $this->id . '" class="btn-group radio rl_icon_group">' . implode('', $html) . '</div>';
 }
Esempio n. 4
0
 function render()
 {
     $url = JFactory::getApplication()->input->getString('url', '');
     if ($url) {
         echo RLFunctions::getByUrl($url);
         die;
     }
     $allowed = array('administrator/components/com_dbreplacer/ajax.php', 'administrator/modules/mod_addtomenu/popup.php', 'media/rereplacer/images/popup.php', 'plugins/editors-xtd/articlesanywhere/popup.php', 'plugins/editors-xtd/contenttemplater/data.php', 'plugins/editors-xtd/contenttemplater/popup.php', 'plugins/editors-xtd/dummycontent/popup.php', 'plugins/editors-xtd/modals/popup.php', 'plugins/editors-xtd/modulesanywhere/popup.php', 'plugins/editors-xtd/sliders/data.php', 'plugins/editors-xtd/sliders/popup.php', 'plugins/editors-xtd/snippets/popup.php', 'plugins/editors-xtd/sourcerer/popup.php', 'plugins/editors-xtd/tabs/data.php', 'plugins/editors-xtd/tabs/popup.php', 'plugins/editors-xtd/tooltips/popup.php');
     $file = JFactory::getApplication()->input->getString('file', '');
     $folder = JFactory::getApplication()->input->getString('folder', '');
     if ($folder) {
         $file = implode('/', explode('.', $folder)) . '/' . $file;
     }
     if (!$file || in_array($file, $allowed) === false) {
         die;
     }
     jimport('joomla.filesystem.file');
     if (JFactory::getApplication()->isSite()) {
         JFactory::getApplication()->setTemplate('../administrator/templates/isis');
     }
     $_REQUEST['tmpl'] = 'component';
     JFactory::getApplication()->input->set('option', 'com_content');
     switch (JFactory::getApplication()->input->getCmd('format', 'html')) {
         case 'json':
             $format = 'application/json';
             break;
         default:
         case 'html':
             $format = 'text/html';
             break;
     }
     header('Content-Type: ' . $format . '; charset=utf-8');
     JHtml::_('bootstrap.framework');
     JFactory::getDocument()->addScript(JUri::root(true) . '/administrator/templates/isis/js/template.js');
     JFactory::getDocument()->addStyleSheet(JUri::root(true) . '/administrator/templates/isis/css/template.css');
     RLFunctions::stylesheet('regularlabs/popup.min.css');
     $file = JPATH_SITE . '/' . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     JFactory::getDocument()->setBuffer($html, 'component');
     $app = new RLApplication();
     $app->render();
     $html = JFactory::getApplication()->toString(JFactory::getApplication()->getCfg('gzip'));
     $html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]*( /)?>#s', '', $html);
     $html = preg_replace('#(<' . 'body [^>]*class=")#s', '\\1reglab-popup ', $html);
     $html = str_replace('<' . 'body>', '<' . 'body class="reglab-popup"', $html);
     echo $html;
     die;
 }
Esempio n. 5
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $showcheckall = $this->get('showcheckall', 0);
     $checkall = $this->value == '*';
     if (!$checkall) {
         if (!is_array($this->value)) {
             $this->value = explode(',', $this->value);
         }
     }
     $options = array();
     foreach ($this->element->children() as $option) {
         if ($option->getName() != 'option') {
             continue;
         }
         $text = trim((string) $option);
         $hasval = 0;
         if (isset($option['value'])) {
             $val = (string) $option['value'];
             $disabled = (int) $option['disabled'];
             $hasval = 1;
         }
         if ($hasval) {
             $option = '<input type="checkbox" class="rl_' . $this->id . '" id="' . $this->id . $val . '" name="' . $this->name . '[]" value="' . $val . '"';
             if ($checkall || in_array($val, $this->value)) {
                 $option .= ' checked="checked"';
             }
             if ($disabled) {
                 $option .= ' disabled="disabled"';
             }
             $option .= '> <label for="' . $this->id . $val . '" class="checkboxes">' . JText::_($text) . '</label>';
         } else {
             $option = '<label style="clear:both;"><strong>' . JText::_($text) . '</strong></label>';
         }
         $options[] = $option;
     }
     $options = implode('', $options);
     if ($showcheckall) {
         $checkers = array();
         if ($showcheckall) {
             $checkers[] = '<input id="rl_checkall_' . $this->id . '" type="checkbox" onclick=" RegularLabsScripts.checkAll( this, \'rl_' . $this->id . '\' );"> ' . JText::_('JALL');
             $js = "\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tRegularLabsScripts.initCheckAlls('rl_checkall_" . $this->id . "', 'rl_" . $this->id . "');\n\t\t\t\t\t});\n\t\t\t\t";
             JFactory::getDocument()->addScriptDeclaration($js);
         }
         $options = implode('&nbsp;&nbsp;&nbsp;', $checkers) . '<br>' . $options;
     }
     $options .= '<input type="hidden" id="' . $this->id . 'x" name="' . $this->name . '' . '[]" value="x" checked="checked">';
     $html = array();
     $html[] = '<fieldset id="' . $this->id . '" class="checkbox">';
     $html[] = $options;
     $html[] = '</fieldset>';
     return implode('', $html);
 }
 function getInput($name, $id, $value, $params)
 {
     $this->name = $name;
     $this->id = $id;
     $this->value = $value;
     $this->params = $params;
     $action = '';
     if ($this->get('inlist', 0) && $this->get('action')) {
         $this->name = $name . $id;
         $this->id = $name . $id;
         $action = ' onchange="' . $this->get('action') . '"';
     }
     RLFunctions::script('regularlabs/colorpicker.min.js');
     RLFunctions::stylesheet('regularlabs/colorpicker.min.css');
     $class = ' class="' . trim('nncolorpicker chzn-done ' . $this->get('class')) . '"';
     $color = strtolower($this->value);
     if (!$color || in_array($color, array('none', 'transparent'))) {
         $color = 'none';
     } else {
         if ($color['0'] != '#') {
             $color = '#' . $color;
         }
     }
     $colors = $this->get('colors');
     if (empty($colors)) {
         $colors = array('none', '#049cdb', '#46a546', '#9d261d', '#ffc40d', '#f89406', '#c3325f', '#7a43b6', '#ffffff', '#999999', '#555555', '#000000');
     } else {
         $colors = explode(',', $colors);
     }
     $split = (int) $this->get('split');
     if (!$split) {
         $count = count($colors);
         if ($count % 5 == 0) {
             $split = 5;
         } else {
             if ($count % 4 == 0) {
                 $split = 4;
             }
         }
     }
     $split = $split ? $split : 3;
     $html = array();
     $html[] = '<select ' . $action . ' name="' . $this->name . '" id="' . $this->id . '"' . $class . ' style="visibility:hidden;width:22px;height:1px">';
     foreach ($colors as $i => $c) {
         $html[] = '<option' . ($c == $color ? ' selected="selected"' : '') . '>' . $c . '</option>';
         if (($i + 1) % $split == 0) {
             $html[] = '<option>-</option>';
         }
     }
     $html[] = '</select>';
     return implode('', $html);
 }
Esempio n. 7
0
 function getInput($name, $id, $value, $params)
 {
     $this->name = $name;
     $this->id = $id;
     $this->value = $value;
     $this->params = $params;
     $class = trim('rl_color minicolors ' . $this->get('class'));
     $disabled = $this->get('disabled') ? ' disabled="disabled"' : '';
     RLFunctions::script('regularlabs/color.min.js');
     RLFunctions::stylesheet('regularlabs/color.min.css');
     $this->value = strtolower(strtoupper(preg_replace('#[^a-z0-9]#si', '', $this->value)));
     return '<input type="text" name="' . $this->name . '" id="' . $this->id . '" class="' . $class . '" value="' . $this->value . '"' . $disabled . '>';
 }
Esempio n. 8
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $label = RLText::html_entity_decoder(JText::_($this->get('label')));
     $description = $this->prepareText($this->get('description'));
     $lang_file = $this->get('language_file');
     $html = '</td></tr></table></div></div>';
     $html .= '<div class="panel"><h3 class="jpane-toggler title" id="advanced-page"><span>';
     $html .= $label;
     $html .= '</span></h3>';
     $html .= '<div class="jpane-slider content"><table width="100%" class="paramlist admintable" cellspacing="1"><tr><td colspan="2" class="paramlist_value">';
     if ($lang_file) {
         jimport('joomla.filesystem.file');
         // Include extra language file
         $lang = str_replace('_', '-', JFactory::getLanguage()->getTag());
         $inc = '';
         $lang_path = 'language/' . $lang . '/' . $lang . '.' . $lang_file . '.inc.php';
         if (JFile::exists(JPATH_ADMINISTRATOR . '/' . $lang_path)) {
             $inc = JPATH_ADMINISTRATOR . '/' . $lang_path;
         } else {
             if (JFile::exists(JPATH_SITE . '/' . $lang_path)) {
                 $inc = JPATH_SITE . '/' . $lang_path;
             }
         }
         if (!$inc && $lang != 'en-GB') {
             $lang = 'en-GB';
             $lang_path = 'language/' . $lang . '/' . $lang . '.' . $lang_file . '.inc.php';
             if (JFile::exists(JPATH_ADMINISTRATOR . '/' . $lang_path)) {
                 $inc = JPATH_ADMINISTRATOR . '/' . $lang_path;
             } else {
                 if (JFile::exists(JPATH_SITE . '/' . $lang_path)) {
                     $inc = JPATH_SITE . '/' . $lang_path;
                 }
             }
         }
         if ($inc) {
             include $inc;
         }
     }
     if ($description) {
         if ($description['0'] != '<') {
             $description = '<p>' . $description . '</p>';
         }
         $class = 'rl_panel rl_panel_description';
         $html .= '<div class="' . $class . '"><div class="rl_block rl_title">';
         $html .= $description;
         $html .= '<div style="clear: both;"></div></div></div>';
     }
     return $html;
 }
Esempio n. 9
0
 protected function getLabel()
 {
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $this->params = $this->element->attributes();
     $label = $this->prepareText($this->get('label'));
     $tooltip = $this->prepareText($this->get('description'));
     if (!$label && !$tooltip) {
         return '';
     }
     if (!$label) {
         return '<div>' . $tooltip . '</div>';
     }
     if (!$tooltip) {
         return '<div>' . $label . '</div>';
     }
     return '<label class="hasTooltip" title="<strong>' . $label . '</strong><br>' . htmlentities($tooltip) . '">' . $label . '</label>';
 }
Esempio n. 10
0
 function render()
 {
     if (!isset($this->params->display_link)) {
         return;
     }
     require_once JPATH_LIBRARIES . '/regularlabs/helpers/functions.php';
     require_once JPATH_LIBRARIES . '/regularlabs/helpers/text.php';
     // load the admin language file
     RLFunctions::loadLanguage('mod_cachecleaner');
     $script = "\n\t\t\tvar cachecleaner_base = '" . JUri::base(true) . "';\n\t\t\tvar cachecleaner_root = '" . JUri::root() . "';\n\t\t\tvar cachecleaner_msg_clean = '" . addslashes(RLText::html_entity_decoder(JText::_('CC_CLEANING_CACHE'))) . "';\n\t\t\tvar cachecleaner_msg_inactive = '" . addslashes(RLText::html_entity_decoder(JText::sprintf('CC_SYSTEM_PLUGIN_NOT_ENABLED', '<a href=&quot;index.php?option=com_plugins&filter_type=system&filter_folder=system&search=cache cleaner&filter_search=cache cleaner&quot;>', '</a>'))) . "';\n\t\t\tvar cachecleaner_msg_failure = '" . addslashes(RLText::html_entity_decoder(JText::_('CC_CACHE_COULD_NOT_BE_CLEANED'))) . "';";
     JFactory::getDocument()->addScriptDeclaration($script);
     RLFunctions::script('regularlabs/script.min.js');
     RLFunctions::script('cachecleaner/script.min.js', '5.2.0');
     RLFunctions::stylesheet('regularlabs/style.min.css');
     RLFunctions::stylesheet('cachecleaner/style.min.css', '5.2.0');
     $text_ini = strtoupper(str_replace(' ', '_', $this->params->icon_text));
     $text = JText::_($text_ini);
     if ($text == $text_ini) {
         $text = JText::_($this->params->icon_text);
     }
     if ($this->params->display_toolbar_button) {
         // Generate html for toolbar button
         $html = array();
         $html[] = '<a href="javascript:;" onclick="return false;"  class="btn btn-small cachecleaner_link">';
         $html[] = '<span class="icon-reglab icon-cachecleaner"></span> ';
         $html[] = $text;
         $html[] = '</a>';
         $toolbar = JToolBar::getInstance('toolbar');
         $toolbar->appendButton('Custom', implode('', $html));
     }
     // Generate html for status link
     $html = array();
     $html[] = '<div class="btn-group cachecleaner">';
     $html[] = '<a href="javascript:;" onclick="return false;" class="cachecleaner_link">';
     if ($this->params->display_link != 'text') {
         $html[] = '<span class="icon-reglab icon-cachecleaner"></span> ';
     }
     if ($this->params->display_link != 'icon') {
         $html[] = $text;
     }
     $html[] = '</a>';
     $html[] = '</div>';
     echo implode('', $html);
 }
Esempio n. 11
0
 protected function getLabel()
 {
     $this->params = $this->element->attributes();
     $resize = $this->get('resize', 0);
     $label = RLText::html_entity_decoder(JText::_($this->get('label')));
     $html = '<label id="' . $this->id . '-lbl" for="' . $this->id . '"';
     if ($this->description) {
         $html .= ' class="hasTooltip" title="<strong>' . $label . '</strong><br>' . JText::_($this->description) . '">';
     } else {
         $html .= '>';
     }
     $html .= $label;
     if ($resize) {
         JHtml::_('jquery.framework');
         RLFunctions::script('regularlabs/script.min.js');
         RLFunctions::stylesheet('regularlabs/style.min.css');
         $html .= '<br><span role="button" class="rl_resize_textarea rl_maximize"' . ' data-id="' . $this->id . '"  data-min="' . $this->get('height', 80) . '" data-max="' . $resize . '">' . '<span class="rl_resize_textarea_maximize">' . '[ + ]' . '</span>' . '<span class="rl_resize_textarea_minimize">' . '[ - ]' . '</span>' . '</span>';
     }
     $html .= '</label>';
     return $html;
 }
Esempio n. 12
0
 protected function getInput()
 {
     RLFunctions::stylesheet('regularlabs/style.min.css');
     return '<div class="rl_panel rl_hr"></div>';
 }
Esempio n. 13
0
    static function selectlist(&$options, $name, $value, $id, $size = 0, $multiple = 0, $simple = 0)
    {
        if (empty($options)) {
            return '<fieldset class="radio">' . JText::_('RL_NO_ITEMS_FOUND') . '</fieldset>';
        }
        require_once __DIR__ . '/parameters.php';
        $parameters = RLParameters::getInstance();
        $params = $parameters->getPluginParams('regularlabs');
        if (!is_array($value)) {
            $value = explode(',', $value);
        }
        $count = 0;
        if ($options != -1) {
            foreach ($options as $option) {
                $count++;
                if (isset($option->links)) {
                    $count += count($option->links);
                }
                if ($count > $params->max_list_count) {
                    break;
                }
            }
        }
        if ($options == -1 || $count > $params->max_list_count) {
            if (is_array($value)) {
                $value = implode(',', $value);
            }
            if (!$value) {
                $input = '<textarea name="' . $name . '" id="' . $id . '" cols="40" rows="5">' . $value . '</textarea>';
            } else {
                $input = '<input type="text" name="' . $name . '" id="' . $id . '" value="' . $value . '" size="60">';
            }
            return '<fieldset class="radio"><label for="' . $id . '">' . JText::_('RL_ITEM_IDS') . ':</label>' . $input . '</fieldset>';
        }
        if (!$multiple) {
            $first_level = isset($options['0']->level) ? $options['0']->level : 0;
            foreach ($options as &$option) {
                if (!isset($option->level)) {
                    continue;
                }
                $repeat = $option->level - $first_level > 0 ? $option->level - $first_level : 0;
                $option->text = str_repeat(' - ', $repeat) . $option->text;
            }
            $html = JHtml::_('select.genericlist', $options, $name, 'class="inputbox"', 'value', 'text', $value);
            return self::handlePreparedStyles($html);
        }
        $size = (int) $size ?: 300;
        if ($simple) {
            $attr = 'style="width: ' . $size . 'px"';
            $attr .= $multiple ? ' multiple="multiple"' : '';
            $html = JHtml::_('select.genericlist', $options, $name, trim($attr), 'value', 'text', $value, $id);
            return self::handlePreparedStyles($html);
        }
        require_once __DIR__ . '/functions.php';
        RLFunctions::loadLanguage('com_modules', JPATH_ADMINISTRATOR);
        RLFunctions::script('regularlabs/multiselect.min.js');
        RLFunctions::stylesheet('regularlabs/multiselect.min.css');
        $html = array();
        $html[] = '<div class="well well-small rl_multiselect" id="' . $id . '">';
        $html[] = '
			<div class="form-inline rl_multiselect-controls">
				<span class="small">' . JText::_('JSELECT') . ':
					<a class="rl_multiselect-checkall" href="javascript:;">' . JText::_('JALL') . '</a>,
					<a class="rl_multiselect-uncheckall" href="javascript:;">' . JText::_('JNONE') . '</a>,
					<a class="rl_multiselect-toggleall" href="javascript:;">' . JText::_('RL_TOGGLE') . '</a>
				</span>
				<span class="width-20">|</span>
				<span class="small">' . JText::_('RL_EXPAND') . ':
					<a class="rl_multiselect-expandall" href="javascript:;">' . JText::_('JALL') . '</a>,
					<a class="rl_multiselect-collapseall" href="javascript:;">' . JText::_('JNONE') . '</a>
				</span>
				<span class="width-20">|</span>
				<span class="small">' . JText::_('JSHOW') . ':
					<a class="rl_multiselect-showall" href="javascript:;">' . JText::_('JALL') . '</a>,
					<a class="rl_multiselect-showselected" href="javascript:;">' . JText::_('RL_SELECTED') . '</a>
				</span>
				<span class="rl_multiselect-maxmin">
				<span class="width-20">|</span>
				<span class="small">
					<a class="rl_multiselect-maximize" href="javascript:;">' . JText::_('RL_MAXIMIZE') . '</a>
					<a class="rl_multiselect-minimize" style="display:none;" href="javascript:;">' . JText::_('RL_MINIMIZE') . '</a>
				</span>
				</span>
				<input type="text" name="rl_multiselect-filter" class="rl_multiselect-filter input-medium search-query pull-right" size="16"
					autocomplete="off" placeholder="' . JText::_('JSEARCH_FILTER') . '" aria-invalid="false" tabindex="-1">
			</div>

			<div class="clearfix"></div>

			<hr class="hr-condensed">';
        $o = array();
        foreach ($options as $option) {
            $option->level = isset($option->level) ? $option->level : 0;
            $o[] = $option;
            if (isset($option->links)) {
                foreach ($option->links as $link) {
                    $link->level = $option->level + (isset($link->level) ? $link->level : 1);
                    $o[] = $link;
                }
            }
        }
        $html[] = '<ul class="rl_multiselect-ul" style="max-height:300px;min-width:' . $size . 'px;overflow-x: hidden;">';
        $prevlevel = 0;
        foreach ($o as $i => $option) {
            if ($prevlevel < $option->level) {
                // correct wrong level indentations
                $option->level = $prevlevel + 1;
                $html[] = '<ul class="rl_multiselect-sub">';
            } else {
                if ($prevlevel > $option->level) {
                    $html[] = str_repeat('</li></ul>', $prevlevel - $option->level);
                } else {
                    if ($i) {
                        $html[] = '</li>';
                    }
                }
            }
            $labelclass = trim('pull-left ' . (isset($option->labelclass) ? $option->labelclass : ''));
            $html[] = '<li>';
            $item = '<div class="' . trim('rl_multiselect-item pull-left ' . (isset($option->class) ? $option->class : '')) . '">';
            if (isset($option->title)) {
                $labelclass .= ' nav-header';
            }
            if (isset($option->title) && (!isset($option->value) || !$option->value)) {
                $item .= '<label class="' . $labelclass . '">' . $option->title . '</label>';
            } else {
                $selected = in_array($option->value, $value) ? ' checked="checked"' : '';
                $disabled = isset($option->disable) && $option->disable ? ' readonly="readonly" style="visibility:hidden"' : '';
                $item .= '<input type="checkbox" class="pull-left" name="' . $name . '" id="' . $id . $option->value . '" value="' . $option->value . '"' . $selected . $disabled . '>
					<label for="' . $id . $option->value . '" class="' . $labelclass . '">' . $option->text . '</label>';
            }
            $item .= '</div>';
            $html[] = $item;
            if (!isset($o[$i + 1]) && $option->level > 0) {
                $html[] = str_repeat('</li></ul>', (int) $option->level);
            }
            $prevlevel = $option->level;
        }
        $html[] = '</ul>';
        $html[] = '
			<div style="display:none;" class="rl_multiselect-menu-block">
				<div class="pull-left nav-hover rl_multiselect-menu">
					<div class="btn-group">
						<a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-micro">
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li class="nav-header">' . JText::_('COM_MODULES_SUBITEMS') . '</li>
							<li class="divider"></li>
							<li class=""><a class="checkall" href="javascript:;"><span class="icon-checkbox"></span> ' . JText::_('JSELECT') . '</a>
							</li>
							<li><a class="uncheckall" href="javascript:;"><span class="icon-checkbox-unchecked"></span> ' . JText::_('COM_MODULES_DESELECT') . '</a>
							</li>
							<div class="rl_multiselect-menu-expand">
								<li class="divider"></li>
								<li><a class="expandall" href="javascript:;"><span class="icon-plus"></span> ' . JText::_('RL_EXPAND') . '</a></li>
								<li><a class="collapseall" href="javascript:;"><span class="icon-minus"></span> ' . JText::_('RL_COLLAPSE') . '</a></li>
							</div>
						</ul>
					</div>
				</div>
			</div>';
        $html[] = '</div>';
        $html = implode('', $html);
        return self::handlePreparedStyles($html);
    }
Esempio n. 14
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     RLFunctions::stylesheet('regularlabs/style.min.css');
     $title = $this->get('label');
     $description = $this->get('description');
     $xml = $this->get('xml');
     $url = $this->get('url');
     if ($description) {
         // variables
         $v1 = $this->get('var1');
         $v2 = $this->get('var2');
         $v3 = $this->get('var3');
         $v4 = $this->get('var4');
         $v5 = $this->get('var5');
         $description = RLText::html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
     }
     if ($title) {
         $title = JText::_($title);
     }
     if ($description) {
         $description = str_replace('span style="font-family:monospace;"', 'span class="rl_code"', $description);
         if ($description['0'] != '<') {
             $description = '<p>' . $description . '</p>';
         }
     }
     if (!$xml && $this->form->getValue('element')) {
         if ($this->form->getValue('folder')) {
             $xml = 'plugins/' . $this->form->getValue('folder') . '/' . $this->form->getValue('element') . '/' . $this->form->getValue('element') . '.xml';
         } else {
             $xml = 'administrator/modules/' . $this->form->getValue('element') . '/' . $this->form->getValue('element') . '.xml';
         }
     }
     if ($xml) {
         $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . '/' . $xml);
         $version = 0;
         if ($xml && isset($xml['version'])) {
             $version = $xml['version'];
         }
         if ($version) {
             if (strpos($version, 'PRO') !== false) {
                 $version = str_replace('PRO', '', $version);
                 $version .= ' <small style="color:green">[PRO]</small>';
             } else {
                 if (strpos($version, 'FREE') !== false) {
                     $version = str_replace('FREE', '', $version);
                     $version .= ' <small style="color:green">[FREE]</small>';
                 }
             }
             if ($title) {
                 $title .= ' v';
             } else {
                 $title = JText::_('Version') . ' ';
             }
             $title .= $version;
         }
     }
     $html = array();
     if ($title) {
         if ($url) {
             $title = '<a href="' . $url . '" target="_blank" title="' . preg_replace('#<[^>]*>#', '', $title) . '">' . $title . '</a>';
         }
         $html[] = '<h4>' . RLText::html_entity_decoder($title) . '</h4>';
     }
     if ($description) {
         $html[] = $description;
     }
     if ($url) {
         $html[] = '<p><a href="' . $url . '" target="_blank" title="' . JText::_('RL_MORE_INFO') . '">' . JText::_('RL_MORE_INFO') . '...</a></p>';
     }
     return '</div><div>' . implode('', $html);
 }