public function getFromattedUgroupsThatCanReadWikiPage(PHPWikiPage $wiki_page) { $project = $this->project_manager->getProject($wiki_page->getGid()); $ugroup_ids = $this->permission_manager->getAuthorizedUgroupIds($wiki_page->getId(), self::WIKI_PERMISSION_READ); $ugroup_ids = $this->filterWikiPagePermissionsAccordingToService($project, $ugroup_ids); $ugroup_ids = $this->filterWikiPagePermissionsAccordingToProject($project, $ugroup_ids); return $this->literalizer->ugroupIdsToString($ugroup_ids, $project); }
/** * 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); } } }
/** * displayMenu - public */ function displayMenu() { print ' <table class="ServiceMenu"> <tr> <td>'; $language_id = ''; if (defined('DEFAULT_LANGUAGE')) { $language_id = DEFAULT_LANGUAGE; } switch ($language_id) { case 'fr_FR': $attatch_page = "DéposerUnFichier"; $preferences_page = "PréférencesUtilisateurs"; break; case 'en_US': default: $attatch_page = 'UpLoad'; $preferences_page = 'UserPreferences'; break; } $attatch_menu = $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'menuattch'); $preferences_menu = $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'menuprefs'); $help_menu = $GLOBALS['Language']->getText('global', 'help'); print ' <ul class="ServiceMenu"> <li><a href="' . $this->wikiLink . '&view=browsePages">' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'menupages') . '</a> | </li>'; if (UserManager::instance()->getCurrentUser()->isLoggedIn()) { print '<li><a href="javascript:help_window(\'' . $this->wikiLink . '&pagename=' . $attatch_page . '&pv=2\')">' . $attatch_menu . '</a> | </li>'; print '<li><a href="' . $this->wikiLink . '&pagename=' . $preferences_page . '">' . $preferences_menu . '</a> | </li>'; } if (user_ismember($this->gid, 'W2')) { print '<li><a href="' . $this->wikiAdminLink . '">' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'menuadmin') . '</a> | </li>'; } print '<li>' . help_button('wiki.html', false, $help_menu) . '</li> </ul>'; print ' </td> <td align="right" valign="top">'; if (user_ismember($this->gid, 'W2')) { $wiki = new PHPWiki($this->gid); $permInfo = ""; if ('wiki' == $this->view) { // User is browsing a wiki page $wp = new PHPWikiPage($this->gid, $_REQUEST['pagename']); $permLink = $this->wikiAdminLink . '&view=pagePerms&id=' . $wp->getId(); if ($wp->permissionExist()) { $permInfo = '<a href="' . $permLink . '"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'lock_title_spec') . '"/></a>'; } } if ($wiki->permissionExist()) { $permInfo .= '<a href="' . PHPWIKI_PLUGIN_BASE_URL . '/admin/index.php?group_id=' . $this->gid . '&view=wikiPerms"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'lock_title_set') . '"/>' . '</a>'; } if ($permInfo) { print $permInfo; } } //Display printer_version link only in wiki pages if (isset($_REQUEST['pagename'])) { print ' (<a href="' . $this->base_url . '&pv=1" title="' . $GLOBALS['Language']->getText('plugin_phpwiki_views_wikiserviceviews', 'lighter_display') . '"> <img src="' . util_get_image_theme("msg.png") . '" border="0"> ' . $GLOBALS['Language']->getText('global', 'printer_version') . '</A> ) </li>'; } print ' </td> </tr> </table>'; }
/** * browsePages - private */ function _browsePages(&$pageList) { print html_build_list_table_top(array('Page', 'Permissions')); $purifier = Codendi_HTMLPurifier::instance(); sort($pageList); $i = 0; foreach ($pageList as $pagename) { print ' <tr class="' . html_get_alt_row_color($i) . '"> '; print '<td><a href="' . $this->wikiLink . '&pagename=' . urlencode($pagename) . '">' . $purifier->purify($pagename) . '</a></td>'; $page = new PHPWikiPage($this->gid, $pagename); $status = $GLOBALS['Language']->getText('plugin_phpwiki_views_wkserviews', 'define_perms'); if (permission_exist('PHPWIKIPAGE_READ', $page->getId())) { $status = $GLOBALS['Language']->getText('plugin_phpwiki_views_wkserviews', 'edit_perms'); } $eM =& EventManager::instance(); $referenced = false; $eM->processEvent('isWikiPageReferenced', array('referenced' => &$referenced, 'wiki_page' => $pagename, 'group_id' => $this->gid)); print '<td align="center">'; if ($referenced) { $label = ''; $eM->processEvent('getPermsLabelForWiki', array('label' => &$label)); print $purifier->purify($label); } else { print '<a href="' . $this->wikiAdminLink . '&view=pagePerms&id=' . urlencode($page->getId()) . '">[' . $purifier->purify($status) . ']</a>'; } print '</td>'; print ' </tr> '; $i++; } print '</TABLE>'; }
public function getFormattedContent(PHPWikiPage $page) { $formatter = new PHPWikiPageVersionContentFormatter($page->getId()); return $formatter->getFormattedContent($page, $this); }