Lines Matching defs:page

196      * This call allows to check the permissions for a given page/media and user/group combination.
202 * @param string $page A page or media ID
208 public function aclCheck($page, $user = '', $groups = [])
213 $page = $this->checkPage($page, 0, false, AUTH_NONE);
216 return auth_quickaclcheck($page);
226 return auth_aclcheck($page, $user, $groups);
243 * @param bool $hash Whether to include a MD5 hash of the page content
285 * This is uses the page index and is quicker than iterating which is done in listPages()
302 $page = new Page($pages[$idx], 0, 0, '', null, $perm);
303 if ($hash) $page->calculateHash();
305 $list[] = $page;
318 * or the page id depending on the wiki's configuration.
351 * Get recent page changes
386 * Get a wiki page's syntax
388 * Returns the syntax of the given page. When no revision is given, the current revision is returned.
390 * A non-existing page (or revision) will return an empty string usually. For the current revision
391 * a page template will be returned if configured.
393 * Read access is required for the page.
395 * @param string $page wiki page id
397 * @return string the syntax of the page
401 public function getPage($page, $rev = 0)
403 $page = $this->checkPage($page, $rev, false);
405 $text = rawWiki($page, $rev);
407 return pageTemplate($page);
414 * Return a wiki page rendered to HTML
416 * The page is rendered to HTML as it would be in the wiki. The HTML consist only of the data for the page
421 * If the page does not exist, an error is returned.
424 * @param string $page page id
426 * @return string Rendered HTML for the page
430 public function getPageHTML($page, $rev = 0)
432 $page = $this->checkPage($page, $rev);
434 return (string)p_wiki_xhtml($page, $rev, false);
438 * Return some basic data about a page
440 * The call will return an error if the requested page does not exist.
442 * Read access is required for the page.
444 * @param string $page page id
447 * @param bool $hash whether to include the MD5 hash of the page content
452 public function getPageInfo($page, $rev = 0, $author = false, $hash = false)
454 $page = $this->checkPage($page, $rev);
456 $result = new Page($page, $rev);
464 * Returns a list of available revisions of a given wiki page
470 * @param string $page page id
477 public function getPageHistory($page, $first = 0)
481 $page = $this->checkPage($page, 0, false);
483 $pagelog = new PageChangeLog($page);
490 if (!page_exists($page, $rev)) continue; // skip non-existing revisions
494 $page,
508 * Get a page's links
510 * This returns a list of links found in the given page. This includes internal, external and interwiki links
512 * If a link occurs multiple times on the page, it will be returned multiple times.
514 * Read access for the given page is needed and page has to exist.
516 * @param string $page page id
517 * @return Link[] A list of links found on the given page
525 public function getPageLinks($page)
527 $page = $this->checkPage($page);
529 // resolve page instructions
530 $ins = p_cached_instructions(wikiFN($page));
557 * Get a page's backlinks
559 * A backlink is a wiki link on another page that links to the given page.
561 * Only links from pages readable by the current user are returned. The page itself
564 * @param string $page page id
565 * @return string[] A list of pages linking to the given page
569 public function getPageBackLinks($page)
571 $page = $this->checkPage($page, 0, false);
573 return ft_backlinks($page);
580 * successfully locked. If a page could not be locked, eg. because a different user is
581 * currently holding a lock, that page will be missing from the returned list.
587 * a lock for a page that does not exist, yet.
589 * Note: it is not necessary to lock a page before saving it. The `savePage()` call will
590 * automatically lock and unlock the page for you. However if you plan to do related
616 * successfully unlocked. If a page could not be unlocked, eg. because a different user is
617 * currently holding a lock, that page will be missing from the returned list.
644 * Save a wiki page
646 * Saves the given wiki text to the given page. If the page does not exist, it will be created.
647 * Just like in the wiki, saving an empty text will delete the page.
649 * You need write permissions for the given page and the page may not be locked by another user.
651 * @param string $page page id
656 * @throws AccessDeniedException no write access for page
657 * @throws RemoteException no id, empty new page or locked
660 public function savePage($page, $text, $summary = '', $isminor = false)
665 $page = $this->checkPage($page, 0, false, AUTH_EDIT);
669 if (!page_exists($page) && trim($TEXT) == '') {
670 throw new RemoteException('Refusing to write an empty new wiki page', 132);
673 // Check, if page is locked
674 if (checklock($page)) {
675 throw new RemoteException('The page is currently locked', 133);
680 throw new RemoteException('The page content was blocked', 134);
684 if (!page_exists($page) && empty($summary)) {
689 if (page_exists($page) && empty($TEXT) && empty($summary)) {
695 lock($page);
696 saveWikiText($page, $TEXT, $summary, $isminor);
697 unlock($page);
699 // run the indexer if page wasn't indexed yet
700 idx_addPage($page);
706 * Appends text to the end of a wiki page
708 * If the page does not exist, it will be created. If a page template for the non-existant
709 * page is configured, the given text will appended to that template.
711 * The call will create a new page revision.
713 * You need write permissions for the given page.
715 * @param string $page page id
723 public function appendPage($page, $text, $summary = '', $isminor = false)
725 $currentpage = $this->getPage($page);
729 return $this->savePage($page, $currentpage . $text, $summary, $isminor);
967 * Convenience method for page checks
971 * - clean the given page id
972 * - disallow an empty page id
973 * - check if the page exists (unless disabled)
976 * @param string $id page id
977 * @param int $rev page revision
980 * @return string the cleaned page id
988 throw new RemoteException('Empty or invalid page ID given', 131);
992 throw new RemoteException('The requested page (revision) does not exist', 121);
996 throw new AccessDeniedException('You are not allowed to read this page', 111);