本文整理汇总了PHP中Phpfox::isPublicView方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::isPublicView方法的具体用法?PHP Phpfox::isPublicView怎么用?PHP Phpfox::isPublicView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::isPublicView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
Phpfox::getLib('setting')->setParam(array('profiles.url_image' => Phpfox::getParam('core.url_pic') . 'profiles/'));
$mUser = $this->request()->get('req2');
$sSection = $this->request()->get('req3');
$bIsPublicItemView = false;
if (Phpfox::isPublicView()) {
if (!empty($sSection) && Phpfox::isModule($sSection) && $sSection != 'designer' && Phpfox::hasCallback($sSection, 'getItemView') && Phpfox::callback($sSection . '.getItemView') === true) {
$bIsPublicItemView = true;
}
}
if (!$mUser) {
if (Phpfox::isUser()) {
$this->url()->send('profile');
} else {
Phpfox::isUser(true);
}
}
// If we are unable to find a user lets make sure we return a 404 page not found error
$aExtraProfile = Phpfox::getService('profiles')->getProfile($mUser);
if (count($aExtraProfile) == 0) {
return Phpfox::getLib('module')->setController('error.404');
}
$aUser = Phpfox::getService('user')->get($aExtraProfile['user_id']);
$this->setParam('aExtraProfile', $aExtraProfile);
$this->template()->assign(array('aExtraProfile' => $aExtraProfile));
if (Phpfox::getService('user.block')->isBlocked($aExtraProfile['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy')) {
$this->url()->send($aUser['user_name']);
}
if (!Phpfox::getService('user.privacy')->hasAccess($aExtraProfile['user_id'], 'profile.view_profile')) {
$this->url()->send($aUser['user_name']);
}
//This is where I want to add $this->request()->get('req3') == gallery
if (!empty($sSection) && $sSection == 'photo') {
Phpfox::getLib('module')->setController('profiles.view');
}
Phpfox::getUserParam('profile.can_view_users_profile', true);
$this->template()->setHeader('cache', array('profile.css' => 'style_css', 'feed.js' => 'module_feed'));
$this->template()->setMeta('description', Phpfox::getPhrase('profiles.meta_description', array('extra_name' => $aExtraProfile['title'], 'site_title' => Phpfox::getParam('core.site_title'), 'meta_description_profile' => Phpfox::getParam('core.meta_description_profile'))));
$sPageTitle = $aExtraProfile['title'];
$this->setParam('aFeed', array('comment_type_id' => 'profiles', 'privacy' => 0, 'comment_privacy' => 0, 'item_id' => $aExtraProfile['extra_id'], 'like_type_id' => 'profiles', 'feed_is_liked' => isset($aExtraProfile['is_liked']) ? $aExtraProfile['is_liked'] : false, 'user_id' => $aExtraProfile['user_id'], 'total_comment' => $aExtraProfile['total_comment'], 'total_like' => 0, 'feed_link' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url']), 'feed_title' => $aExtraProfile['title'], 'feed_display' => 'view', 'report_module' => 'profiles', 'report_phrase' => Phpfox::getPhrase('profiles.report_this_profile')));
if ($this->request()->get('req3') != 'photo') {
$this->template()->setBreadcrumb($sPageTitle, Phpfox::getLib('url')->makeUrl('profiles.browse'));
} elseif ($this->request()->get('req3') == '') {
$this->template()->setBreadcrumb(Phpfox::getPhrase('profiles.extra_profiles'), Phpfox::getLib('url')->makeUrl('profiles.browse'));
}
$this->template()->setTitle($sPageTitle)->setEditor(array('load' => 'simple', 'wysiwyg' => Phpfox::isModule('comment') && Phpfox::getParam('comment.wysiwyg_comments') && Phpfox::getUserParam('comment.wysiwyg_on_comments')))->setUrl('profiles')->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'));
if ($this->request()->get('update')) {
$this->template()->setHeader('<script type="text/javascript">window.parent.tb_remove();</script>');
}
if ($sPlugin = Phpfox_Plugin::get('profiles.component_controller_index_end')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
}
示例2: process
public function process()
{
Phpfox::getLib('setting')->setParam(array('profiles.url_image' => Phpfox::getParam('core.url_pic') . 'profiles/'));
$mUser = $this->request()->get('req2');
$sSection = $this->request()->get('req3');
$bIsPublicItemView = false;
if (Phpfox::isPublicView()) {
if (!empty($sSection) && Phpfox::isModule($sSection) && $sSection != 'designer' && Phpfox::hasCallback($sSection, 'getItemView') && Phpfox::callback($sSection . '.getItemView') === true) {
$bIsPublicItemView = true;
}
}
if (!$mUser) {
if (Phpfox::isUser()) {
$this->url()->send('profile');
} else {
Phpfox::isUser(true);
}
}
$aExtraProfile = Phpfox::getService('profiles')->getProfile($mUser);
if (count($aExtraProfile) == 0) {
return Phpfox::getLib('module')->setController('error.404');
}
$aUser = Phpfox::getService('user')->get($aExtraProfile['user_id']);
$this->setParam('aExtraProfile', $aExtraProfile);
$this->template()->assign(array('aExtraProfile' => $aExtraProfile));
if (Phpfox::getService('user.block')->isBlocked($aExtraProfile['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy')) {
$this->url()->send($aUser['user_name']);
}
if (!Phpfox::getService('user.privacy')->hasAccess($aExtraProfile['user_id'], 'profile.view_profile')) {
$this->url()->send($aUser['user_name']);
}
if (!empty($sSection) && $sSection == 'photo') {
$this->setParam('aParentModule', array('module_id' => 'profiles', 'item_id' => $aExtraProfile['extra_id'], 'url' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url'])));
$this->template()->setTitle($aExtraProfile['title'])->setBreadcrumb($aExtraProfile['title'], $this->url()->makeUrl('profiles', $aExtraProfile['title_url']));
$this->url()->aRewrite['photo/add/'] = 'profiles/redirect/photo/add/' . $aExtraProfile['extra_id'];
$this->url()->aReverseRewrite['profiles/redirect/photo/add/' . $aExtraProfile['extra_id']] = 'photo/add/';
}
Phpfox::getUserParam('profile.can_view_users_profile', true);
$this->template()->setHeader('cache', array('profile.css' => 'style_css', 'feed.js' => 'module_feed'));
$this->template()->setMeta('description', Phpfox::getPhrase('profiles.meta_description', array('extra_name' => $aExtraProfile['title'], 'site_title' => Phpfox::getParam('core.site_title'), 'meta_description_profile' => Phpfox::getParam('core.meta_description_profile'))));
$sPageTitle = $aExtraProfile['title'];
$this->setParam('aFeed', array('comment_type_id' => 'profiles', 'privacy' => 0, 'comment_privacy' => 0, 'item_id' => $aExtraProfile['extra_id'], 'like_type_id' => 'profiles', 'feed_is_liked' => isset($aExtraProfile['is_liked']) ? $aExtraProfile['is_liked'] : false, 'user_id' => $aExtraProfile['user_id'], 'total_comment' => $aExtraProfile['total_comment'], 'total_like' => 0, 'feed_link' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url']), 'feed_title' => $aExtraProfile['title'], 'feed_display' => 'view', 'report_module' => 'profiles', 'report_phrase' => Phpfox::getPhrase('profiles.report_this_profile')));
$this->template()->setTitle($sPageTitle)->setEditor(array('load' => 'simple', 'wysiwyg' => Phpfox::isModule('comment') && Phpfox::getParam('comment.wysiwyg_comments') && Phpfox::getUserParam('comment.wysiwyg_on_comments')))->setUrl('profiles')->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'));
if ($this->request()->get('update')) {
$this->template()->setHeader('<script type="text/javascript">window.parent.tb_remove();</script>');
}
Phpfox::getComponent('photo.index', array('bNoTemplate' => true), 'controller');
$this->setParam('global_moderation', array('name' => 'photo', 'ajax' => 'profiles.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('photo.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('photo.approve'), 'action' => 'approve'))));
}