本文整理汇总了PHP中Hubzero\User\Profile::userHasPermissionForGroupAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::userHasPermissionForGroupAction方法的具体用法?PHP Profile::userHasPermissionForGroupAction怎么用?PHP Profile::userHasPermissionForGroupAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hubzero\User\Profile
的用法示例。
在下文中一共展示了Profile::userHasPermissionForGroupAction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<li>
<a class="group-edit" href="<?php
echo Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&task=edit');
?>
">
<?php
echo Lang::txt('COM_GROUPS_TOOLBAR_EDIT');
?>
</a>
</li>
<?php
}
?>
<?php
if (!$isManager && \Hubzero\User\Profile::userHasPermissionForGroupAction($this->group, 'group.pages')) {
?>
<li>
<a class="group-pages" href="<?php
echo Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&task=pages');
?>
">
<?php
echo Lang::txt('COM_GROUPS_TOOLBAR_PAGES');
?>
</a>
</li>
<?php
}
?>
示例2:
<h3 class="section-header">
<?php
echo Lang::txt('PLG_GROUPS_MEMBERS');
?>
</h3>
<?php
if ($this->membership_control == 1) {
?>
<?php
//if ($this->authorized == 'manager' || $this->authorized == 'admin') {
?>
<ul id="page_options">
<li>
<?php
if ($this->authorized == 'manager' || $this->authorized == 'admin' || \Hubzero\User\Profile::userHasPermissionForGroupAction($this->group, 'group.invite')) {
?>
<a class="icon-add add btn" href="<?php
echo Route::url('index.php?option=' . $option . '&cn=' . $this->group->get('cn') . '&task=invite');
?>
">
<?php
echo Lang::txt('PLG_GROUPS_MEMBERS_INVITE_MEMBERS');
?>
</a>
<?php
}
?>
<?php
if ($this->membership_control == 1 && $this->authorized == 'manager') {
?>
示例3: _authorizedForTask
/**
* Check if user has role with permission to perform task
*
* @param string $task Task to be performed
* @return boolean
*/
public function _authorizedForTask($task)
{
$group = Group::getInstance($this->cn);
if (!is_object($group)) {
return false;
}
// check if user has permissions
return \Hubzero\User\Profile::userHasPermissionForGroupAction($group, $task);
}
示例4: displayPage
/**
* Display Group Page
*
* @param Object $group \Hubzero\User\Group Object
* @param Object $page \Components\Groups\Models\Page Object
* @return String
*/
public static function displayPage($group, $page, $markHit = true)
{
// create view object
$view = new \Hubzero\Component\View(array('name' => 'pages', 'layout' => '_view'));
// if super group add super group folder
// to available paths
if ($group->isSuperGroup()) {
$base = $group->getBasePath();
$view->addTemplatePath(PATH_APP . $base . DS . 'template' . DS . 'pages');
}
// get needed vars
$database = \App::get('db');
$authorized = \Components\Groups\Helpers\View::authorize($group);
$version = $page ? $page->approvedVersion() : null;
// stops from displaying pages that dont exist
if ($page === null) {
App::abort(404, Lang::txt('Group Page Not Found'));
return;
}
// stops from displaying unpublished pages
// make sure we have approved version to display
if ($page->get('state') == $page::APP_STATE_UNPUBLISHED || $version === null) {
// determine which layout to use
$layout = $version === null ? '_view_notapproved' : '_view_unpublished';
// show unpublished or no version layout
if ($authorized == 'manager' || \Hubzero\User\Profile::userHasPermissionForGroupAction($group, 'group.pages')) {
$view->setLayout($layout);
$view->group = $group;
$view->page = $page;
$view->version = $version;
return $view->loadTemplate();
}
// show 404
App::abort(404, Lang::txt('Group Page Not Found'));
return;
}
// build page hit object
// mark page hit
if ($markHit) {
$groupsTablePageHit = new PageHit($database);
$pageHit = new stdClass();
$pageHit->gidNumber = $group->get('gidNumber');
$pageHit->pageid = $page->get('id');
$pageHit->userid = User::get('id');
$pageHit->date = date('Y-m-d H:i:s');
$pageHit->ip = $_SERVER['REMOTE_ADDR'];
$groupsTablePageHit->save($pageHit);
}
// parse old wiki content
//$content = self::parseWiki($group, $version->get('content'), $fullparse = true);
$content = $version->get('content');
// parse php tags and modules
$content = self::parse($group, $page, $content);
// set content
$version->set('content', trim($content));
// set vars to view
$view->user = User::getRoot();
$view->group = $group;
$view->page = $page;
$view->version = $version;
$view->authorized = $authorized;
$view->config = Component::params('com_groups');
// return rendered template
return $view->loadTemplate();
}
示例5:
">
<?php
echo Lang::txt('TPL_SYSTEM_GROUP_EDIT');
?>
<span><?php
echo Lang::txt('TPL_SYSTEM_GROUP_EDIT_DESC');
?>
</span>
</a>
</li>
<?php
}
?>
<?php
if ($isManager || \Hubzero\User\Profile::userHasPermissionForGroupAction($group, 'group.pages')) {
?>
<li>
<a class="pages" href="<?php
echo Route::url('index.php?option=com_groups&cn=' . $group->get('cn') . '&task=pages');
?>
">
<?php
echo Lang::txt('TPL_SYSTEM_GROUP_PAGES');
?>
<span><?php
echo Lang::txt('TPL_SYSTEM_GROUP_PAGES_DESC');
?>
</span>
</a>
</li>