示例#1
0
	protected function getValue()
	{
		$value = null;
		$app   = JFactory::getApplication();

		if ($app->isSite())
		{
			
			if (isset($this->doc->tag_titles) && !is_null($this->doc->tag_ids) && !is_null($this->doc->tag_titles))
			{
				$tags = array();
				
				if ($this->doc->tag_ids)
				{
					$tagIdArr    = explode(",", $this->doc->tag_ids);
					$tagTitleArr = explode("|||", $this->doc->tag_titles);
					foreach ($tagIdArr AS $key => $tagId)
					{
						$tag        = new stdClass();
						$tag->id    = $tagIdArr[$key];
						$tag->title = $tagTitleArr[$key];
						$tags[]     = $tag;
					}
				}

				$value = $tags;
			}
			else
			{
				$value = JUDownloadFrontHelper::getTagsByDocId($this->doc_id, 't.*', true, true, true);
			}
		}
		else
		{
			$value = JUDownloadFrontHelper::getTagsByDocId($this->doc_id, 't.*', false, false, false);
		}

		return $value;
	}