function add_temp_page() { /* ADD TEST TO NOT ADD A ALREADY existing PAge */ $wpw = new PHPWikiPageWrapper($this->gid); try { $wpw->addNewProjectPage($_POST['name']); } catch (Exception $exception) { $GLOBALS['Response']->addFeedback('error', $exception->getMessage()); } }
public function getFormattedContent(PHPWikiPage $wiki_page, PHPWikiPageVersion $version) { $request = $this->wrapper->getRequest(); $request->initializeTheme(); require_once PHPWIKI_SRC_PATH . '/lib/Template.php'; $template = new Template(self::PHPWIKI_TEMPLATE, $request, $this->getTransformedContent($wiki_page, $version, $request)); ob_start(); $template->printExpansion(); return ob_get_clean(); }
private function getIndexablePageFromAllUserPages(array &$indexable_pages) { $all_internal_pages = array_merge($this->getAllUserPages(), $this->wrapper->getProjectEmptyLinks()); foreach ($all_internal_pages as $internal_page_name) { $wiki_page = new PHPWikiPage($this->gid, $internal_page_name); if (!$wiki_page->isReferenced()) { $indexable_pages[] = $wiki_page; } } }
private function getIndexablePageFromDefaultAndAdminPages(array &$indexable_pages) { $default_pages_used = array_merge($this->getAllInternalPages(), $this->getAdminPages()); foreach ($default_pages_used as $default_page_name) { $wiki_page = new PHPWikiPage($this->gid, $default_page_name); $version = $this->wrapper->getRequest()->getPage($default_page_name)->getCurrentRevision()->getVersion(); if ($version > 1) { $indexable_pages[] = $wiki_page; } } }
function checkPage($page) { global $feedback; /** * Check if the given page name is not empty */ if (empty($page)) { $feedback = $GLOBALS['Language']->getText('plugin_phpwiki_actions_wikiserviceadmin', 'page_name_empty_err'); return false; } /** * Check if the page is a valid page. */ $wp = new PHPWikiPage($this->gid, $page); if (!$wp->exist()) { $wpw = new PHPWikiPageWrapper($this->gid); try { $wpw->addNewProjectPage($page); } catch (Exception $exception) { $GLOBALS['Response']->addFeedback('error', $exception->getMessage()); } } return true; }
/** * install */ function doinstall() { global $LANG; global $language_id; $language_id = $_REQUEST['language_id']; if (!$language_id || !$GLOBALS['Language']->isLanguageSupported($language_id)) { $language_id = $GLOBALS['Language']->defaultLanguage; } // Initial Wiki document is now created within phpWiki main() // Make sure phpWiki instantiates the right pages corresponding the the given language define('DEFAULT_LANGUAGE', $language_id); $LANG = $language_id; $wpw = new PHPWikiPageWrapper($this->gid); $wpw->install(); }
function upgrade() { $wpw = new PHPWikiPageWrapper($this->gid); $nbGroupPending = null; $nextId = $wpw->getNextGroupWithWiki($this->gid, $nbGroupPending); $html .= 'Nb project to go: ' . $nbGroupPending . '<br>'; $url = PHPWIKI_PLUGIN_BASE_URL . '/admin/index.php?group_id=' . $nextId . '&view=upgrade'; $href = '<a href="' . $url . '">' . $nextId . '</a>'; $html .= 'Next project: ' . $href . '<br>'; print $html; $wpw->upgrade(); }