コード例 #1
0
 protected function getValue()
 {
     $value = null;
     $app = JFactory::getApplication();
     if ($app->isSite()) {
         if (isset($this->listing->tag_titles) && !is_null($this->listing->tag_ids) && !is_null($this->listing->tag_titles)) {
             $tags = array();
             if ($this->listing->tag_ids) {
                 $tagIdArr = explode(",", $this->listing->tag_ids);
                 $tagTitleArr = explode("|||", $this->listing->tag_titles);
                 foreach ($tagIdArr as $key => $tagId) {
                     $tag = new stdClass();
                     $tag->id = $tagIdArr[$key];
                     $tag->title = $tagTitleArr[$key];
                     $tags[] = $tag;
                 }
             }
             $value = $tags;
         } else {
             $value = JUDirectoryFrontHelper::getTagsByListingId($this->listing_id, 't.*', true, true, true);
         }
     } else {
         $value = JUDirectoryFrontHelper::getTagsByListingId($this->listing_id, 't.*', false, false, false);
     }
     return $value;
 }