本文整理汇总了PHP中PMF_Category::setUser方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::setUser方法的具体用法?PHP PMF_Category::setUser怎么用?PHP PMF_Category::setUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Category
的用法示例。
在下文中一共展示了PMF_Category::setUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
} else {
$current_groups = array(-1);
}
if (0 == count($current_groups)) {
$current_groups = array(-1);
}
} else {
$current_user = -1;
$current_groups = array(-1);
}
if (!$faqConfig->get('main.enableRssFeeds')) {
exit;
}
$category_id = PMF_Filter::filterInput(INPUT_GET, 'category_id', FILTER_VALIDATE_INT);
$category = new PMF_Category($faqConfig);
$category->setUser($current_user);
$category->setGroups($current_groups);
$faq = new PMF_Faq($faqConfig);
$faq->setUser($current_user);
$faq->setGroups($current_groups);
$records = $faq->getAllRecordPerCategory($category_id, $faqConfig->get('records.orderby'), $faqConfig->get('records.sortby'));
$rss = new XMLWriter();
$rss->openMemory();
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqConfig->get('main.titleFAQ') . ' - ');
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
示例2: array
$keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRING);
$author = PMF_Filter::filterInput(INPUT_POST, 'author', FILTER_SANITIZE_STRING);
$email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$comment = PMF_Filter::filterInput(INPUT_POST, 'comment', FILTER_SANITIZE_STRING);
$record_id = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_POST, 'solution_id', FILTER_VALIDATE_INT);
$revision_id = PMF_Filter::filterInput(INPUT_POST, 'revision_id', FILTER_VALIDATE_INT);
$changed = PMF_Filter::filterInput(INPUT_POST, 'changed', FILTER_SANITIZE_STRING);
$user_permission = PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING);
$restricted_users = 'all' == $user_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT);
$group_permission = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
$restricted_groups = 'all' == $group_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
if (!is_null($question) && !is_null($categories)) {
$tagging = new PMF_Tags($faqConfig);
$category = new PMF_Category($faqConfig, [], false);
$category->setUser($currentAdminUser);
$category->setGroups($currentAdminGroups);
if (!isset($categories['rubrik'])) {
$categories['rubrik'] = [];
}
$recordData = array('id' => $record_id, 'lang' => $record_lang, 'revision_id' => $revision_id, 'active' => $active, 'sticky' => !is_null($sticky) ? 1 : 0, 'thema' => html_entity_decode($question), 'content' => html_entity_decode($content), 'keywords' => $keywords, 'author' => $author, 'email' => $email, 'comment' => !is_null($comment) ? 'y' : 'n', 'date' => empty($date) ? date('YmdHis') : str_replace(array('-', ':', ' '), '', $date), 'dateStart' => empty($dateStart) ? '00000000000000' : str_replace('-', '', $dateStart) . '000000', 'dateEnd' => empty($dateEnd) ? '99991231235959' : str_replace('-', '', $dateEnd) . '235959', 'linkState' => '', 'linkDateCheck' => 0);
if ('saveentry' == $do || $record_id) {
/* Create a revision anyway, it's autosaving */
$faq->addNewRevision($record_id, $record_lang);
$revision_id++;
$faq->createChangeEntry($record_id, $user->getUserId(), nl2br($changed), $record_lang, $revision_id);
$visits = new PMF_Visits($faqConfig);
$visits->add($record_id);
if ($faq->isAlreadyTranslated($record_id, $record_lang)) {
$faq->updateRecord($recordData);
} else {
示例3: sprintf
if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) {
$csrfOkay = false;
}
$userAction = $defaultUserAction;
if ($userId == 0 && !$csrfOkay) {
$message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']);
} else {
if (!$user->getUserById($userId)) {
$message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']);
}
if (!$user->deleteUser()) {
$message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_delete']);
} else {
// Move the categories ownership to admin (id == 1)
$oCat = new PMF_Category($faqConfig, [], false);
$oCat->setUser($currentAdminUser);
$oCat->setGroups($currentAdminGroups);
$oCat->moveOwnership($userId, 1);
// Remove the user from groups
if ('medium' == $faqConfig->get('security.permLevel')) {
$oPerm = PMF_Perm::selectPerm('medium', $faqConfig);
$oPerm->removeFromAllGroups($userId);
}
$message .= sprintf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_user_deleted']);
}
$userError = $user->error();
if ($userError != "") {
$message .= sprintf('<p class="alert alert-danger">%s</p>', $userError);
}
}
}