function view() { $tags = array(); $tags['MENU'] = $this->menu(); $tags['PAGETEXT'] = $this->getPagetext(); $tags['MESSAGE'] = sprintf(dgettext('wiki', 'Revision as of %s'), $this->getUpdated()); if (PHPWS_Settings::get('wiki', 'show_modified_info')) { $editor = $this->getEditor(); if (Current_User::isLogged() && Current_User::getId() != $this->getEditorId()) { PHPWS_Core::initModClass('notes', 'My_Page.php'); PHPWS_Core::initModClass('notes', 'Note_Item.php'); $editor = str_replace(dgettext('wiki', 'Send note'), $editor, Note_Item::sendLink($this->getEditorId())); } $tags['UPDATED_INFO'] = sprintf(dgettext('wiki', 'Last modified %1$s by %2$s'), $this->getUpdated(), $editor); } if (PHPWS_Settings::get('wiki', 'add_to_title')) { Layout::addPageTitle($this->getTitle()); } return PHPWS_Template::process($tags, 'wiki', 'view.tpl'); }
function view() { $tags = array(); if ($this->getId()) { $tags['PAGETEXT'] = $this->getPagetext(); if (PHPWS_Settings::get('wiki', 'show_modified_info')) { $editor = $this->getEditor(); if (Current_User::isLogged() && Current_User::getId() != $this->getEditorId()) { PHPWS_Core::initModClass('notes', 'My_Page.php'); PHPWS_Core::initModClass('notes', 'Note_Item.php'); $editor = str_replace(dgettext('wiki', 'Send note'), $editor, Note_Item::sendLink($this->getEditorId())); } $tags['UPDATED_INFO'] = sprintf(dgettext('wiki', 'Last modified %1$s by %2$s'), $this->getUpdated(), $editor); } if (isset($_REQUEST['module']) && PHPWS_Settings::get('wiki', 'add_to_title')) { Layout::addPageTitle($this->getTitle()); } // Only set key flag if in viewing mode if (isset($_REQUEST['module']) && isset($_REQUEST['page_op']) && $_REQUEST['page_op'] == 'view') { $key = $this->getKey(); $key->flag(); } } else { if (isset($this->pagetext)) { $tags['PAGETEXT'] = $this->getPagetext(); } else { $tags['PAGETEXT'] = dgettext('wiki', 'This page does not exist yet.'); if (Current_User::allow('wiki', 'edit_page') || PHPWS_Settings::get('wiki', 'allow_page_edit') && Current_User::isLogged()) { $tags['PAGETEXT'] .= ' ' . PHPWS_Text::secureLink(dgettext('wiki', 'Create new empty page'), 'wiki', array('page_op' => 'edit', 'page' => $this->getTitle(FALSE))); } } } // For print view only if (isset($_REQUEST['page_op']) && $_REQUEST['page_op'] == 'print') { $tags['PAGENAME'] = $this->getTitle(); } // Display the menu and message if in view mode if (isset($_REQUEST['page_op']) && $_REQUEST['page_op'] == 'view') { $tags['MENU'] = $this->menu(); $tags['MESSAGE'] = WikiManager::getMessage(); } return PHPWS_Template::process($tags, 'wiki', 'view.tpl'); }