summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2018-08-16 15:39:40 -0400
committerspiderr <spiderr@bitweaver.org>2018-08-16 15:39:40 -0400
commitb39fd928db6077127cad37fa2d2ee51d39ef201e (patch)
treedd0305a2aa1025107e57723c89f9e2e4ac0a7c57
parentb3af24a1eb345fe2ae9aed0788dd405c6ed0ff91 (diff)
downloadwiki-b39fd928db6077127cad37fa2d2ee51d39ef201e.tar.gz
wiki-b39fd928db6077127cad37fa2d2ee51d39ef201e.tar.bz2
wiki-b39fd928db6077127cad37fa2d2ee51d39ef201e.zip
add support for displaying alias as the page title
-rw-r--r--BitPage.php22
-rw-r--r--display_bitpage_inc.php7
2 files changed, 27 insertions, 2 deletions
diff --git a/BitPage.php b/BitPage.php
index c705aba..043feee 100644
--- a/BitPage.php
+++ b/BitPage.php
@@ -506,6 +506,28 @@ class BitPage extends LibertyMime implements BitCacheable {
/**
+ * Create the generic title for a content item
+ *
+ * This will normally be overwriten by extended classes to provide
+ * an appropriate title string
+ * @return string Descriptive title for the page
+ */
+ function getTitle() {
+ $ret = $this->getField('title');
+ if( $this->isValid() ) {
+ $ret = static::getTitleFromHash( $this->mInfo );
+ $requestPage = strtoupper( self::getParameter( $_REQUEST, 'page' ) );
+ if( $requestPage && $requestPage != strtoupper( $this->mInfo['title'] ) ) {
+ $aliases = $this->getAliases( TRUE );
+ if( in_array( $requestPage, $aliases ) ) {
+ $ret = $_REQUEST['page'];
+ }
+ }
+ }
+ return $ret;
+ }
+
+ /**
* Generates the URL to this wiki page
* @param pExistsHash the hash that was returned by LibertyContent::pageExists
* @return the link to display the page.
diff --git a/display_bitpage_inc.php b/display_bitpage_inc.php
index 18bb07b..4154b41 100644
--- a/display_bitpage_inc.php
+++ b/display_bitpage_inc.php
@@ -154,13 +154,16 @@ if( $gContent->isValid() && $gBitSystem->isPackageActive( 'stickies' ) ) {
$gBitSmarty->assignByRef( 'stickyInfo', $gNote->mInfo );
}
+$pageInfo = $gContent->mInfo;
+$pageInfo['title'] = $gContent->getTitle();
+
// Display the Index Template
-$gBitSmarty->assignByRef( 'pageInfo', $gContent->mInfo );
+$gBitSmarty->assignByRef( 'pageInfo', $pageInfo );
// S5 slideshows
if( isset( $_REQUEST['s5'] )) {
include_once( WIKI_PKG_PATH.'s5.php');
}
-$gBitSystem->display( 'bitpackage:wiki/show_page.tpl', $gContent->mInfo['title'], array( 'display_mode' => 'display' ));
+$gBitSystem->display( 'bitpackage:wiki/show_page.tpl', $pageInfo['title'], array( 'display_mode' => 'display' ));
?>