示例#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 = JUDownloadFrontHelper::UrlEncode($searchWord);

		$this->setRedirect(JRoute::_(JUDownloadHelperRoute::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_judownload&view=searchby&field_id=" . $this->id . "&value=" . JUDownloadFrontHelper::UrlEncode($option->value)) . "\">" . $option->text . "</a>";
					}
					else
					{
						$value = $option->text;
					}

					break;
				}
			}
		}

		$this->setVariable('value', $value);

		return $this->fetch('output.php', __CLASS__);
	}
示例#3
0
		}
		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_judownload&view=searchby&field_id=" . $this->id . "&value=" . JUDownloadFrontHelper::UrlEncode($value)) . "\">" . $value . "</a></span>";
				}
			}
			$html_values = implode("<span class='divider'>, </span>", $items);
		}
		else
		{
			$html_values = "";
		}
	}
	else
	{
		$html_values = $values;
	}