本文整理汇总了PHP中Groups::getAuthGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::getAuthGroups方法的具体用法?PHP Groups::getAuthGroups怎么用?PHP Groups::getAuthGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::getAuthGroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$groups = new Groups();
$doc = new Documents();
/**
* Wenn gepostet wurde
*/
if ($_POST) {
// Gruppe wird erstellt
if (isset($_POST["group_name"])) {
$groups->saveGroup($this->saveInputs($_POST["group_name"]), $this->saveInputs($_POST["group_description"]), get_current_user_id());
}
// User wird hinzugefügt
if (isset($_POST["userToAdd"])) {
$groups->addUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToAdd"]));
}
if (isset($_POST["userToDelete"])) {
$groups->deleteUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToDelete"]));
}
}
// Bestimmte ID wird abgefragt
if (isset($_GET["id"])) {
$user = wp_get_current_user();
$detailGroup = $groups->getGroupAndUsers($this->saveInputs($_GET["id"]));
$detailGroup->userToAdd = array();
if ($user->roles[0] == "dokuAdmin" || $user->roles[0] == "administrator") {
$detailGroup->userToAdd = $groups->getUserNotInGroup($this->saveInputs($_GET["id"]));
}
$documentsInGroup = $doc->getDocumentsInGroup($this->saveInputs($_GET["id"]));
echo $this->detailView($detailGroup, $documentsInGroup);
} else {
$arGroups = $groups->getAuthGroups();
echo $this->groupView($arGroups);
}
}
示例2: __construct
/**
* Erstellt die Sidebar mit Dokumenten, Gruppen usw.
*/
public function __construct()
{
$docs = new Documents();
$this->authDocs = $docs->getDocumentsCreatedByUser(get_current_user_id());
$groups = new Groups();
$this->authGroups = $groups->getAuthGroups();
/**
* SeitenUrl holen
* @var array
*/
$pagesFilter = array('post_type' => 'page', 'meta_key' => 'custom_element_grid_class_meta_box', 'meta_value' => 'Gruppen');
$pages = get_posts($pagesFilter);
$GroupLink = get_permalink($pages[0]->ID);
$pagesFilter["meta_value"] = "Dokumente";
$pages = get_posts($pagesFilter);
$documentLink = get_permalink($pages[0]->ID);
$pagesFilter["meta_value"] = "Startseite";
$pages = get_posts($pagesFilter);
$homeLink = get_permalink($pages[0]->ID);
echo $this->view($GroupLink, $documentLink, $homeLink);
}