Пример #1
0
 public function search()
 {
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $searchWord = $app->input->post->getString('searchword', '');
     $cat_id = $app->input->post->getInt('cat_id', 0);
     $sub_cat = $app->input->post->getInt('sub_cat', 0);
     $searchWord = JUDirectoryFrontHelper::UrlEncode($searchWord);
     $this->setRedirect(JRoute::_(JUDirectoryHelperRoute::getSearchRoute($cat_id, $sub_cat, $searchWord), false));
 }
Пример #2
0
 public function getOutput($options = array())
 {
     if (!$this->isPublished()) {
         return "";
     }
     $_value = $this->value;
     if ($_value == "") {
         return "";
     }
     $value = '';
     if ($_value) {
         $predefined_values = $this->getPredefinedValues();
         foreach ($predefined_values as $option) {
             if ($option->value == $_value) {
                 if ($this->params->get("tag_search", 0)) {
                     $value = "<a href =\"" . JRoute::_("index.php?option=com_judirectory&view=searchby&field_id=" . $this->id . "&value=" . JUDirectoryFrontHelper::UrlEncode($option->value)) . "\">" . $option->text . "</a>";
                 } else {
                     $value = $option->text;
                 }
                 break;
             }
         }
     }
     $this->setVariable('value', $value);
     return $this->fetch('output.php', __CLASS__);
 }
Пример #3
0
     $decimals = $this->params->get("digits_after_decimal", 2);
     $dec_point = $this->params->get("dec_point", ".");
     $thousands_sep = $this->params->get("use_thousands_sep", 0) ? $this->params->get("thousands_sep", ",") : "";
     $html_values = $this->numberFormat($values, $totalNumbers, $decimals, $dec_point, $thousands_sep);
 } elseif ($this->params->get("tag_search", 0)) {
     if (strpos($values, "|") !== false) {
         $values = explode("|", $values);
     } elseif (strpos($values, ",") !== false) {
         $values = explode(",", $values);
     }
     if ($values) {
         $items = array();
         $values = (array) $values;
         foreach ($values as $value) {
             if ($value) {
                 $items[] = "<span><a href =\"" . JRoute::_("index.php?option=com_judirectory&view=searchby&field_id=" . $this->id . "&value=" . JUDirectoryFrontHelper::UrlEncode($value)) . "\">" . $value . "</a></span>";
             }
         }
         $html_values = implode("<span class='divider'>, </span>", $items);
     } else {
         $html_values = "";
     }
 } else {
     $html_values = $values;
 }
 $html_values = $this->params->get("prepend_value", "") . $html_values . $this->params->get("append_value", "");
 if ($this->params->get("parse_plugin", 0)) {
     $html_values = JHtml::_('content.prepare', $html_values);
 }
 $html = "<div " . $this->getAttribute(null, null, "output") . " >";
 $html .= $html_values;
Пример #4
0
 * ------------------------------------------------------------------------
 *
 * @copyright      Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
if ($options) {
    $html = "<ul class='value-list'>";
    foreach ($options as $option) {
        if (in_array($option->value, $values)) {
            if ($option->text == strtoupper($option->text)) {
                $text = JText::_($option->text);
            } else {
                $text = $option->text;
            }
            $text = htmlspecialchars($text, ENT_COMPAT, 'UTF-8');
            if ($this->params->get("tag_search", 0)) {
                $item = "<a href =\"" . JRoute::_("index.php?option=com_judirectory&view=searchby&field_id=" . $this->id . "&value=" . JUDirectoryFrontHelper::UrlEncode($option->value)) . "\">" . $text . "</a>";
            } else {
                $item = $text;
            }
            $html .= "<li " . $this->getAttribute(null, null, "output") . ">" . $item . "</li>";
        }
    }
    $html .= "</ul>";
    echo $html;
}