private function getTransformedContent(PHPWikiPage $wiki_page, PHPWikiPageVersion $version, WikiRequest $request)
 {
     $dbi = $request->_dbi;
     $page_db = $dbi->getPage($wiki_page->getPagename());
     $revision = $page_db->getRevision($version->getVersionId());
     return $revision->getTransformedContent();
 }
 /**
  * pagePerms - public View
  */
 function _pagePerms($postUrl = '')
 {
     $wp = new PHPWikiPage($_REQUEST['id']);
     $pagename = $wp->getPagename();
     $eM =& EventManager::instance();
     $referenced = false;
     $eM->processEvent('isWikiPageReferenced', array('referenced' => &$referenced, 'wiki_page' => $pagename, 'group_id' => $this->gid));
     if ($referenced) {
         $label = '';
         $eM->processEvent('getPermsLabelForWiki', array('label' => &$label));
         print '<p align="center"><br><b>' . $label . '</b></p>';
     } else {
         print $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'set_perm_title');
         if (empty($pagename)) {
             print $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'empty_page');
         } else {
             $purifier = Codendi_HTMLPurifier::instance();
             print $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'not_empty_page', array($purifier->purify($pagename)));
             permission_display_selection_form("PHPWIKIPAGE_READ", $wp->getId(), $this->gid, $postUrl);
         }
     }
 }
 /**
  * _buildPageLink - private
  *
  * @param  PHPWikiPage $wikiPage
  * @param  string   $title
  * @return string   $href
  */
 function _buildPageLink(&$wikiPage, $title = null)
 {
     $href = '';
     // Check permission
     if ($wikiPage->isAutorized(user_getid())) {
         $pagename = $wikiPage->getPagename();
         // Build page link
         if (empty($title)) {
             $title = $pagename;
         }
         $title = $this->purifier->purify($title, CODENDI_PURIFIER_CONVERT_HTML);
         $link = PHPWIKI_PLUGIN_BASE_URL . '/index.php?group_id=' . $this->gid . '&pagename=' . urlencode($pagename);
         // Display title as emphasis if corresponding page does't exist.
         if ($wikiPage->isEmpty()) {
             $title = '<em>' . $title . '</em>';
             $link .= '&action=edit';
         }
         // Build Lock image if a permission is set on the corresponding page
         if ($wikiPage->permissionExist()) {
             $permLink = $this->wikiLink . '&view=pagePerms&id=' . $wikiPage->getId();
             $title = $title . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="Lock" />';
         }
         $href = '<a href="' . $link . '">' . $title . '</a>';
     }
     return $href;
 }
 /**
  *
  */
 function setWikiPagePerms()
 {
     global $feedback;
     $wp = new PHPWikiPage($_POST['object_id']);
     if ($_POST['reset']) {
         $ret = $wp->resetPermissions();
     } else {
         $ret = $wp->setPermissions($_POST['ugroups']);
     }
     if (!$ret) {
         exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('plugin_phpwiki_actions_wikiserviceadmin', 'update_page_perm_err', array($feedback)));
     }
     $event_manager = EventManager::instance();
     $event_manager->processEvent("wiki_page_permissions_updated", array('group_id' => $wp->getGid(), 'wiki_page' => $wp->getPagename()));
 }