本文整理匯總了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);
}