public function renderJson() { $content = $this->_params['album']; $output = array(); $output['message'] = isset($this->_params['message']) ? $this->_params['message'] : ''; if (!empty($content['tagUsers'])) { $output['tagList'] = sonnb_XenGallery_Template_Helper_Tag::helperTags($content['tagUsers'], XenForo_Link::buildPublicLink('gallery/albums/tags', $content)); } else { $output['tagList'] = ''; } return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output); }
public function renderJson() { $content = $this->_params['content']; $output = array('image' => array($content['content_id'] => array('content_id' => $content['content_id'], 'tags' => array()))); if (!empty($content['tagUsers'])) { $output['tagList'] = sonnb_XenGallery_Template_Helper_Tag::helperTags($content['tagUsers'], XenForo_Link::buildPublicLink('gallery/' . $content['content_type'] . 's/tags', $content)); foreach ($content['tagUsers'] as $_tag) { $output['image'][$content['content_id']]['tags'][] = array('tag_id' => $_tag['tag_id'], 'username' => $_tag['username'], 'left' => $_tag['tag_x'], 'top' => $_tag['tag_y'], 'url' => XenForo_Link::buildPublicLink('gallery/authors', $_tag), 'isDeleteEnable' => $content['canEdit'] || $_tag['user_id'] == XenForo_Visitor::getUserId()); } } else { $output['tagList'] = ''; } return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output); }