diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:46:51 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:46:51 +0000 |
| commit | 84c9b11f4260b9add6dae43d098db6ba364ddf36 (patch) | |
| tree | 4c1cca09213a184c4724ddf85e66a7ebc9dc8d31 | |
| parent | aa1fc688af3a1b78a73369d378b0c5b3cdbd9bee (diff) | |
| download | wiki-84c9b11f4260b9add6dae43d098db6ba364ddf36.tar.gz wiki-84c9b11f4260b9add6dae43d098db6ba364ddf36.tar.bz2 wiki-84c9b11f4260b9add6dae43d098db6ba364ddf36.zip | |
merge recent changes from R1 to HEAD
42 files changed, 386 insertions, 348 deletions
diff --git a/BitPage.php b/BitPage.php index d30c0ac..c1e1c42 100644 --- a/BitPage.php +++ b/BitPage.php @@ -1,11 +1,11 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.6 2005/08/01 18:42:04 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.7 2005/08/07 17:46:49 squareing Exp $ * @package wiki * * @author spider <spider@steelsun.com> * - * @version $Revision: 1.6 $ $Date: 2005/08/01 18:42:04 $ $Author: squareing $ + * @version $Revision: 1.7 $ $Date: 2005/08/07 17:46:49 $ $Author: squareing $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -13,7 +13,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitPage.php,v 1.6 2005/08/01 18:42:04 squareing Exp $ + * $Id: BitPage.php,v 1.7 2005/08/07 17:46:49 squareing Exp $ */ /** @@ -26,7 +26,6 @@ require_once( LIBERTY_PKG_PATH.'LibertyAttachable.php' ); * builds on core bitweaver functionality, such as the Liberty CMS engine * * @package wiki - * @subpackage BitPage * * created 2004/8/15 */ @@ -56,7 +55,7 @@ class BitPage extends LibertyAttachable { $userWhere = " AND tc.`user_id`=?"; array_push( $bindVars, $pUserId ); } - $ret = $this->getOne("select `page_id` from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) where tc.`title`=? AND tc.`content_type_guid`=? $userWhere", $bindVars ); + $ret = $this->mDb->getOne("select `page_id` from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) where tc.`title`=? AND tc.`content_type_guid`=? $userWhere", $bindVars ); return $ret; } @@ -73,7 +72,7 @@ class BitPage extends LibertyAttachable { "LEFT JOIN `".BIT_DB_PREFIX."users_users` uue ON (uue.`user_id` = tc.`modifier_user_id`) " . "LEFT JOIN `".BIT_DB_PREFIX."users_users` uuc ON (uuc.`user_id` = tc.`user_id`) " . "WHERE tp.`$lookupColumn`=?"; - $result = $this->query( $query, array( $lookupId ) ); + $result = $this->mDb->query( $query, array( $lookupId ) ); if ( $result && $result->numRows() ) { $this->mInfo = $result->fields; @@ -106,8 +105,8 @@ class BitPage extends LibertyAttachable { * @access public **/ function store( &$pParamHash ) { + $this->mDb->StartTrans(); if( $this->verify( $pParamHash ) && LibertyAttachable::store( $pParamHash ) ) { - $this->mDb->StartTrans(); if(isset($pParamHash['wiki_cache']) ) { $this->setPageCache( $pParamHash['wiki_cache'] ); } @@ -117,19 +116,17 @@ class BitPage extends LibertyAttachable { $table = BIT_DB_PREFIX."tiki_pages"; if( $this->mPageId ) { $this->invalidateCache(); -//print "if( empty( ".$pParamHash['minor']." ) && !empty( ".$this->mInfo['version']." ) && ".$pParamHash['field_changed']; -//die; if( !empty( $pParamHash['force_history'] ) || ( empty( $pParamHash['minor'] ) && !empty( $this->mInfo['version'] ) && $pParamHash['field_changed'] )) { if( $this->mPageName != 'SandBox' && empty( $pParamHash['has_no_history'] ) ) { $query = "insert into `".BIT_DB_PREFIX."tiki_history`( `page_id`, `version`, `last_modified`, `user_id`, `ip`, `comment`, `data`, `description`, `format_guid`) values(?,?,?,?,?,?,?,?,?)"; - $result = $this->query( $query, array( $this->mPageId, (int)$this->mInfo['version'], (int)$this->mInfo['last_modified'] , $this->mInfo['modifier_user_id'], $this->mInfo['ip'], $this->mInfo['comment'], $this->mInfo['data'], $this->mInfo['description'], $this->mInfo['format_guid'] ) ); + $result = $this->mDb->query( $query, array( $this->mPageId, (int)$this->mInfo['version'], (int)$this->mInfo['last_modified'] , $this->mInfo['modifier_user_id'], $this->mInfo['ip'], $this->mInfo['comment'], $this->mInfo['data'], $this->mInfo['description'], $this->mInfo['format_guid'] ) ); } $action = "Created"; $mailEvents = 'wiki_page_changes'; } $locId = array ( "name" => "page_id", "value" => $this->mPageId ); - $result = $this->associateUpdate( $table, $pParamHash['page_store'], $locId ); + $result = $this->mDb->associateUpdate( $table, $pParamHash['page_store'], $locId ); } else { $pParamHash['page_store']['content_id'] = $pParamHash['content_id']; @@ -137,66 +134,37 @@ class BitPage extends LibertyAttachable { // if pParamHash['page_id'] is set, some is requesting a particular page_id. Use with caution! $pParamHash['page_store']['page_id'] = $pParamHash['page_id']; } else { - $pParamHash['page_store']['page_id'] = $this->GenID( 'tiki_pages_page_id_seq'); + $pParamHash['page_store']['page_id'] = $this->mDb->GenID( 'tiki_pages_page_id_seq'); } $this->mPageId = $pParamHash['page_store']['page_id']; - $result = $this->associateInsert( $table, $pParamHash['page_store'] ); + $result = $this->mDb->associateInsert( $table, $pParamHash['page_store'] ); } - + // Access new data for notifications + $this->load(); if( isset( $mailEvents ) ) { - global $notificationlib, $gBitSystem; + global $notificationlib, $gBitUser, $gBitSystem, $gBitSmarty; include_once( KERNEL_PKG_PATH.'notification_lib.php' ); - $emails = $notificationlib->get_mail_events('wiki_page_changes', $this->mInfo['content_type_guid'] . $this->mContentId); - - foreach ($emails as $email) { - global $gBitSmarty; - $gBitSmarty->assign('mail_site', $_SERVER["SERVER_NAME"]); - - $gBitSmarty->assign('mail_page', $this->mInfo['title'] ); - $gBitSmarty->assign('mail_date', date("U")); - $gBitSmarty->assign('mail_user', $this->mInfo['modifier_user'] ); - $gBitSmarty->assign('mail_comment', $this->mInfo['comment']); - $gBitSmarty->assign('mail_last_version', 1); - $gBitSmarty->assign('mail_data', $this->mInfo['data'] ); - $foo = parse_url($_SERVER["REQUEST_URI"]); - $machine = httpPrefix(). dirname( $foo["path"] ); - $gBitSmarty->assign('mail_machine', $machine); - $gBitSmarty->assign('mail_pagedata', $this->mInfo['data'] ); - $mail_data = $gBitSmarty->fetch('bitpackage:wiki/wiki_change_notification.tpl'); + $notificationlib->post_content_event($this->mContentId, $this->mInfo['content_type_guid'], 'wiki', $this->mInfo['title'], $this->mInfo['modifier_user'], $this->mInfo['comment'], $this->mInfo['data']); - if( $this->getPreference('wiki_forum') ) { - include_once( LIBERTY_PKG_PATH.'LibertyComment.php' ); - $comment = new LibertyComment( NULL, $this->mContentId ); - $forums = $comment->list_forums( 0, 1, 'name_asc', $this->getPreference('wiki_forum') ); - if ($forums) { - $forumEmail = $forums["data"][0]["outbound_from"]; - @mail($email, $name, $mail_data, "From: $forumEmail\r\nContent-type: text/plain;charset=utf-8\r\n" ); - } - } else { - @mail($email, tra('Wiki page'). ' ' . $name . ' ' . tra('changed'), $mail_data, "From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n" ); - } - } -/* -this watch code is only half fixed - spiderr if( $gBitSystem->isFeatureActive( 'feature_user_watches') ) { - $nots = $this->get_event_watches( 'wiki_page_changed', $this->mPageId ); + $nots = $gBitUser->get_event_watches( 'wiki_page_changed', $this->mPageId ); foreach ($nots as $not) { - if ($wiki_watch_editor != 'y' && $not['user_id'] == $user) - break; +# if ($wiki_watch_editor != 'y' && $not['user_id'] == $user) +# break; $gBitSmarty->assign('mail_site', $_SERVER["SERVER_NAME"]); - $gBitSmarty->assign('mail_page', $pageName); + $gBitSmarty->assign('mail_page', $this->mInfo['title']); $gBitSmarty->assign('mail_date', date("U")); - $gBitSmarty->assign('mail_user', $edit_user); - $gBitSmarty->assign('mail_comment', $edit_comment); - $gBitSmarty->assign('mail_last_version', $version); - $gBitSmarty->assign('mail_data', $edit_data); + $gBitSmarty->assign('mail_user', $this->mInfo['modifier_user']); + $gBitSmarty->assign('mail_comment', $this->mInfo['comment']); + $gBitSmarty->assign('mail_last_version', $this->mInfo['version'] - 1); + $gBitSmarty->assign('mail_data', $this->mInfo['data']); $gBitSmarty->assign('mail_hash', $not['hash']); $foo = parse_url($_SERVER["REQUEST_URI"]); - $machine = httpPrefix(). dirname( $foo["path"] ); + $machine = httpPrefix(); $gBitSmarty->assign('mail_machine', $machine); $parts = explode('/', $foo['path']); @@ -204,16 +172,16 @@ this watch code is only half fixed - spiderr unset ($parts[count($parts) - 1]); $gBitSmarty->assign('mail_machine_raw', httpPrefix(). implode('/', $parts)); - $gBitSmarty->assign('mail_pagedata', $edit_data); + $gBitSmarty->assign('mail_pagedata', $this->mInfo['data']); $mail_data = $gBitSmarty->fetch('bitpackage:wiki/user_watch_wiki_page_changed.tpl'); - @mail($not['email'], tra('Wiki page'). ' ' . $pageName . ' ' . tra('changed'), $mail_data, "From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n"); + $email_to = $not['email']; + $email_to = 'jht@lj.net'; + @mail($email_to, tra('Wiki page'). ' ' . $this->mInfo['title'] . ' ' . tra('changed'), $mail_data, "From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n"); } } -*/ } - $this->mDb->CompleteTrans(); - $this->load(); } + $this->mDb->CompleteTrans(); return( count( $this->mErrors ) == 0 ); } // }}} @@ -310,13 +278,17 @@ this watch code is only half fixed - spiderr return( count( $this->mErrors ) == 0 ); } + + /** + * Remove page from database + */ function expunge() { $ret = FALSE; if( $this->isValid() ) { $this->mDb->StartTrans(); $this->expungeVersion(); // will nuke all versions $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_pages` WHERE `content_id` = ?"; - $result = $this->query( $query, array( $this->mContentId ) ); + $result = $this->mDb->query( $query, array( $this->mContentId ) ); if( LibertyAttachable::expunge() ) { $ret = TRUE; $this->mDb->CompleteTrans(); @@ -361,7 +333,7 @@ this watch code is only half fixed - spiderr } array_push( $bindVars, $pLock, $this->mPageId ); $query = "update `".BIT_DB_PREFIX."tiki_pages` SET $userSql `flag`=? where `page_id`=?"; - $result = $this->query($query, $bindVars ); + $result = $this->mDb->query($query, $bindVars ); $this->mInfo['flag'] = $pLock; } return true; @@ -375,13 +347,15 @@ this watch code is only half fixed - spiderr return( $this->setLock( NULL, $pModUserId ) ); } - // Removes last version of the page (from pages) if theres some - // version in the tiki_history then the last version becomes the actual version + /** + * Removes last version of the page (from pages) if theres some + * version in the tiki_history then the last version becomes the actual version + */ function removeLastVersion( $comment = '' ) { if( $this->mPageId ) { $this->invalidateCache(); - $query = "select * from `".BIT_DB_PREFIX."tiki_history` where `page_id`=? order by ".$this->convert_sortmode("last_modified_desc"); - $result = $this->query($query, array( $this->mPageId ) ); + $query = "select * from `".BIT_DB_PREFIX."tiki_history` where `page_id`=? order by ".$this->mDb->convert_sortmode("last_modified_desc"); + $result = $this->mDb->query($query, array( $this->mPageId ) ); if ($result->numRows()) { // We have a version $res = $result->fetchRow(); @@ -393,37 +367,41 @@ this watch code is only half fixed - spiderr $action = "Removed last version"; $t = date("U"); $query = "insert into `".BIT_DB_PREFIX."tiki_actionlog`( `action`, `page_id`, `last_modified`, `user_id`, `ip`, `comment`) values( ?, ?, ?, ?, ?, ?)"; - $result = $this->query($query, array( $action, $this->mPageId, $t, ROOT_USER_ID, $_SERVER["REMOTE_ADDR"], $comment ) ); + $result = $this->mDb->query($query, array( $action, $this->mPageId, $t, ROOT_USER_ID, $_SERVER["REMOTE_ADDR"], $comment ) ); } } - - - // ********* Footnote functions for the wiki ********** // + /** + * Store footnote + */ function storeFootnote($pUserId, $data) { if( $this->mPageId ) { $querydel = "delete from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?"; - $this->query( $querydel, array( $pUserId, $this->mPageId ) ); + $this->mDb->query( $querydel, array( $pUserId, $this->mPageId ) ); $query = "insert into `".BIT_DB_PREFIX."tiki_page_footnotes`(`user_id`,`page_id`,`data`) values(?,?,?)"; - $this->query( $query, array( $pUserId, $this->mPageId, $data ) ); + $this->mDb->query( $query, array( $pUserId, $this->mPageId, $data ) ); } } + /** + * Delete footnote + */ function expungeFootnote( $pUserId ) { if( $this->mPageId ) { $query = "delete from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?"; - $this->query($query,array($pUserId,$this->mPageId)); + $this->mDb->query($query,array($pUserId,$this->mPageId)); } } - - // Functions for wiki page footnotes + /** + * Get footnote + */ function getFootnote( $pUserId ) { if( $this->mPageId ) { - $count = $this->getOne( "select count(*) from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?", array( $pUserId, $this->mPageId ) ); + $count = $this->mDb->getOne( "select count(*) from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?", array( $pUserId, $this->mPageId ) ); if( $count ) { - return $this->getOne("select `data` from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?",array( $pUserId, $this->mPageId ) ); + return $this->mDb->getOne("select `data` from `".BIT_DB_PREFIX."tiki_page_footnotes` where `user_id`=? and `page_id`=?",array( $pUserId, $this->mPageId ) ); } } } @@ -495,7 +473,7 @@ this watch code is only half fixed - spiderr $ret = "<a title=\"$desc\" href=\"" . BitPage::getDisplayUrl( $exists['title'] ) . "\">$pPageName</a>"; } else { if( $gBitUser->hasPermission( 'bit_p_edit' ) ) { - $ret = "<a href=\"".WIKI_PKG_URL."edit.php?page_id=" . urlencode( $exists['title'] ). "\" class=\"create\">$pPageName</a>"; + $ret = "<a href=\"".WIKI_PKG_URL."edit.php?page=" . urlencode( $exists['title'] ). "\" class=\"create\">$pPageName</a>"; } else { $ret = $pPageName; } @@ -520,7 +498,7 @@ this watch code is only half fixed - spiderr $query = "SELECT tl.`from_content_id`, tc.`title` FROM `".BIT_DB_PREFIX."tiki_links` tl INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tl.`from_content_id`=tc.`content_id`) WHERE tl.`to_content_id` = ?"; - $result = $this->query( $query, array( $this->mContentId ) ); + $result = $this->mDb->query( $query, array( $this->mContentId ) ); $ret = array(); while ( !$result->EOF ) { $ret[$result->fields["from_content_id"]] = $result->fields["title"]; @@ -533,9 +511,8 @@ this watch code is only half fixed - spiderr // ********* History functions for the wiki ********** // /** - * Get complete set of historical data in order to display a given wiki page version - * @param pExistsHash the hash that was returned by LibertyContent::pageExists - * @return array of mInfo data + * Get count of the number of historic records for the page + * @return count */ function getHistoryCount() { $ret = NULL; @@ -543,12 +520,17 @@ this watch code is only half fixed - spiderr $query = "SELECT COUNT(*) AS `count` FROM `".BIT_DB_PREFIX."tiki_history` WHERE `page_id` = ?"; - $rs = $this->query($query, array($this->mPageId)); + $rs = $this->mDb->query($query, array($this->mPageId)); $ret = $rs->fields['count']; } return $ret; } + /** + * Get complete set of historical data in order to display a given wiki page version + * @param pExistsHash the hash that was returned by LibertyContent::pageExists + * @return array of mInfo data + */ function getHistory( $pVersion=NULL, $pUserId=NULL, $pOffset = 0, $maxRecords = -1 ) { $ret = NULL; if( $this->isValid() ) { @@ -573,7 +555,7 @@ this watch code is only half fixed - spiderr LEFT JOIN `".BIT_DB_PREFIX."users_users` uuc ON (uuc.`user_id` = tc.`user_id`) WHERE $whereSql $versionSql order by th.`version` desc"; - $result = $this->query( $query, $bindVars, $maxRecords, $pOffset ); + $result = $this->mDb->query( $query, $bindVars, $maxRecords, $pOffset ); $ret = array(); while( !$result->EOF ) { $aux = $result->fields; @@ -586,7 +568,12 @@ this watch code is only half fixed - spiderr return $ret; } - + /** + * Roll back to a specific version of a page + * @param pVersion Version number to roll back to + * @param comment Comment text to be added to the action log + * @return TRUE if completed successfully + */ function rollbackVersion( $pVersion, $comment = '' ) { $ret = FALSE; if( $this->isValid() ) { @@ -594,7 +581,7 @@ this watch code is only half fixed - spiderr $this->mDb->StartTrans(); // JHT - cache invalidation appears to be handled by store function - so don't need to do it here $query = "select *, `user_id` AS modifier_user_id, `data` AS `edit` from `".BIT_DB_PREFIX."tiki_history` where `page_id`=? and `version`=?"; - $result = $this->query($query,array( $this->mPageId, $pVersion ) ); + $result = $this->mDb->query($query,array( $this->mPageId, $pVersion ) ); if( $result->numRows() ) { $res = $result->fetchRow(); $res['comment'] = 'Rollback to version '.$pVersion.' by '.$gBitUser->getDisplayName(); @@ -608,21 +595,23 @@ this watch code is only half fixed - spiderr $action = "Changed actual version to $pVersion"; $t = date("U"); $query = "insert into `".BIT_DB_PREFIX."tiki_actionlog`(`action`,`page_id`,`last_modified`,`user_id`,`ip`,`comment`) values(?,?,?,?,?,?)"; - $result = $this->query($query,array($action,$this->mPageId,$t,ROOT_USER_ID,$_SERVER["REMOTE_ADDR"],$comment)); + $result = $this->mDb->query($query,array($action,$this->mPageId,$t,ROOT_USER_ID,$_SERVER["REMOTE_ADDR"],$comment)); $ret = TRUE; } $this->mDb->CompleteTrans(); } else { -vd( $this->mErrors ); - $this->RollbackTrans(); + $this->mDb->RollbackTrans(); } } return $ret; } - - - // Removes a specific version of a page + /** + * Removes a specific version of a page + * @param pVersion Version number to roll back to + * @param comment Comment text to be added to the action log + * @return TRUE if completed successfully + */ function expungeVersion( $pVersion=NULL, $comment = '' ) { $ret = FALSE; if( $this->isValid() ) { @@ -633,14 +622,14 @@ vd( $this->mErrors ); $versionSql = " and `version`=? "; array_push( $bindVars, $pVersion ); } - $hasRows = $this->getOne( "SELECT COUNT(`version`) FROM `".BIT_DB_PREFIX."tiki_history` WHERE `page_id`=? $versionSql ", $bindVars ); + $hasRows = $this->mDb->getOne( "SELECT COUNT(`version`) FROM `".BIT_DB_PREFIX."tiki_history` WHERE `page_id`=? $versionSql ", $bindVars ); $query = "delete from `".BIT_DB_PREFIX."tiki_history` where `page_id`=? $versionSql "; - $result = $this->query( $query, $bindVars ); + $result = $this->mDb->query( $query, $bindVars ); if( $hasRows ) { $action = "Removed version $pVersion"; $t = date("U"); $query = "insert into `".BIT_DB_PREFIX."tiki_actionlog`(`action`,`page_id`,`last_modified`,`user_id`,`ip`,`comment`) values(?,?,?,?,?,?)"; - $result = $this->query($query,array($action,$this->mPageId,$t,ROOT_USER_ID,$_SERVER["REMOTE_ADDR"],$comment)); + $result = $this->mDb->query($query,array($action,$this->mPageId,$t,ROOT_USER_ID,$_SERVER["REMOTE_ADDR"],$comment)); $ret = TRUE; } $this->mDb->CompleteTrans(); @@ -654,7 +643,7 @@ vd( $this->mErrors ); $query = "SELECT th.*, tc.`title` FROM `".BIT_DB_PREFIX."tiki_history` th INNER JOIN `".BIT_DB_PREFIX."tiki_pages` tp ON (tp.`page_id` = th.`page_id`) INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE th.`page_id`=? and th.`version`=? "; - $result = $this->query($query,array($page_id,$version)); + $result = $this->mDb->query($query,array($page_id,$version)); $res = $result->fetchRow(); return $res; } @@ -672,7 +661,7 @@ vd( $this->mErrors ); WHERE th.`page_id` = ? ORDER BY th.`version` desc"; - $result = $this->query($query,array($pageId)); + $result = $this->mDb->query($query,array($pageId)); $ret = array(); while ($res = $result->fetchRow()) { $aux = $res; @@ -686,38 +675,68 @@ vd( $this->mErrors ); } */ - // Methods to cache and handle the cached version of wiki pages - // to prevent parsing large pages. + /** + * Methods to cache and handle the cached version of wiki pages + * to prevent parsing large pages. + */ + /** + * Save cached version of page to store + * @param cache Data to be cached + */ function setPageCache( $cache ) { if( $this->mPageId ) { $query = "update `".BIT_DB_PREFIX."tiki_pages` set `wiki_cache`=? where `page_id`=?"; - $this->query( $query, array( $cache, $this->mPageId ) ); + $this->mDb->query( $query, array( $cache, $this->mPageId ) ); } } + /** + * Get cached version of page from store + * @param page ? Not used + */ function get_cache_info($page) { if( $this->mPageId ) { $query = "select `cache`,`cache_timestamp` from `".BIT_DB_PREFIX."tiki_pages` where `page_id`=?"; - $result = $this->query( $query, array( $this->mPageId ) ); + $result = $this->mDb->query( $query, array( $this->mPageId ) ); return $result->fetchRow(); } } + + /** + * Update cached version of page in store + * @param data Data to be cached + */ function updateCache( $data ) { if( $this->mPageId ) { $now = date('U'); $query = "update `".BIT_DB_PREFIX."tiki_pages` set `cache`=?, `cache_timestamp`=$now where `page_id`=?"; - $result = $this->query( $query, array( $data, $this->mPageId ) ); + $result = $this->mDb->query( $query, array( $data, $this->mPageId ) ); return true; } } + + /** + * Flag cached version as out of date + * Cache will be updated next time the page is accessed + */ function invalidateCache() { if( $this->mPageId ) { $query = "UPDATE `".BIT_DB_PREFIX."tiki_pages` SET `cache_timestamp`=? WHERE `page_id`=?"; - $this->query( $query, array( 0, $this->mPageId ) ); + $this->mDb->query( $query, array( 0, $this->mPageId ) ); } } - + /** + * Generate list of pages + * @param offset Number of the first record to list + * @param maxRecords Number of records to list + * @param sort_mode Order in which the records will be sorted + * @param find Filter to be applied to the list + * @param pUserId If set additionally filter on UserId + * @param pExtras If set adds additional counts of links to and from each page + * This can take some time to calculate, and so should not normally be enabled + * @param pOrphansOnly If Set list only unattached pages ( ones not used in other content ) + */ function getList($offset = 0, $maxRecords = -1, $sort_mode = 'title_desc', $find = '', $pUserId=NULL, $pExtras=FALSE, $pOrphansOnly=FALSE ) { global $gBitSystem; if ($sort_mode == 'size_desc') { @@ -763,7 +782,7 @@ vd( $this->mErrors ); $query = "SELECT uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name ,`page_id`, `hits`, `page_size` as `len`, tc.`title`, tc.`format_guid`, tp.`description`, tc.`last_modified`, tc.`created`, `ip`, `comment`, `version`, `flag`, tp.`content_id` FROM `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`), `".BIT_DB_PREFIX."users_users` uue, `".BIT_DB_PREFIX."users_users` uuc WHERE tc.`content_type_guid`=? AND tc.`modifier_user_id`=uue.`user_id` AND tc.`user_id`=uuc.`user_id` $mid - ORDER BY ".$this->convert_sortmode($sort_mode); + ORDER BY ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) @@ -799,7 +818,7 @@ vd( $this->mErrors ); AND tc.`user_id`=uuc.`user_id` $mid AND tl.`to_content_id` is NULL ORDER BY " - . $this->convert_sortmode($sort_mode); + . $this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) FROM `".BIT_DB_PREFIX."tiki_pages` tp LEFT JOIN `".BIT_DB_PREFIX."tiki_links` tl on tp.`content_id` = tl.`to_content_id` @@ -814,8 +833,10 @@ vd( $this->mErrors ); // If sort mode is links then offset is 0, maxRecords is -1 (again) and sort_mode is nil // If sort mode is backlinks then offset is 0, maxRecords is -1 (again) and sort_mode is nil - $result = $this->query($query,$bindVars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindVars); + $this->mDb->StartTrans(); + $result = $this->mDb->query($query,$bindVars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindVars); + $this->mDb->CompleteTrans(); $ret = array(); while ($res = $result->fetchRow()) { $aux = array(); @@ -827,9 +848,9 @@ vd( $this->mErrors ); $aux['display_url'] = $this->getDisplayUrl( $aux['title'], $aux ); if( $pExtras ) { // USE SPARINGLY!!! This gets expensive fast -// $aux['versions"] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_history` where `page_id`=?", array( $res["page_id"] ) ); - $aux['links'] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `from_content_id`=?", array( $res["content_id"] ) ); - $aux['backlinks'] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `to_content_id`=?", array( $res["content_id"] ) ); +// $aux['versions"] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_history` where `page_id`=?", array( $res["page_id"] ) ); + $aux['links'] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `from_content_id`=?", array( $res["content_id"] ) ); + $aux['backlinks'] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `to_content_id`=?", array( $res["content_id"] ) ); } $ret[] = $aux; } @@ -882,7 +903,6 @@ vd( $this->mErrors ); define('PLUGINS_DIR', WIKI_PKG_PATH.'plugins'); /** * @package wiki - * @subpackage WikiLib */ class WikiLib extends BitPage { function WikiLib() { @@ -976,7 +996,7 @@ class WikiLib extends BitPage { } $exp = implode(" or ", $exps); $query = "SELECT tc.`title` FROM `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE $exp"; - $result = $this->query($query,$bindvars); + $result = $this->mDb->query($query,$bindvars); while ($res = $result->fetchRow()) { $ret[] = $res["title"]; } @@ -990,7 +1010,7 @@ class WikiLib extends BitPage { FROM `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE `$who`=?"; - $result = $this->query($query,array($pUserId),$max); + $result = $this->mDb->query($query,array($pUserId),$max); $ret = array(); while ($res = $result->fetchRow()) { @@ -1009,7 +1029,7 @@ class WikiLib extends BitPage { // column to tiki_pages function page_rank($loops = 16) { $query = "select `content_id`, tc.`title` from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tp.`content_id`=tc.`content_id` "; - $result = $this->query($query,array()); + $result = $this->mDb->query($query,array()); $ret = array(); while ($res = $result->fetchRow()) { @@ -1025,7 +1045,7 @@ class WikiLib extends BitPage { $pages[$conId] = $val; // Fixed query. -rlpowell $query = "update `".BIT_DB_PREFIX."tiki_pages` set `page_rank`=? where `content_id`= ?"; - $result = $this->query($query, array((int)$val, $conId) ); + $result = $this->mDb->query($query, array((int)$val, $conId) ); } for ($i = 0; $i < $loops; $i++) { @@ -1033,7 +1053,7 @@ class WikiLib extends BitPage { // Get all the pages linking to this one // Fixed query. -rlpowell $query = "select `from_content_id` from `".BIT_DB_PREFIX."tiki_links` where `to_content_id` = ?"; - $result = $this->query($query, array( $pagename ) ); + $result = $this->mDb->query($query, array( $pagename ) ); $sum = 0; while ($res = $result->fetchRow()) { @@ -1042,7 +1062,7 @@ class WikiLib extends BitPage { if (isset($pages[$linking])) { // Fixed query. -rlpowell $q2 = "select count(*) from `".BIT_DB_PREFIX."tiki_links` where `from_page`= ?"; - $cant = $this->getOne($q2, array($linking) ); + $cant = $this->mDb->getOne($q2, array($linking) ); if ($cant == 0) $cant = 1; $sum += $pages[$linking] / $cant; } @@ -1052,7 +1072,7 @@ class WikiLib extends BitPage { $pages[$pagename] = $val; // Fixed query. -rlpowell $query = "update `".BIT_DB_PREFIX."tiki_pages` set `page_rank`=? where `title`=?"; - $result = $this->query($query, array((int)$val, $pagename) ); + $result = $this->mDb->query($query, array((int)$val, $pagename) ); // Update } @@ -1102,7 +1122,7 @@ class WikiLib extends BitPage { from `".BIT_DB_PREFIX."tiki_pages` order by `hits` desc"; - $result = $this->query($query, array(),$limit); + $result = $this->mDb->query($query, array(),$limit); $ret = array(); while ($res = $result->fetchRow()) { @@ -1118,8 +1138,8 @@ class WikiLib extends BitPage { // Returns the name of "n" random pages function get_random_pages( $pNumPages=10 ) { $ret = NULL; - $query = "select `content_id`, `title` from `".BIT_DB_PREFIX."tiki_content` WHERE `content_type_guid`='".BITPAGE_CONTENT_TYPE_GUID."' ORDER BY ".$this->convert_sortmode( 'random' ); - $rs = $this->query( $query, array(), $pNumPages ); + $query = "select `content_id`, `title` from `".BIT_DB_PREFIX."tiki_content` WHERE `content_type_guid`='".BITPAGE_CONTENT_TYPE_GUID."' ORDER BY ".$this->mDb->convert_sortmode( 'random' ); + $rs = $this->mDb->query( $query, array(), $pNumPages ); while( $rs && !$rs->EOF ) { $ret[$rs->fields['content_id']]['title'] = $rs->fields['title']; $ret[$rs->fields['content_id']]['display_url'] = $this->getDisplayUrl( $rs->fields['title'] ); @@ -1138,7 +1158,7 @@ class WikiLib extends BitPage { function wiki_get_link_structure($page, $level) { $query = "select `to_page` from `".BIT_DB_PREFIX."tiki_links` where `from_page`=?"; - $result = $this->query($query,array($page)); + $result = $this->mDb->query($query,array($page)); $aux['pages'] = array(); $aux['name'] = $page; while ($res = $result->fetchRow()) { @@ -1158,43 +1178,43 @@ class WikiLib extends BitPage { global $count_admin_pvs, $user; if ($count_admin_pvs == 'y' || !$gBitUser->isAdmin()) { $query = "update `".BIT_DB_PREFIX."tiki_wiki_attachments` set `downloads`=`downloads`+1 where `att_id`=?"; - $result = $this->query($query,array((int)$id)); + $result = $this->mDb->query($query,array((int)$id)); } return true; } function get_wiki_attachment($att_id) { $query = "select * from `".BIT_DB_PREFIX."tiki_wiki_attachments` where `att_id`=?"; - $result = $this->query($query,array((int)$att_id)); + $result = $this->mDb->query($query,array((int)$att_id)); if (!$result->numRows()) return false; $res = $result->fetchRow(); return $res; } function remove_wiki_attachment($att_id) { global $w_use_dir; - $path = $this->getOne("select `path` from `".BIT_DB_PREFIX."tiki_wiki_attachments` where `att_id`=$att_id"); + $path = $this->mDb->getOne("select `path` from `".BIT_DB_PREFIX."tiki_wiki_attachments` where `att_id`=$att_id"); if ($path) { @unlink ($w_use_dir . $path); } $query = "delete from `".BIT_DB_PREFIX."tiki_wiki_attachments` where `att_id`='$att_id'"; - $result = $this->query($query); + $result = $this->mDb->query($query); } function wiki_attach_file($page, $name, $type, $size, $data, $comment, $pUserId, $fhash) { $comment = strip_tags($comment); $now = date("U"); $query = "insert into `".BIT_DB_PREFIX."tiki_wiki_attachments` (`page`,`filename`,`filesize`,`filetype`,`data`,`created`,`downloads`,`user_id`,`comment`,`path`) values(?,?,?,?,?,?,0,?,?,?)"; - $result = $this->query($query,array($page,$name, (int) $size,$type,$data, (int) $now, $pUserId, $comment,$fhash)); + $result = $this->mDb->query($query,array($page,$name, (int) $size,$type,$data, (int) $now, $pUserId, $comment,$fhash)); } function wiki_link_structure() { - $query = "select `title` from `".BIT_DB_PREFIX."tiki_pages` order by ".$this->convert_sortmode("title_asc"); - $result = $this->query($query); + $query = "select `title` from `".BIT_DB_PREFIX."tiki_pages` order by ".$this->mDb->convert_sortmode("title_asc"); + $result = $this->mDb->query($query); while ($res = $result->fetchRow()) { print ($res["title"] . " "); $page = $res["title"]; $query2 = "select `to_page` from `".BIT_DB_PREFIX."tiki_links` where `from_page`=?"; - $result2 = $this->query($query2, array( $page ) ); + $result2 = $this->mDb->query($query2, array( $page ) ); $pages = array(); while ($res2 = $result2->fetchRow()) { if (($res2["to_page"] <> $res["title"]) && (!in_array($res2["to_page"], $pages))) { @@ -1249,10 +1269,10 @@ class WikiLib extends BitPage { $mid = ""; } - $query = "select * from `".BIT_DB_PREFIX."tiki_received_pages` $mid order by ".$this->convert_sortmode($sort_mode); + $query = "select * from `".BIT_DB_PREFIX."tiki_received_pages` $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_received_pages` $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -1281,24 +1301,24 @@ class WikiLib extends BitPage { $query = "SELECT ts.`structure_id`, tc.`title` FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_pages` tp ON (tp.`page_id` = ts.`content_id`) INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) WHERE ts.`content_id`=?"; - $result = $this->query($query, array( $pPageId ) ); + $result = $this->mDb->query($query, array( $pPageId ) ); if ( $result ) $delPageName = $result['title']; else $delPageName = ''; while ($res = $result->fetchRow()) { $this->remove_from_structure($res["structure_id"]); } $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_history` where `page_id` = ?"; - $result = $this->query( $query, array( $pPageId ) ); + $result = $this->mDb->query( $query, array( $pPageId ) ); $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_links` where `from_content_id` = ?"; - $result = $this->query( $query, array( $pPageId ) ); + $result = $this->mDb->query( $query, array( $pPageId ) ); $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_pages` where `page_id` = ?"; - $result = $this->query( $query, array( $pPageId ) ); + $result = $this->mDb->query( $query, array( $pPageId ) ); $action = "Removed"; $t = date("U"); $query = "INSERT INTO `".BIT_DB_PREFIX."tiki_actionlog`(`action`,`page_id`, `title`, `last_modified`, `user_id`, `ip`, `comment`) VALUES (?,?,?,?,?,?,?)"; - $result = $this->query( $query, array( $action, $pPageId, $delPageName, (int)$t, $gBitUser->mUserId, $_SERVER["REMOTE_ADDR"], $comment ) ); + $result = $this->mDb->query( $query, array( $action, $pPageId, $delPageName, (int)$t, $gBitUser->mUserId, $_SERVER["REMOTE_ADDR"], $comment ) ); $query = "UPDATE `".BIT_DB_PREFIX."users_groups` SET `group_home`=? WHERE `group_home`=?"; - $this->query($query, array(NULL, $delPageName)); + $this->mDb->query($query, array(NULL, $delPageName)); #$this->remove_object('wiki page', $delPageName); @@ -1319,7 +1339,7 @@ class WikiLib extends BitPage { $tar->addFile( $gBitSystem->getStyleCss() ); // Foreach page $query = "select * from `".BIT_DB_PREFIX."tiki_pages`"; - $result = $this->query($query,array()); + $result = $this->mDb->query($query,array()); while ($res = $result->fetchRow()) { $title = $res["title"] . '.html'; @@ -1340,7 +1360,7 @@ class WikiLib extends BitPage { $action = "dump created"; $t = date("U"); $query = "insert into `".BIT_DB_PREFIX."tiki_actionlog`(`action`,`page_id`,`last_modified`,`user_id`,`ip`,`comment`) values(?,?,?,?,?,?)"; - $result = $this->query($query,array($action,1,$t,$gBitUser->mUserId,$_SERVER["REMOTE_ADDR"],'')); + $result = $this->mDb->query($query,array($action,1,$t,$gBitUser->mUserId,$_SERVER["REMOTE_ADDR"],'')); } /* using BitPage::getList() now - xing @@ -1388,10 +1408,10 @@ class WikiLib extends BitPage { // If sort mode is backlinks then offset is 0, maxRecords is -1 (again) and sort_mode is nil $query = "SELECT tc.`title`, tc.`hits`, tp.`page_size` as `len` ,tc.`last_modified`, tc.`user_id`, tc.`ip`, tp.`comment`, tp.`version`, tp.`flag`, tc.`content_id`, tp.`page_id` FROM `".BIT_DB_PREFIX."tiki_content` tc INNER JOIN `".BIT_DB_PREFIX."tiki_pages` tp on (tp.`content_id` = tc.`content_id` ) - WHERE tc.`content_type_guid`='bitpage' $mid order by ".$this->convert_sortmode($sort_mode); + WHERE tc.`content_type_guid`='bitpage' $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_content` tc $mid_cant"; - $result = $this->query($query,$bindvars,-1,0); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,-1,0); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); $num_or = 0; @@ -1399,9 +1419,9 @@ class WikiLib extends BitPage { $page_ci = $res["content_id"]; $queryc = "select count(*) from `".BIT_DB_PREFIX."tiki_links` where `to_content_id`=?"; - $cant = $this->getOne($queryc,array($page_ci)); + $cant = $this->mDb->getOne($queryc,array($page_ci)); $queryc = "select count(*) from `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_pages` tp where ts.`content_id`=tp.`page_id` and tp.`content_id`=?"; - $cant += $this->getOne($queryc,array($page_ci)); + $cant += $this->mDb->getOne($queryc,array($page_ci)); if ($cant == 0) { $num_or++; @@ -1421,9 +1441,9 @@ class WikiLib extends BitPage { $aux["comment"] = $res["comment"]; $aux["version"] = $res["version"]; $aux["flag"] = $res["flag"] == 'y' ? tra('locked') : tra('unlocked'); - $aux["versions"] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_history` where `page_id`=?",array($page_id)); - $aux["links"] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `from_content_id`=?",array($page_ci)); - $aux["backlinks"] = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `to_content_id`=?",array($page_ci)); + $aux["versions"] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_history` where `page_id`=?",array($page_id)); + $aux["links"] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `from_content_id`=?",array($page_ci)); + $aux["backlinks"] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_links` where `to_content_id`=?",array($page_ci)); $ret[] = $aux; } } @@ -1483,17 +1503,17 @@ class WikiLib extends BitPage { } $query = "select `name` ,`created`,tcts.`template_id` from `".BIT_DB_PREFIX."tiki_content_templates` tct, `".BIT_DB_PREFIX."tiki_content_templates_sections` tcts "; - $query.= " where tcts.`template_id`=tct.`template_id` and `section`=? $mid order by ".$this->convert_sortmode($sort_mode); + $query.= " where tcts.`template_id`=tct.`template_id` and tcts.`section`=? $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_content_templates` tct, `".BIT_DB_PREFIX."tiki_content_templates_sections` tcts "; - $query_cant.= "where tcts.`template_id`=tct.`template_id` and `section`=? $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $query_cant.= "where tcts.`template_id`=tct.`template_id` and tcts.`section`=? $mid"; + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { $query2 = "select `section` from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=?"; - $result2 = $this->query($query2,array((int)$res["template_id"])); + $result2 = $this->mDb->query($query2,array((int)$res["template_id"])); $sections = array(); while ($res2 = $result2->fetchRow()) { @@ -1513,7 +1533,7 @@ class WikiLib extends BitPage { /*shared*/ function get_template($template_id) { $query = "select * from `".BIT_DB_PREFIX."tiki_content_templates` where `template_id`=?"; - $result = $this->query($query,array((int)$template_id)); + $result = $this->mDb->query($query,array((int)$template_id)); if (!$result->numRows()) return false; $res = $result->fetchRow(); return $res; @@ -1557,10 +1577,10 @@ class WikiLib extends BitPage { "INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) " . "INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id`= th.`user_id`) " . "$where " . - "order by th.".$this->convert_sortmode($sort_mode); + "order by th.".$this->mDb->convert_sortmode($sort_mode); $query_cant = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."tiki_history` th " . $where; - $result = $this->query($query,$bindvars,$limit,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$limit,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); $r = array(); while ($res = $result->fetchRow()) { diff --git a/admin/admin_wiki_inc.php b/admin/admin_wiki_inc.php index acbba99..55ff2b7 100644 --- a/admin/admin_wiki_inc.php +++ b/admin/admin_wiki_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_wiki/admin/admin_wiki_inc.php,v 1.3 2005/08/01 18:42:05 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_wiki/admin/admin_wiki_inc.php,v 1.4 2005/08/07 17:46:50 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -321,7 +321,7 @@ if (isset($_REQUEST["wikidiscussprefs"])) { if (isset($_REQUEST["wiki_forum"])) { $gBitSystem->storePreference('wiki_forum', $_REQUEST["wiki_forum"]); $gBitSmarty->assign('wiki_forum', $_REQUEST["wiki_forum"]); - $wiki_forum_id = $gBitSystem->getOne("select `forumID` from `tiki_forums` where `name`='" . $_REQUEST["wiki_forum"] . "'"); + $wiki_forum_id = $gBitSystem->mDb->getOne("select `forumID` from `tiki_forums` where `name`='" . $_REQUEST["wiki_forum"] . "'"); $gBitSystem->storePreference('wiki_forum_id', $wiki_forum_id); $gBitSmarty->assign('wiki_forum_id', $wiki_forum_id); } diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 64f8bed..3c48d62 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -1,6 +1,6 @@ <?php -global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; +global $gBitSystem, $gUpgradeFrom, $gUpgradeTo, $gBitDb; $upgrades = array( @@ -69,23 +69,23 @@ array( 'ALTER' => array( // STEP 3 array( 'PHP' => ' - global $gBitSystem; + global $gBitSystem, $gBitDb; require_once( WIKI_PKG_PATH."BitPage.php" ); - $max = $gBitSystem->GetOne( "SELECT MAX(`page_id`) FROM `'.BIT_DB_PREFIX.'tiki_pages`" ); - $gBitSystem->mDb->mDb->CreateSequence( "tiki_pages_page_id_seq", $max + 1 ); + $max = $gBitDb->GetOne( "SELECT MAX(`page_id`) FROM `'.BIT_DB_PREFIX.'tiki_pages`" ); + $gBitSystem->mDb->CreateSequence( "tiki_pages_page_id_seq", $max + 1 ); $query = "SELECT uu.`user_id`, uu2.`user_id` AS modifier_user_id, tp.`lastModif` AS created, tp.`lastModif` AS `last_modified`, tp.`data`, tp.`pageName` AS `title`, tp.`ip`, tp.`hits` FROM `'.BIT_DB_PREFIX.'tiki_pages` tp INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu ON( tp.`creator`=uu.`login` ) INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu2 ON( tp.`user`=uu2.`login` )"; - if( $rs = $gBitSystem->query( $query ) ) { + if( $rs = $gBitDb->query( $query ) ) { while( !$rs->EOF ) { - $conId = $gBitSystem->mDb->mDb->GenID( "tiki_content_id_seq" ); + $conId = $gBitDb->GenID( "tiki_content_id_seq" ); $rs->fields["content_id"] = $conId; $rs->fields["content_type_guid"] = BITPAGE_CONTENT_TYPE_GUID; $rs->fields["format_guid"] = PLUGIN_GUID_TIKIWIKI; - $gBitSystem->mDb->associateInsert( "tiki_content", $rs->fields ); - $gBitSystem->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_pages` SET `content_id`=? WHERE `pageName`=?", array( $conId, $rs->fields["title"] ) ); + $gBitDb->associateInsert( "tiki_content", $rs->fields ); + $gBitDb->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_pages` SET `content_id`=? WHERE `pageName`=?", array( $conId, $rs->fields["title"] ) ); if( $w_use_dir = $gBitSystem->getPreference("w_use_dir") ) { $page = new BitPage( NULL, $conId ); - if( $page->load() && $rs2 = $gBitSystem->query( "SELECT * FROM `'.BIT_DB_PREFIX.'tiki_wiki_attachments` twa INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu ON( twa.`user`=uu.`login` ) WHERE twa.`page`=?", array( $rs->fields["title"] ) ) ) { + if( $page->load() && $rs2 = $gBitDb->query( "SELECT * FROM `'.BIT_DB_PREFIX.'tiki_wiki_attachments` twa INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu ON( twa.`user`=uu.`login` ) WHERE twa.`page`=?", array( $rs->fields["title"] ) ) ) { while( !$rs2->EOF ) { $info = $rs2->fields; $storeHash["modifier_user_id"] = $rs->fields["modifier_user_id"]; @@ -95,7 +95,7 @@ array( 'PHP' => ' $storeHash["upload"]["size"] = filesize( $w_use_dir.$info["path"] ); $storeHash["upload"]["tmp_name"] = $w_use_dir.$info["path"]; if( $page->store( $storeHash ) ) { - $gBitSystem->query( "DELETE FROM `'.BIT_DB_PREFIX.'tiki_wiki_attachments` WHERE `page`=?", array( $rs->fields["title"] ) ); + $gBitDb->query( "DELETE FROM `'.BIT_DB_PREFIX.'tiki_wiki_attachments` WHERE `page`=?", array( $rs->fields["title"] ) ); } unset( $storeHash ); $rs2->MoveNext(); @@ -183,6 +183,10 @@ array( 'QUERY' => "UPDATE `".BIT_DB_PREFIX."tiki_categorized_objects` SET `object_type`='".BITPAGE_CONTENT_TYPE_GUID."', `object_id`=(SELECT tc.`content_id` FROM `".BIT_DB_PREFIX."tiki_content` tc WHERE tc.`title`=`".BIT_DB_PREFIX."tiki_categorized_objects`.`objId` AND `".BIT_DB_PREFIX."tiki_categorized_objects`.`object_type`='wiki page')", + // update user watches + "update `".BIT_DB_PREFIX."tiki_user_watches` as `tw` set `object` = (select `tp`.`page_id` from `tiki_pages` as `tp`, `tiki_content` as `tc` where `tp`.`content_id` = `tc`.`content_id` and `tc`.`title` = `tw`.`title` )", + + ), )), @@ -207,11 +211,11 @@ array( 'PHP' => ' require_once( LIBERTY_PKG_PATH."LibertyStructure.php" ); require_once( WIKI_PKG_PATH."BitBook.php" ); $query = "SELECT `structure_id`, `content_id` FROM `".BIT_DB_PREFIX."tiki_structures` WHERE `parent_id` IS NULL OR `parent_id`=0"; - $roots = $gBitSystem->GetAssoc( $query ); + $roots = $gBitDb->getAssoc( $query ); $s = new LibertyStructure(); foreach( $roots AS $rootId=>$contentId ) { - $gBitSystem->query( "UPDATE `".BIT_DB_PREFIX."tiki_structures` SET `root_structure_id`=? WHERE `structure_id`=?", array( $rootId, $rootId ) ); - $gBitSystem->query( "UPDATE `".BIT_DB_PREFIX."tiki_content` SET `content_type_guid`=? WHERE `content_id`=?", array( BITBOOK_CONTENT_TYPE_GUID, $contentId ) ); + $gBitDb->query( "UPDATE `".BIT_DB_PREFIX."tiki_structures` SET `root_structure_id`=? WHERE `structure_id`=?", array( $rootId, $rootId ) ); + $gBitDb->query( "UPDATE `".BIT_DB_PREFIX."tiki_content` SET `content_type_guid`=? WHERE `content_id`=?", array( BITBOOK_CONTENT_TYPE_GUID, $contentId ) ); $toc = $s->build_subtree_toc( $rootId ); $s->setTreeRoot( $rootId, $toc ); } diff --git a/copyrights_lib.php b/copyrights_lib.php index e65ba47..ebcc3b8 100644 --- a/copyrights_lib.php +++ b/copyrights_lib.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/copyrights_lib.php,v 1.2 2005/06/28 07:46:27 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/copyrights_lib.php,v 1.3 2005/08/07 17:46:49 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: copyrights_lib.php,v 1.2 2005/06/28 07:46:27 spiderr Exp $ + * $Id: copyrights_lib.php,v 1.3 2005/08/07 17:46:49 squareing Exp $ * @package wiki */ @@ -21,10 +21,10 @@ class CopyrightsLib extends BitBase { BitBase::BitBase(); } function list_copyrights( $pPageId ) { - $query = "select * from `".BIT_DB_PREFIX."tiki_copyrights` WHERE `page_id`=? order by ".$this->convert_sortmode( "copyright_order_asc" ); + $query = "select * from `".BIT_DB_PREFIX."tiki_copyrights` WHERE `page_id`=? order by ".$this->mDb->convert_sortmode( "copyright_order_asc" ); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_copyrights` WHERE `page_id`=?"; - $result = $this->query($query, array( $pPageId )); - $cant = $this->getOne($query_cant, array( $pPageId )); + $result = $this->mDb->query($query, array( $pPageId )); + $cant = $this->mDb->getOne($query_cant, array( $pPageId )); $ret = array(); while ($res = $result->fetchRow()) { $ret[] = $res; @@ -36,11 +36,11 @@ class CopyrightsLib extends BitBase { } function top_copyright_order( $pPageId ) { $query = "select MAX(`copyright_order`) from `".BIT_DB_PREFIX."tiki_copyrights` where `page_id` = ?"; - return $this->getOne($query, array( $pPageId )); + return $this->mDb->getOne($query, array( $pPageId )); } function unique_copyright( $pPageId , $title) { $query = "select `copyrightID` from `".BIT_DB_PREFIX."tiki_copyrights` where `page_id`=? and `title`=?"; - return $this->getOne($query, array( $pPageId ,$title)); + return $this->mDb->getOne($query, array( $pPageId ,$title)); } function add_copyright( $pPageId , $title, $year, $authors, $pUserId) { //$unique = $this->unique_copyright( $pPageId ,$title); @@ -52,27 +52,27 @@ class CopyrightsLib extends BitBase { $top = $this->top_copyright_order( $pPageId ); $order = $top + 1; $query = "insert into `".BIT_DB_PREFIX."tiki_copyrights` (`page_id`, `title`, `year`, `authors`, `copyright_order`, `user_id`) values (?,?,?,?,?,?)"; - $this->query($query,array( $pPageId ,$title,$year,$authors,$order,$pUserId)); + $this->mDb->query($query,array( $pPageId ,$title,$year,$authors,$order,$pUserId)); return true; } function edit_copyright($id, $title, $year, $authors, $pUserId) { $query = "update `".BIT_DB_PREFIX."tiki_copyrights` SET `year`=?, `title`=?, `authors`=?, `user_id`=? where `copyright_id`=?"; - $this->query($query,array($year,$title,$authors,$pUserId,(int)$id)); + $this->mDb->query($query,array($year,$title,$authors,$pUserId,(int)$id)); return true; } function remove_copyright($id) { $query = "delete from `".BIT_DB_PREFIX."tiki_copyrights` where `copyright_id`=?"; - $this->query($query,array((int)$id)); + $this->mDb->query($query,array((int)$id)); return true; } function up_copyright($id) { $query = "update `".BIT_DB_PREFIX."tiki_copyrights` set `copyright_order`=`copyright_order`-1 where `copyright_id`=?"; - $result = $this->query($query,array((int)$id)); + $result = $this->mDb->query($query,array((int)$id)); return true; } function down_copyright($id) { $query = "update `".BIT_DB_PREFIX."tiki_copyrights` set `copyright_order`=`copyright_order`+1 where `copyright_id`=?"; - $result = $this->query($query,array((int)$id)); + $result = $this->mDb->query($query,array((int)$id)); return true; } } @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/edit.php,v 1.5 2005/08/01 18:42:04 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/edit.php,v 1.6 2005/08/07 17:46:49 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit.php,v 1.5 2005/08/01 18:42:04 squareing Exp $ + * $Id: edit.php,v 1.6 2005/08/07 17:46:49 squareing Exp $ * @package wiki * @subpackage functions */ @@ -460,7 +460,7 @@ if ($gBitSystem->isPackageActive( 'categories' ) ) { // Pigeonholes if( $gBitSystem->isPackageActive( 'pigeonholes' ) && $gBitUser->hasPermission( 'bit_p_insert_pigeonhole_member' ) ) { - include_once( PIGEONHOLES_PKG_PATH.'pigeonholes_processor_inc.php' ); + include_once( PIGEONHOLES_PKG_PATH.'get_pigeonholes_pathlist_inc.php' ); } // Nexus menus diff --git a/export_lib.php b/export_lib.php index 482b9f5..6668f9c 100644 --- a/export_lib.php +++ b/export_lib.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/export_lib.php,v 1.2 2005/06/28 07:46:27 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/export_lib.php,v 1.3 2005/08/07 17:46:49 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: export_lib.php,v 1.2 2005/06/28 07:46:27 spiderr Exp $ + * $Id: export_lib.php,v 1.3 2005/08/07 17:46:49 squareing Exp $ * @package wiki */ @@ -31,8 +31,8 @@ class ExportLib extends BitBase { include_once (UTIL_PKG_PATH."tar.class.php"); $tar = new tar(); $query = "SELECT tp.`page_id` from `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) - ORDER BY tc.".$this->convert_sortmode("title_asc"); - $result = $this->query($query,array()); + ORDER BY tc.".$this->mDb->convert_sortmode("title_asc"); + $result = $this->mDb->query($query,array()); while ($res = $result->fetchRow()) { $page_id = $res["page_id"]; $content = $this->export_wiki_page($page_id, 0); @@ -73,8 +73,8 @@ class ExportLib extends BitBase { "INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`) " . "INNER JOIN `".BIT_DB_PREFIX."tiki_history` th ON (th.`page_id` = th.`page_id`) " . "INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = th.`user_id`) " . - "WHERE tp.`page_id`=? order by th.".$this->convert_sortmode("version_desc"); - $result = $this->query($query,array($page_id)); + "WHERE tp.`page_id`=? order by th.".$this->mDb->convert_sortmode("version_desc"); + $result = $this->mDb->query($query,array($page_id)); $ret = array(); while ($res = $result->fetchRow()) { array_push( $ret, $res ); diff --git a/modules/mod_breadcrumb.tpl b/modules/mod_breadcrumb.tpl index a3f1a9c..ded4e3f 100644 --- a/modules/mod_breadcrumb.tpl +++ b/modules/mod_breadcrumb.tpl @@ -1,11 +1,11 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/Attic/mod_breadcrumb.tpl,v 1.2 2005/07/17 17:36:46 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/Attic/mod_breadcrumb.tpl,v 1.3 2005/08/07 17:46:50 squareing Exp $ *} {strip} {if $gBitSystem->isFeatureActive( 'feature_featuredLinks' )} {bitmodule title="$moduleTitle" name="breadcrumb"} <ol class="wiki"> {section name=ix loop=$breadCrumb} <li> - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page={$breadCrumb[ix]}"> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?page={$breadCrumb[ix]}"> {if $maxlen > 0} {$breadCrumb[ix]|truncate:$maxlen:"...":true} {else} diff --git a/modules/mod_random_pages.php b/modules/mod_random_pages.php index 98ca63b..65aa658 100644 --- a/modules/mod_random_pages.php +++ b/modules/mod_random_pages.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_random_pages.php,v 1.4 2005/08/01 18:42:06 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_random_pages.php,v 1.5 2005/08/07 17:46:50 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,10 +8,14 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_random_pages.php,v 1.4 2005/08/01 18:42:06 squareing Exp $ + * $Id: mod_random_pages.php,v 1.5 2005/08/07 17:46:50 squareing Exp $ * @package wiki * @subpackage modules */ + +/** + * Required files + */ require_once( WIKI_PKG_PATH.'BitPage.php' ); global $wikilib; diff --git a/modules/mod_top_pages.tpl b/modules/mod_top_pages.tpl index 48f0a6e..fbe2eff 100644 --- a/modules/mod_top_pages.tpl +++ b/modules/mod_top_pages.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_top_pages.tpl,v 1.4 2005/08/01 18:42:06 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_top_pages.tpl,v 1.5 2005/08/07 17:46:50 squareing Exp $ *} {strip} {if $gBitSystem->isPackageActive( 'wiki' )} {if $nonums eq 'y'} @@ -9,7 +9,7 @@ {bitmodule title="$moduleTitle" name="top_pages"} <ol class="wiki"> {section name=ix loop=$modTopPages} - <li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?page={$modTopPages[ix].page_name}">{$modTopPages[ix].title}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}index.php?page={$modTopPages[ix].page_name}">{$modTopPages[ix].title}</a></li> {sectionelse} <li></li> {/section} diff --git a/modules/mod_wiki_last_comments.tpl b/modules/mod_wiki_last_comments.tpl index a263430..1a54823 100644 --- a/modules/mod_wiki_last_comments.tpl +++ b/modules/mod_wiki_last_comments.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_wiki_last_comments.tpl,v 1.1 2005/06/19 06:12:45 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_wiki_last_comments.tpl,v 1.2 2005/08/07 17:46:50 squareing Exp $ *} {if $lastComments} {if $nonums eq 'y'} {eval var="{tr}Last `$module_rows` wiki comments{/tr}" assign="tpl_module_title"} @@ -9,7 +9,7 @@ <ul class="wiki"> {section name=ix loop=$lastComments} <li class="{cycle values="odd,even"}"> - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?content_id={$lastComments[ix].content_id}" title="{$lastComments[ix].comment_date|bit_short_datetime}, by {displayname hash=$lastComments[ix] nolink=1}{if $moretooltips eq 'y'} on page {$lastComments[ix].page}{/if}"> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?content_id={$lastComments[ix].content_id}" title="{$lastComments[ix].comment_date|bit_short_datetime}, by {displayname hash=$lastComments[ix] nolink=1}{if $moretooltips eq 'y'} on page {$lastComments[ix].page}{/if}"> {if $moretooltips ne 'y'} <b>{$lastComments[ix].content_title}</b>: {/if} {$lastComments[ix].title} diff --git a/slideshow.php b/slideshow.php index 27022f7..a8524e7 100755 --- a/slideshow.php +++ b/slideshow.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/slideshow.php,v 1.3 2005/08/01 18:42:04 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/slideshow.php,v 1.4 2005/08/07 17:46:49 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: slideshow.php,v 1.3 2005/08/01 18:42:04 squareing Exp $ + * $Id: slideshow.php,v 1.4 2005/08/07 17:46:49 squareing Exp $ * @package wiki * @subpackage functions */ @@ -78,7 +78,7 @@ if (!$gBitUser->hasPermission( 'bit_p_view' )) { $anonpref = $wikilib->getPreference('userbreadCrumb', 4); if( $gBitUser->isRegistered() ) { - $userbreadCrumb = $wikilib->get_user_preference($user, 'userbreadCrumb', $anonpref); + $userbreadCrumb = $wikilib->getPreference('userbreadCrumb', $anonpref, $user ); } else { $userbreadCrumb = $anonpref; } diff --git a/templates/admin_external_wikis.tpl b/templates/admin_external_wikis.tpl index 4969259..cd12419 100644 --- a/templates/admin_external_wikis.tpl +++ b/templates/admin_external_wikis.tpl @@ -8,11 +8,11 @@ <div class="body"> <h2>{tr}Create/Edit External Wiki{/tr}</h2> -<form action="{$gBitLoc.WIKI_PKG_URL}admin/admin_external_wikis.php" method="post"> +<form action="{$smarty.const.WIKI_PKG_URL}admin/admin_external_wikis.php" method="post"> <input type="hidden" name="extwiki_id" value="{$extwiki_id|escape}" /> <table class="panel"> <tr><td>{tr}name{/tr}:</td><td><input type="text" maxlength="255" size="10" name="name" value="{$info.name|escape}" /></td></tr> -<tr><td>{tr}URL (use $page to be replaced by the page name in the URL example: http://www.example.com/{$gBitLoc.WIKI_PKG_URL}index.php?page=$page){/tr}:</td><td><input type="text" maxlength="255" size="40" name="extwiki" value="{$info.extwiki|escape}" /></td></tr> +<tr><td>{tr}URL (use $page to be replaced by the page name in the URL example: http://www.example.com/{$smarty.const.WIKI_PKG_URL}index.php?page=$page){/tr}:</td><td><input type="text" maxlength="255" size="40" name="extwiki" value="{$info.extwiki|escape}" /></td></tr> <tr class="panelsubmitrow"><td colspan="2"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr> </table> </form> @@ -20,8 +20,8 @@ <h2>{tr}External Wiki{/tr}</h2> <table class="data"> <tr> -<th><a href="{$gBitLoc.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> -<th><a href="{$gBitLoc.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={if $sort_mode eq 'extwiki_desc'}extwiki_asc{else}extwiki_desc{/if}">{tr}extwiki{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={if $sort_mode eq 'extwiki_desc'}extwiki_asc{else}extwiki_desc{/if}">{tr}extwiki{/tr}</a></th> <th>{tr}action{/tr}</th> </tr> {cycle values="even,odd" print=false} @@ -30,8 +30,8 @@ <td>{$channels[user].name}</td> <td>{$channels[user].extwiki}</td> <td> - <a href="{$gBitLoc.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].extwiki_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this external wiki?{/tr}')" title="Click here to delete this external wiki">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> - <a href="{$gBitLoc.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={$sort_mode}&extwiki_id={$channels[user].extwiki_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].extwiki_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this external wiki?{/tr}')" title="Click here to delete this external wiki">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}admin/admin_external_wikis.php?offset={$offset}&sort_mode={$sort_mode}&extwiki_id={$channels[user].extwiki_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> </td> </tr> {sectionelse} diff --git a/templates/admin_wiki.tpl b/templates/admin_wiki.tpl index b7e994b..3d05032 100644 --- a/templates/admin_wiki.tpl +++ b/templates/admin_wiki.tpl @@ -145,9 +145,9 @@ {legend legend="Dumps and Export"} <div class="row"> {forminput} - <a href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=wiki&dump=1">{tr}Generate dump{/tr}</a><br /> - <a href="{$gBitLoc.BIT_ROOT_URL}dump/{$bitdomain}new.tar">{tr}Download last dump{/tr}</a><br /> - <a href="{$gBitLoc.WIKI_PKG_URL}export_wiki_pages.php">{tr}Export wiki pages{/tr}</a> + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=wiki&dump=1">{tr}Generate dump{/tr}</a><br /> + <a href="{$smarty.const.BIT_ROOT_URL}dump/{$bitdomain}new.tar">{tr}Download last dump{/tr}</a><br /> + <a href="{$smarty.const.WIKI_PKG_URL}export_wiki_pages.php">{tr}Export wiki pages{/tr}</a> {/forminput} </div> {/legend} @@ -282,7 +282,7 @@ {if $gBitSystem->isPackageActive( 'tikiforums' )} <div class="boxcontent"> - <form method="post" action="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=wiki"> + <form method="post" action="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=wiki"> <table class="panel"><tr> <th colspan="2">{tr}Wiki Discussion{/tr}</th> </tr><tr> diff --git a/templates/backlinks.tpl b/templates/backlinks.tpl index a3bbb75..0b6dea0 100644 --- a/templates/backlinks.tpl +++ b/templates/backlinks.tpl @@ -1,13 +1,13 @@ {strip} <div class="listing wiki"> <div class="header"> - <h1>{tr}Backlinks to{/tr} <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}" class="wiki">{$page}</a></h1> + <h1>{tr}Backlinks to{/tr} <a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}" class="wiki">{$page}</a></h1> </div> <div class="body"> <ul> {foreach from=$backlinks key=content_id item=title} - <li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?content_id={$content_id}" class="wiki">{$title}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}index.php?content_id={$content_id}" class="wiki">{$title}</a></li> {foreachelse} <div class="norecords">{tr}No backlinks to this page{/tr}</div> {/foreach} diff --git a/templates/book_toc_leaf.tpl b/templates/book_toc_leaf.tpl index b2ca40a..2d23305 100755 --- a/templates/book_toc_leaf.tpl +++ b/templates/book_toc_leaf.tpl @@ -1 +1 @@ -<li>{if $numbering}{$structure_tree.prefix} {/if}<a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$structure_tree.structure_id}">{$structure_tree.title}</a></li> +<li>{if $numbering}{$structure_tree.prefix} {/if}<a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$structure_tree.structure_id}">{$structure_tree.title}</a></li> diff --git a/templates/book_toc_level.tpl b/templates/book_toc_level.tpl index b6134d4..713b8d6 100755 --- a/templates/book_toc_level.tpl +++ b/templates/book_toc_level.tpl @@ -1 +1 @@ -<li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$that.structure_id}">{$that.title}</a></li>{if $that.sub}<ul>{section name=xitem loop=$that.sub}{include file="structures_toc_level.tpl" that=$that.sub[xitem]}{/section}</ul>{/if} +<li><a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$that.structure_id}">{$that.title}</a></li>{if $that.sub}<ul>{section name=xitem loop=$that.sub}{include file="structures_toc_level.tpl" that=$that.sub[xitem]}{/section}</ul>{/if} diff --git a/templates/center_wiki_page.tpl b/templates/center_wiki_page.tpl index 407b78f..e4bee91 100644 --- a/templates/center_wiki_page.tpl +++ b/templates/center_wiki_page.tpl @@ -46,13 +46,13 @@ <div class="actionicon"> <!-- Actions --> {if $gBitUser->hasPermission( 'bit_p_edit' )} - <a href="{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$gContent->mInfo.page_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$gContent->mInfo.page_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> {/if} {if $userOwnsPage} <a href="{$PHP_SELF}?fHomepage={$fHomepage}&fEditCenterWikiPageSettings=1">{biticon ipackage=liberty iname="config" iexplain="configure"}</a> {/if} {if $gBitSystem->isPackageActive( 'pdf' ) && $gContent->hasUserPermission( 'bit_p_pdf_generation' )} - <a title="{tr}create PDF{/tr}" href="{$gBitLoc.PDF_PKG_URL}?page_id={$gContent->mInfo.page_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> + <a title="{tr}create PDF{/tr}" href="{$smarty.const.PDF_PKG_URL}?page_id={$gContent->mInfo.page_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> {/if} </div> <!-- End Actions --> </div> diff --git a/templates/copyrights.tpl b/templates/copyrights.tpl index 1f29f37..577e244 100644 --- a/templates/copyrights.tpl +++ b/templates/copyrights.tpl @@ -35,9 +35,9 @@ <input type="hidden" name="page_id" value="{$pageInfo.page_id}" /> <input type="hidden" name="copyright_id" value="{$copyrights[i].copyright_id|escape}" /> <input type="submit" name="editcopyright" value="{tr}edit{/tr}" /> - <a href="{$gBitLoc.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=up&copyright_id={$copyrights[i].copyright_id}">{biticon ipackage=liberty iname="nav_up" iexplain="move up"}</a> - <a href="{$gBitLoc.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=down&copyright_id={$copyrights[i].copyright_id}">{biticon ipackage=liberty iname="nav_down" iexplain="move down"}</a> - <a title="{tr}Delete this copyright{/tr}" href="{$gBitLoc.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=delete&copyright_id={$copyrights[i].copyright_id}" + <a href="{$smarty.const.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=up&copyright_id={$copyrights[i].copyright_id}">{biticon ipackage=liberty iname="nav_up" iexplain="move up"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=down&copyright_id={$copyrights[i].copyright_id}">{biticon ipackage=liberty iname="nav_down" iexplain="move down"}</a> + <a title="{tr}Delete this copyright{/tr}" href="{$smarty.const.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}&action=delete&copyright_id={$copyrights[i].copyright_id}" onclick="return confirm('{tr}Are you sure you want to delete this copyright?{/tr}')">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> </div> {/form} diff --git a/templates/create_webhelp.tpl b/templates/create_webhelp.tpl index cb4ba98..d7a63a0 100755 --- a/templates/create_webhelp.tpl +++ b/templates/create_webhelp.tpl @@ -1,13 +1,13 @@ -<a href="{$gBitLoc.WIKI_PKG_URL}create_webhelp.php" class="pagetitle">{tr}Create WebHelp{/tr}</a> +<a href="{$smarty.const.WIKI_PKG_URL}create_webhelp.php" class="pagetitle">{tr}Create WebHelp{/tr}</a> Here you can generate static HTML files from Wiki Book. <br /><br /> {if $generated eq 'y'} -<a href="{$gBitLoc.BITHELP_PKG_URL}{$dir}/index.html">{tr}You can browse the generated WebHelp here{/tr}</a><br /><br /> +<a href="{$smarty.const.BITHELP_PKG_URL}{$dir}/index.html">{tr}You can browse the generated WebHelp here{/tr}</a><br /><br /> {/if} -<form method="post" action="{$gBitLoc.WIKI_PKG_URL}create_webhelp.php"> +<form method="post" action="{$smarty.const.WIKI_PKG_URL}create_webhelp.php"> <table class="panel"> <tr> <td>{tr}Structure{/tr}</td> diff --git a/templates/edit_page.tpl b/templates/edit_page.tpl index c9c2a32..7aae06e 100644 --- a/templates/edit_page.tpl +++ b/templates/edit_page.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/edit_page.tpl,v 1.5 2005/07/25 20:02:58 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/edit_page.tpl,v 1.6 2005/08/07 17:46:51 squareing Exp $ *} <div class="floaticon">{bithelp}</div> <div class="admin wiki"> @@ -228,7 +228,7 @@ <div class="row"> {formlabel label="License"} {forminput} - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page={$wikiLicensePage}">{tr}{$wikiLicensePage}{/tr}</a> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?page={$wikiLicensePage}">{tr}{$wikiLicensePage}{/tr}</a> {formhelp note=""} {/forminput} </div> @@ -276,7 +276,7 @@ <tr><td> {tr}Import file{/tr}:</td><td> <input name="userfile1" type="file" /> - { * <a href="{$gBitLoc.WIKI_PKG_URL}export_wiki_pages.php?page_id={$pageInfo.page_id}&all=1">{tr}export all versions{/tr}</a> * } + { * <a href="{$smarty.const.WIKI_PKG_URL}export_wiki_pages.php?page_id={$pageInfo.page_id}&all=1">{tr}export all versions{/tr}</a> * } </td></tr> {/if} { * end upload file row * } *} diff --git a/templates/import_phpwiki.tpl b/templates/import_phpwiki.tpl index 7c32d85..62593ee 100644 --- a/templates/import_phpwiki.tpl +++ b/templates/import_phpwiki.tpl @@ -7,7 +7,7 @@ <div class="body"> -<form method="post" action="{$gBitLoc.WIKI_PKG_URL}admin/import_phpwiki.php"> +<form method="post" action="{$smarty.const.WIKI_PKG_URL}admin/import_phpwiki.php"> <table class="panel"> <tr> <td>{tr}Path to where the dumped files are (relative to tiki basedir with trailing slash ex: dump/):{/tr}</td> diff --git a/templates/list_books.tpl b/templates/list_books.tpl index 7ee0f3a..1fdf89e 100644 --- a/templates/list_books.tpl +++ b/templates/list_books.tpl @@ -18,29 +18,29 @@ <tr class="{cycle}"> <td> - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$channels[ix].structure_id}"> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$channels[ix].structure_id}"> {$channels[ix].title} </a> </td> <td class="actionicon"> {if ($channels[ix].creator_user_id == $gBitUser->mUserId) || $gBitUser->hasPermission( 'bit_p_admin_books' )} - <a href="{$gBitLoc.WIKI_PKG_URL}edit_book.php?structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="settings" iexplain="edit book"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="settings" iexplain="edit book"}</a> {/if} {* remove for now because it's broken, and I can't find reason to fix - spiderr - <a href="{$gBitLoc.WIKI_PKG_URL}edit_book.php?action=export&structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="export" iexplain="export pages"}</a> - <a href="{$gBitLoc.WIKI_PKG_URL}edit_book.php?action=export_tree&structure_id={$channels[ix].structure_id}">{biticon ipackage="wiki" iname="tree" iexplain="dump tree"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?action=export&structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="export" iexplain="export pages"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?action=export_tree&structure_id={$channels[ix].structure_id}">{biticon ipackage="wiki" iname="tree" iexplain="dump tree"}</a> *} {if $gBitUser->isAdmin()} {if $gBitSystem->isPackageActive( 'nexus' )} - <a href="{$gBitLoc.NEXUS_PKG_URL}menus.php?structure_id={$channels[ix].structure_id}&action=convert_structure">{biticon ipackage="liberty" iname="tree" iexplain="create menu from structure"}</a> + <a href="{$smarty.const.NEXUS_PKG_URL}menus.php?structure_id={$channels[ix].structure_id}&action=convert_structure">{biticon ipackage="liberty" iname="tree" iexplain="create menu from structure"}</a> {/if} - <a href="{$gBitLoc.WIKI_PKG_URL}create_webhelp.php?structure_id={$channels[ix].structure_id}">{biticon ipackage="wiki" iname="webhelp" iexplain="create webhelp"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}create_webhelp.php?structure_id={$channels[ix].structure_id}">{biticon ipackage="wiki" iname="webhelp" iexplain="create webhelp"}</a> {/if} {if $channels[ix].webhelp eq 'y'} - <a href="{$gBitLoc.BITHELP_PKG_URL}/{$channels[ix].title}/index.html">{biticon ipackage="wiki" iname="webhelp_toc" iexplain="view webhelp"}</a> + <a href="{$smarty.const.BITHELP_PKG_URL}/{$channels[ix].title}/index.html">{biticon ipackage="wiki" iname="webhelp_toc" iexplain="view webhelp"}</a> {/if} {if ($channels[ix].creator_user_id == $gBitUser->mUserId) || $gBitUser->hasPermission( 'bit_p_admin_books' )} - <a href="{$gBitLoc.WIKI_PKG_URL}edit_book.php?action=remove&structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?action=remove&structure_id={$channels[ix].structure_id}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> {/if} </td> </tr> diff --git a/templates/list_pages.tpl b/templates/list_pages.tpl index bca6738..4e3fc58 100644 --- a/templates/list_pages.tpl +++ b/templates/list_pages.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/list_pages.tpl,v 1.3 2005/07/25 20:02:59 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/list_pages.tpl,v 1.4 2005/08/07 17:46:51 squareing Exp $ *} <div class="floaticon">{bithelp}</div> <div class="admin wiki"> @@ -9,6 +9,8 @@ {formfeedback error=$errors} <div class="body"> + {minifind sort_mode=$sort_mode} + {form id="checkform"} {strip} <div class="navbar"> @@ -29,12 +31,10 @@ </ul> </div> - <div class="clear"></div> - <input type="hidden" name="offset" value="{$offset}" /> <input type="hidden" name="sort_mode" value="{$sort_mode}" /> - <table class="data"> + <table class="clear data"> <caption>{tr}WikiPages Listing{/tr} <span class="total">[ {$pagecount} ]</span></caption> <tr> {* at the moment, the only working option to use the checkboxes for is deleting pages. so for now the checkboxes are visible iff $bit_p_remove is set. Other applications make sense as well (categorize, convert to pdf, etc). Add necessary corresponding permission here: *} @@ -93,7 +93,7 @@ {if $gBitSystem->isFeatureActive( 'wiki_list_name' )} <h3><a href="{$listpages[changes].display_url}" title="{$listpages[changes].description}">{$listpages[changes].title}</a></h3> {else} - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$listpages[changes].page_id}" title="{$listpages[changes].page_id}">Page #{$listpages[changes].page_id}</a> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$listpages[changes].page_id}" title="{$listpages[changes].page_id}">Page #{$listpages[changes].page_id}</a> {/if} {if $gBitSystem->isFeatureActive( 'wiki_list_creator' )} {tr}Created by{/tr} {displayname real_name=$listpages[changes].creator_real_name user=$listpages[changes].creator_user} @@ -140,7 +140,7 @@ {/if} {if $gBitSystem->isFeatureActive( 'wiki_list_backlinks' )} {if $gBitSystem->isFeatureActive( 'feature_backlinks' ) && $listpages[changes].backlinks > 0} - <td style="text-align:center;"><a href="{$gBitLoc.WIKI_PKG_URL}backlinks.php?page={$listpages[changes].title|escape:"url"}">{$listpages[changes].backlinks|default:"0"}</a></td> + <td style="text-align:center;"><a href="{$smarty.const.WIKI_PKG_URL}backlinks.php?page={$listpages[changes].title|escape:"url"}">{$listpages[changes].backlinks|default:"0"}</a></td> {else} <td style="text-align:center;">{$listpages[changes].backlinks|default:"0"}</td> {/if} @@ -153,7 +153,7 @@ {/if} {if $gBitUser->hasPermission( 'bit_p_edit' )} <td class="actionicon"> - <a href="{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$listpages[changes].page_id}">{biticon ipackage="liberty" iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$listpages[changes].page_id}">{biticon ipackage="liberty" iname="edit" iexplain="edit"}</a> {if $checkboxes_on eq 'y'} <input type="checkbox" name="checked[]" value="{$listpages[changes].page_id}" /> {/if} @@ -201,6 +201,5 @@ {/form} {pagination} - {minifind sort_mode=$sort_mode} </div><!-- end .body --> </div><!-- end .wiki --> diff --git a/templates/menu_wiki.tpl b/templates/menu_wiki.tpl index 2b46547..5a4b31d 100644 --- a/templates/menu_wiki.tpl +++ b/templates/menu_wiki.tpl @@ -1,40 +1,40 @@ {strip} <ul> {if $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}index.php">{biticon ipackage=liberty iname=home iexplain="Wiki Home" iforce="icon"} {tr}Wiki Home{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}index.php">{biticon ipackage=liberty iname=home iexplain="Wiki Home" iforce="icon"} {tr}Wiki Home{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_listPages' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}list_pages.php">{biticon ipackage=liberty iname=list iexplain="List pages" iforce="icon"} {tr}List pages{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}list_pages.php">{biticon ipackage=liberty iname=list iexplain="List pages" iforce="icon"} {tr}List pages{/tr}</a></li> {/if} {if $gBitUser->hasPermission( 'bit_p_edit' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}edit.php">{biticon ipackage=liberty iname=new iexplain="Create page" iforce="icon"} {tr}Create page{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}edit.php">{biticon ipackage=liberty iname=new iexplain="Create page" iforce="icon"} {tr}Create page{/tr}</a></li> {/if} {if $gBitUser->hasPermission( 'bit_p_view' ) and $gBitSystem->isFeatureActive( 'feature_wiki_books' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}books.php">{biticon ipackage=wiki iname=book iexplain="Wiki Books" iforce="icon"} {tr}Wiki Books{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}books.php">{biticon ipackage=wiki iname=book iexplain="Wiki Books" iforce="icon"} {tr}Wiki Books{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_wiki_books' ) && $gBitUser->hasPermission( 'bit_p_edit_books' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}edit_book.php">{biticon ipackage=liberty iname=new iexplain="Create a new book" iforce="icon"} {tr}Create book{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}edit_book.php">{biticon ipackage=liberty iname=new iexplain="Create a new book" iforce="icon"} {tr}Create book{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_listPages' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}orphan_pages.php">{biticon ipackage=liberty iname=spacer iexplain="Orphan pages" iforce="icon"} {tr}Orphan pages{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}orphan_pages.php">{biticon ipackage=liberty iname=spacer iexplain="Orphan pages" iforce="icon"} {tr}Orphan pages{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_wiki_multiprint' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}print_pages.php">{biticon ipackage=liberty iname=print iexplain="Print" iforce="icon"} {tr}Print{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}print_pages.php">{biticon ipackage=liberty iname=print iexplain="Print" iforce="icon"} {tr}Print{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_wiki_rankings' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}rankings.php">{biticon ipackage=liberty iname=list iexplain="Wiki Rankings" iforce="icon"} {tr}Wiki Rankings{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}rankings.php">{biticon ipackage=liberty iname=list iexplain="Wiki Rankings" iforce="icon"} {tr}Wiki Rankings{/tr}</a></li> {/if} {if $gBitUser->hasPermission( 'bit_p_send_pages' ) and $gBitSystem->isFeatureActive( 'feature_comm' )} - <li><a class="item" href="{$gBitLoc.XMLRPC_PKG_URL}send_objects.php">{biticon ipackage=liberty iname=spacer iexplain="Send pages" iforce="icon"} {tr}Send pages{/tr}</a></li> + <li><a class="item" href="{$smarty.const.XMLRPC_PKG_URL}send_objects.php">{biticon ipackage=liberty iname=spacer iexplain="Send pages" iforce="icon"} {tr}Send pages{/tr}</a></li> {/if} {if $gBitUser->hasPermission( 'bit_p_admin_received_pages' ) and $gBitSystem->isFeatureActive( 'feature_comm' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}received_pages.php">{biticon ipackage=liberty iname=spacer iexplain="Recieved pages" iforce="icon"} {tr}Received pages{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}received_pages.php">{biticon ipackage=liberty iname=spacer iexplain="Recieved pages" iforce="icon"} {tr}Received pages{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_dump' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.STORAGE_PKG_URL}dump/{$bitdomain}new.tar">{biticon ipackage=liberty iname=save iexplain="Backup" iforce="icon"} {tr}Backup{/tr}</a></li> + <li><a class="item" href="{$smarty.const.STORAGE_PKG_URL}dump/{$bitdomain}new.tar">{biticon ipackage=liberty iname=save iexplain="Backup" iforce="icon"} {tr}Backup{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_sandbox' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.WIKI_PKG_URL}edit.php?page=SandBox">{biticon ipackage=liberty iname=spacer iexplain="Sandbox" iforce="icon"} {tr}Sandbox{/tr}</a></li> + <li><a class="item" href="{$smarty.const.WIKI_PKG_URL}edit.php?page=SandBox">{biticon ipackage=liberty iname=spacer iexplain="Sandbox" iforce="icon"} {tr}Sandbox{/tr}</a></li> {/if} </ul> {/strip} diff --git a/templates/menu_wiki_admin.tpl b/templates/menu_wiki_admin.tpl index 8ff4679..29e41a3 100644 --- a/templates/menu_wiki_admin.tpl +++ b/templates/menu_wiki_admin.tpl @@ -1,8 +1,8 @@ {strip} <ul> - <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=wiki">{tr}Wiki Settings{/tr}</a></li> + <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=wiki">{tr}Wiki Settings{/tr}</a></li> {if $gBitSystem->isFeatureActive( 'feature_dump' ) and $gBitUser->hasPermission( 'bit_p_view' )} - <li><a class="item" href="{$gBitLoc.STORAGE_PKG_URL}dump/{$bitdomain}new.tar">{tr}Backup{/tr}</a></li> + <li><a class="item" href="{$smarty.const.STORAGE_PKG_URL}dump/{$bitdomain}new.tar">{tr}Backup{/tr}</a></li> {/if} </ul> {/strip} diff --git a/templates/page.tpl b/templates/page.tpl index 3beb949..d354378 100644 --- a/templates/page.tpl +++ b/templates/page.tpl @@ -1,11 +1,11 @@ {if $type eq 'd'} - <iframe width="0" height="0" border="0" src="{$gBitLoc.WIKI_PKG_URL}page_loader.php?refresh={$refresh}&title={$title|escape:"url"}">Browser not supported</iframe> + <iframe width="0" height="0" border="0" src="{$smarty.const.WIKI_PKG_URL}page_loader.php?refresh={$refresh}&title={$title|escape:"url"}">Browser not supported</iframe> {/if} {$parsed} {if $gBitUser->hasPermission( 'bit_p_edit_html_pages' )} - <a href="{$gBitLoc.HTML_PKG_URL}admin/admin_html_pages.php?title={$title|escape:"url"}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.HTML_PKG_URL}admin/admin_html_pages.php?title={$title|escape:"url"}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> {if $type eq 'd'} - <a href="{$gBitLoc.HTML_PKG_URL}admin/admin_html_page_content.php?title={$title|escape:"url"}">content</a> + <a href="{$smarty.const.HTML_PKG_URL}admin/admin_html_page_content.php?title={$title|escape:"url"}">content</a> {/if} {/if} diff --git a/templates/page_action_bar.tpl b/templates/page_action_bar.tpl index 7232b28..bb30f0d 100644 --- a/templates/page_action_bar.tpl +++ b/templates/page_action_bar.tpl @@ -7,10 +7,10 @@ {if $gLibertySystem->mPlugins.$format_guid.is_active eq 'y'} {if $gBitUser->hasPermission( 'bit_p_edit' ) or $page eq 'SandBox'} {if $beingEdited eq 'y'} - {*popup_init src="`$gBitLoc.THEMES_PKG_URL`js/overlib.js"*} - <li><strong><a href="{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}" {popup text="$semUser"}>{tr}Edit{/tr}</a></strong></li> + {*popup_init src="`$smarty.const.THEMES_PKG_URL`js/overlib.js"*} + <li><strong><a href="{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}" {popup text="$semUser"}>{tr}Edit{/tr}</a></strong></li> {else} - <li><a href="{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}">{tr}Edit{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}">{tr}Edit{/tr}</a></li> {/if} {/if} {/if} @@ -18,36 +18,36 @@ {if $page ne 'SandBox'} {if $gBitUser->hasPermission( 'bit_p_admin_wiki' ) or ($gBitUser->mUserId and ($gBitUser->mUserId eq $pageInfo.modifier_user_id) and ($gBitUser->hasPermission( 'bit_p_lock' )) and ($gBitSystem->isFeatureActive( 'feature_wiki_usrlock' )))} {if $lock} - <li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&action=unlock">{tr}Unlock{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&action=unlock">{tr}Unlock{/tr}</a></li> {else} - <li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&action=lock">{tr}Lock{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&action=lock">{tr}Lock{/tr}</a></li> {/if} {/if} {if $gBitUser->hasPermission( 'bit_p_admin_wiki' )} - <li><a href="{$gBitLoc.WIKI_PKG_URL}page_permissions.php?page_id={$pageInfo.page_id}">{tr}Permissions{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}page_permissions.php?page_id={$pageInfo.page_id}">{tr}Permissions{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_history' )} - <li><a href="{$gBitLoc.WIKI_PKG_URL}page_history.php?page_id={$pageInfo.page_id}">{tr}History{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}page_history.php?page_id={$pageInfo.page_id}">{tr}History{/tr}</a></li> {/if} {/if} {if $gBitSystem->isFeatureActive( 'feature_likePages' )} - <li><a href="{$gBitLoc.WIKI_PKG_URL}like_pages.php?page_id={$pageInfo.page_id}">{tr}Similar{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}like_pages.php?page_id={$pageInfo.page_id}">{tr}Similar{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_wiki_undo' ) and $canundo eq 'y'} - <li><a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&undo=1">{tr}Undo{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&undo=1">{tr}Undo{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'wiki_uses_slides' )} {if $show_slideshow eq 'y'} - <li><a href="{$gBitLoc.WIKI_PKG_URL}slideshow.php?page_id={$pageInfo.page_id}">{tr}Slides{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}slideshow.php?page_id={$pageInfo.page_id}">{tr}Slides{/tr}</a></li> {elseif $structure eq 'y'} <li><a href="slideshow2.php?structure_id={$page_info.structure_id}">{tr}Slides{/tr}</a></li> {/if} {/if} {if $gBitUser->hasPermission( 'bit_p_admin_wiki' )} - <li><a href="{$gBitLoc.WIKI_PKG_URL}export_wiki_pages.php?page_id={$pageInfo.page_id}">{tr}Export{/tr}</a></li> + <li><a href="{$smarty.const.WIKI_PKG_URL}export_wiki_pages.php?page_id={$pageInfo.page_id}">{tr}Export{/tr}</a></li> {/if} {if $gBitSystem->isFeatureActive( 'feature_wiki_discuss' )} - <li><a href="{$gBitLoc.BITFORUMS_PKG_URL}view_forum.php?forum_id={$wiki_forum_id}&comments_postComment=post&comments_title={$page|escape:"url"}&comments_data={ "Use this thread to discuss the [index.php\?page=$page|$page page."|escape:"url"}&comment_topictype=n">{tr}Discuss{/tr}</a></li> + <li><a href="{$smarty.const.BITFORUMS_PKG_URL}view_forum.php?forum_id={$wiki_forum_id}&comments_postComment=post&comments_title={$page|escape:"url"}&comments_data={ "Use this thread to discuss the [index.php\?page=$page|$page page."|escape:"url"}&comment_topictype=n">{tr}Discuss{/tr}</a></li> {/if} {/if} </ul> diff --git a/templates/page_date_bar.tpl b/templates/page_date_bar.tpl index 1c24fe8..2795f6c 100644 --- a/templates/page_date_bar.tpl +++ b/templates/page_date_bar.tpl @@ -1,3 +1,3 @@ <div class="date"> - {tr}Created by{/tr} {displayname user=$pageInfo.creator_user user_id=$pageInfo.creator_user_id real_name=$pageInfo.creator_real_name}, {tr}Last modification by{/tr} {displayname user=$pageInfo.modifier_user user_id=$pageInfo.modifier_user_id real_name=$pageInfo.modifier_real_name} on {$pageInfo.last_modified|bit_short_datetime} + {tr}Created by {displayname user=$pageInfo.creator_user user_id=$pageInfo.creator_user_id real_name=$pageInfo.creator_real_name}, Last modification by {displayname user=$pageInfo.modifier_user user_id=$pageInfo.modifier_user_id real_name=$pageInfo.modifier_real_name} on {$pageInfo.last_modified|bit_short_datetime}{/tr} </div> diff --git a/templates/page_display.tpl b/templates/page_display.tpl index 785f3ae..7b5958a 100644 --- a/templates/page_display.tpl +++ b/templates/page_display.tpl @@ -1,5 +1,5 @@ {strip} -<div class="body"{if $user_dbl eq 'y' and $dblclickedit eq 'y' and $gBitUser->hasPermission( 'bit_p_edit' )} ondblclick="location.href='{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}';"{/if}> +<div class="body"{if $user_dbl eq 'y' and $dblclickedit eq 'y' and $gBitUser->hasPermission( 'bit_p_edit' )} ondblclick="location.href='{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}';"{/if}> <div class="content"> {if $gBitSystem->isFeatureActive( 'liberty_auto_display_attachment_thumbs' )} {include file="bitpackage:liberty/storage_thumbs.tpl"} diff --git a/templates/page_icons.tpl b/templates/page_icons.tpl index f5587b8..a7bd839 100644 --- a/templates/page_icons.tpl +++ b/templates/page_icons.tpl @@ -5,7 +5,7 @@ <select name="page" onchange="go(this)"> <option value="">{tr}Wiki Books{/tr}...</option> {section name=struct loop=$showstructs} - <option value="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$showstructs[struct].structure_id}"> + <option value="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$showstructs[struct].structure_id}"> {$showstructs[struct].root_title} </option> {/section} @@ -18,7 +18,7 @@ {assign var=format_guid value=$pageInfo.format_guid} {if $gLibertySystem->mPlugins.$format_guid.is_active eq 'y'} {if $gBitUser->hasPermission( 'bit_p_edit' ) or $page eq 'SandBox'} - <a href="{$gBitLoc.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}" {if $beingEdited eq 'y'}{*popup_init src="`$gBitLoc.THEMES_PKG_URL`js/overlib.js"*}{popup text="$semUser" width="-1"}{/if}>{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit.php?page_id={$pageInfo.page_id}" {if $beingEdited eq 'y'}{*popup_init src="`$smarty.const.THEMES_PKG_URL`js/overlib.js"*}{popup text="$semUser" width="-1"}{/if}>{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> {/if} {/if} {/if} @@ -26,51 +26,51 @@ {if $gBitSystem->isPackageActive( 'stickies' ) && $gBitUser->hasPermission('bit_p_stickies_edit') } {if ($structureInfo.structure_id)}{assign var='stickyRequest' value="structure_id=`$structureInfo.structure_id`"} {else}{assign var='stickyRequest' value="notated_content_id=`$pageInfo.content_id`"}{/if} - <a href="{$gBitLoc.STICKIES_PKG_URL}edit.php?{$stickyRequest}">{biticon ipackage=stickies iname="sticky_note" iexplain="add sticky note"}</a> + <a href="{$smarty.const.STICKIES_PKG_URL}edit.php?{$stickyRequest}">{biticon ipackage=stickies iname="sticky_note" iexplain="add sticky note"}</a> {/if} {if ($structureInfo.structure_id) && (($gStructure->mInfo.creator_user_id == $gBitUser->mUserId) || $gBitUser->hasPermission( 'bit_p_admin_books' )) } - <a href="{$gBitLoc.WIKI_PKG_URL}edit_book.php?structure_id={$structureInfo.structure_id}">{biticon ipackage=liberty iname="settings" iexplain="edit book"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?structure_id={$structureInfo.structure_id}">{biticon ipackage=liberty iname="settings" iexplain="edit book"}</a> {/if} {if $gBitSystem->isFeatureActive( 'wiki_uses_s5' )} - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&s5=1" onclick="return confirm('this works best in gecko based browsers (mozilla, firefox) or opera (press F11)')">{biticon ipackage=wiki iname="s5" iexplain="s5 slideshow"}</a> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&s5=1" onclick="return confirm('this works best in gecko based browsers (mozilla, firefox) or opera (press F11)')">{biticon ipackage=wiki iname="s5" iexplain="s5 slideshow"}</a> {/if} {if $cached_page eq 'y'} - <a title="{tr}refresh{/tr}" href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&refresh=1">{biticon ipackage=liberty iname="refresh" iexplain="refresh"}</a> + <a title="{tr}refresh{/tr}" href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&refresh=1">{biticon ipackage=liberty iname="refresh" iexplain="refresh"}</a> {/if} {if $gBitUser->hasPermission( 'bit_p_print' )} - <a title="{tr}print{/tr}" style="display:none;" href="{$gBitLoc.WIKI_PKG_URL}print.php?{if $structureInfo.root_structure_id}structure_id={$structureInfo.root_structure_id}{else}page_id={$pageInfo.page_id}{/if}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> + <a title="{tr}print{/tr}" style="display:none;" href="{$smarty.const.WIKI_PKG_URL}print.php?{if $structureInfo.root_structure_id}structure_id={$structureInfo.root_structure_id}{else}page_id={$pageInfo.page_id}{/if}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> {/if} {if $gBitSystem->isPackageActive( 'pdf' ) && $gContent->hasUserPermission( 'bit_p_pdf_generation' )} {if $structureInfo.root_structure_id} - <a title="{tr}create PDF{/tr}" href="{$gBitLoc.PDF_PKG_URL}?structure_id={$structureInfo.root_structure_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> + <a title="{tr}create PDF{/tr}" href="{$smarty.const.PDF_PKG_URL}?structure_id={$structureInfo.root_structure_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> {else} - <a title="{tr}create PDF{/tr}" href="{$gBitLoc.PDF_PKG_URL}?content_id={$pageInfo.content_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> + <a title="{tr}create PDF{/tr}" href="{$smarty.const.PDF_PKG_URL}?content_id={$pageInfo.content_id}">{biticon ipackage="pdf" iname="pdf" iexplain="PDF"}</a> {/if} {/if} {if $user and $gBitSystem->isPackageActive( 'notepad' ) and $gBitUser->hasPermission( 'bit_p_notepad' )} - <a title="{tr}Save{/tr}" href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&savenotepad=1">{biticon ipackage="wiki" iname="save" iexplain="save"}</a> + <a title="{tr}Save{/tr}" href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&savenotepad=1">{biticon ipackage="wiki" iname="save" iexplain="save"}</a> {/if} {if $gBitUser->isRegistered() and $gBitUser->mUserId && $gBitSystem->isFeatureActive( 'feature_user_watches' ) } {if $user_watching_page eq 'y'} - <a title="{tr}stop monitoring this page{/tr}" href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&watch_event=wiki_page_changed&watch_object={$pageInfo.page_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring"}</a> + <a title="{tr}stop monitoring this page{/tr}" href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&watch_event=wiki_page_changed&watch_object={$pageInfo.page_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring"}</a> {else} - <a title="{tr}monitor this page{/tr}" href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&watch_event=wiki_page_changed&watch_object={$pageInfo.page_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor"}</a> + <a title="{tr}monitor this page{/tr}" href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}&watch_event=wiki_page_changed&watch_object={$pageInfo.page_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor"}</a> {/if} {/if} {if $pageInfo.title ne 'SandBox'} {if $gBitUser->hasPermission( 'bit_p_remove' )} - <a title="{tr}remove this page{/tr}" href="{$gBitLoc.WIKI_PKG_URL}remove_page.php?page_id={$pageInfo.page_id}&version=last">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + <a title="{tr}remove this page{/tr}" href="{$smarty.const.WIKI_PKG_URL}remove_page.php?page_id={$pageInfo.page_id}&version=last">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> {/if} {/if} {if $gBitSystem->isFeatureActive( 'feature_backlinks' ) and $backlinks} <select name="page" onchange="go(this)"> - <option value="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}">{tr}backlinks{/tr}...</option> + <option value="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$pageInfo.page_id}">{tr}backlinks{/tr}...</option> {foreach key=contentId item=backPage from=$backlinks} - <option value="{$gBitLoc.BIT_ROOT_URL}index.php?content_id={$contentId}">{$backPage|truncate:30:"...":true}</option> + <option value="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$contentId}">{$backPage|truncate:30:"...":true}</option> {/foreach} </select> {/if} diff --git a/templates/page_permissions.tpl b/templates/page_permissions.tpl index 278aba2..32396a7 100644 --- a/templates/page_permissions.tpl +++ b/templates/page_permissions.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/page_permissions.tpl,v 1.1 2005/06/19 06:12:45 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/page_permissions.tpl,v 1.2 2005/08/07 17:46:51 squareing Exp $ *} {strip} <div class="floaticon">{bithelp}</div> @@ -53,7 +53,7 @@ <tr class="{cycle values="even,odd"}"> <td>{$page_perms[pg].group_name}</td> <td>{$page_perms[pg].perm_name}</td> - <td class="actionicon"><a href="{$gBitLoc.WIKI_PKG_URL}page_permissions.php?action=remove&content_id={$gContent->mContentId}&object_type={$gContent->mInfo.content_type_guid}&perm={$page_perms[pg].perm_name}&group_id={$page_perms[pg].group_id}">{biticon ipackage=liberty iname="delete" iexplain="remove from this page"}</a></td> + <td class="actionicon"><a href="{$smarty.const.WIKI_PKG_URL}page_permissions.php?action=remove&content_id={$gContent->mContentId}&object_type={$gContent->mInfo.content_type_guid}&perm={$page_perms[pg].perm_name}&group_id={$page_perms[pg].group_id}">{biticon ipackage=liberty iname="delete" iexplain="remove from this page"}</a></td> </tr> {sectionelse} <tr class="norecords"> @@ -88,7 +88,7 @@ <h2>{tr}Existing requests for email notification{/tr}</h2> <ul> {section name=ix loop=$emails} - <li>{$emails[ix]} <a href="{$gBitLoc.WIKI_PKG_URL}page_permissions.php?page_id={$pageInfo.page_id}&removeemail={$emails[ix]}&tab=email">{biticon ipackage=liberty iname="delete_small" iexplain="delete"}</a></li> + <li>{$emails[ix]} <a href="{$smarty.const.WIKI_PKG_URL}page_permissions.php?page_id={$pageInfo.page_id}&removeemail={$emails[ix]}&tab=email">{biticon ipackage=liberty iname="delete_small" iexplain="delete"}</a></li> {/section} </ul> {/if} diff --git a/templates/page_select.tpl b/templates/page_select.tpl index d93153a..098da99 100644 --- a/templates/page_select.tpl +++ b/templates/page_select.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/page_select.tpl,v 1.1 2005/06/19 06:12:45 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/page_select.tpl,v 1.2 2005/08/07 17:46:51 squareing Exp $ *} <div class="header"> <h1>Multiple pages match "{$choose}"</h1> @@ -7,7 +7,7 @@ <ul class="data"> {foreach name=loc key=key item=item from=$dupePages} <li class="item {cycle values='even,odd'}"> - <h3><a href="{$gBitLoc.WIKI_PKG_URL}index.php?page_id={$item.page_id}">{$item.title}</a></h3> + <h3><a href="{$smarty.const.WIKI_PKG_URL}index.php?page_id={$item.page_id}">{$item.title}</a></h3> {if $item.description}{$item.description}<br/>{/if} {tr}Last Modified{/tr}: {$item.last_modified|bit_long_datetime} </li> diff --git a/templates/print_pages.tpl b/templates/print_pages.tpl index 926decf..2995747 100644 --- a/templates/print_pages.tpl +++ b/templates/print_pages.tpl @@ -59,7 +59,7 @@ <div class="other box"> <div class="boxtitle">{tr}Filter{/tr}</div> <div class="boxcontent"> - <form action="{$gBitLoc.WIKI_PKG_URL}print_pages.php" method="post"> + <form action="{$smarty.const.WIKI_PKG_URL}print_pages.php" method="post"> <input type="hidden" name="sendarticles" value="{$form_sendarticles|escape}" /> <input type="hidden" name="printpages" value="{$form_printpages|escape}" /> {tr}Filter{/tr}: <input type="text" name="find" value="{$find|escape}" /> <input type="submit" name="filter" value="{tr}filter{/tr}" /><br /> @@ -70,7 +70,7 @@ <div class="other box"> <div class="boxtitle">{tr}Print Wiki Pages{/tr}</div> <div class="boxcontent"> - <form action="{$gBitLoc.WIKI_PKG_URL}print_pages.php" method="post"> + <form action="{$smarty.const.WIKI_PKG_URL}print_pages.php" method="post"> <input type="hidden" name="printpages" value="{$form_printpages|escape}" /> <input type="hidden" name="find" value="{$find|escape}" /> <select name="title"> @@ -93,7 +93,7 @@ </div> <div class="boxcontent"> - <form method="post" action="{$gBitLoc.WIKI_PKG_URL}print_multi_pages.php"> + <form method="post" action="{$smarty.const.WIKI_PKG_URL}print_multi_pages.php"> <input type="hidden" name="printpages" value="{$form_printpages|escape}" /> <input type="submit" name="print" value="{tr}print{/tr}" /> </form> diff --git a/templates/received_pages.tpl b/templates/received_pages.tpl index 228d85e..814cca4 100644 --- a/templates/received_pages.tpl +++ b/templates/received_pages.tpl @@ -13,7 +13,7 @@ {/if} {if $received_page_id > 0} <h2>{tr}Edit received page{/tr}</h2> -<form action="{$gBitLoc.WIKI_PKG_URL}received_pages.php" method="post"> +<form action="{$smarty.const.WIKI_PKG_URL}received_pages.php" method="post"> <input type="hidden" name="received_page_id" value="{$received_page_id|escape}" /> <table class="panel"> <tr><td> @@ -36,7 +36,7 @@ <table class="find"> <tr><td>{tr}Find{/tr}</td> <td> - <form method="get" action="{$gBitLoc.WIKI_PKG_URL}received_pages.php"> + <form method="get" action="{$smarty.const.WIKI_PKG_URL}received_pages.php"> <input type="text" name="find" /> <input type="submit" name="search" value="{tr}find{/tr}" /> <input type="hidden" name="sort_mode" value="{$sort_mode|escape}" /> @@ -47,11 +47,11 @@ <table class="data"> <tr> -<th><a href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_page_id_desc'}received_page_id_asc{else}received_page_id_desc{/if}">{tr}ID{/tr}</a></th> -<th><a href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'title_desc'}title_asc{else}title_desc{/if}">{tr}name{/tr}</a></th> -<th><a href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_date_desc'}received_date_asc{else}received_date_desc{/if}">{tr}Date{/tr}</a></th> -<th><a href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_from_site_desc'}received_from_site_asc{else}received_from_site_desc{/if}">{tr}Site{/tr}</a></th> -<th><a href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_from_user_desc'}received_from_user_asc{else}received_from_user_desc{/if}">{tr}User{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_page_id_desc'}received_page_id_asc{else}received_page_id_desc{/if}">{tr}ID{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'title_desc'}title_asc{else}title_desc{/if}">{tr}name{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_date_desc'}received_date_asc{else}received_date_desc{/if}">{tr}Date{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_from_site_desc'}received_from_site_asc{else}received_from_site_desc{/if}">{tr}Site{/tr}</a></th> +<th><a href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={if $sort_mode eq 'received_from_user_desc'}received_from_user_asc{else}received_from_user_desc{/if}">{tr}User{/tr}</a></th> <th>{tr}action{/tr}</th> </tr> {cycle values="even,odd" print=false} @@ -67,10 +67,10 @@ <td>{$channels[user].received_from_site}</td> <td>{$channels[user].received_from_user}</td> <td> - <a title="{tr}edit{/tr}" href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&received_page_id={$channels[user].received_page_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> - <a title="{tr}view{/tr}" href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&view={$channels[user].received_page_id}">{biticon ipackage=liberty iname="view" iexplain="view"}</a> - <a title="{tr}accept{/tr}" href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&accept={$channels[user].received_page_id}">{biticon ipackage=liberty iname="accept" iexplain="accept"}</a> - <a title="{tr}remove{/tr}" href="{$gBitLoc.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].received_page_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + <a title="{tr}edit{/tr}" href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&received_page_id={$channels[user].received_page_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a title="{tr}view{/tr}" href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&view={$channels[user].received_page_id}">{biticon ipackage=liberty iname="view" iexplain="view"}</a> + <a title="{tr}accept{/tr}" href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&accept={$channels[user].received_page_id}">{biticon ipackage=liberty iname="accept" iexplain="accept"}</a> + <a title="{tr}remove{/tr}" href="{$smarty.const.WIKI_PKG_URL}received_pages.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].received_page_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> </td> </tr> {sectionelse} diff --git a/templates/rename_page.tpl b/templates/rename_page.tpl index 8183ec6..dd2a216 100644 --- a/templates/rename_page.tpl +++ b/templates/rename_page.tpl @@ -4,7 +4,7 @@ </div> <div class="body"> -<form action="{$gBitLoc.WIKI_PKG_URL}rename_page.php" method="post"> +<form action="{$smarty.const.WIKI_PKG_URL}rename_page.php" method="post"> <input type="hidden" name="oldpage" value="{$page|escape}" /> <input type="hidden" name="page" value="{$page|escape}" /> <table class="panel"> diff --git a/templates/rollback.tpl b/templates/rollback.tpl index 801a447..fcf41a3 100644 --- a/templates/rollback.tpl +++ b/templates/rollback.tpl @@ -1,7 +1,7 @@ <h2>{tr}Rollback page{/tr}: {$pageInfo.title} {tr}to_version{/tr}: {$version}</h2> <div class="wikibody">{$preview.data}</div> <div align="center"> -<form action="{$gBitLoc.WIKI_PKG_URL}rollback.php" method="post"> +<form action="{$smarty.const.WIKI_PKG_URL}rollback.php" method="post"> <input type="hidden" name="page_id" value="{$pageInfo.page_id}" /> <input type="hidden" name="version" value="{$version|escape}" /> <input type="submit" name="rollback" value="{tr}rollback{/tr}" /> diff --git a/templates/s5.tpl b/templates/s5.tpl index d1f62ae..61bc60f 100644 --- a/templates/s5.tpl +++ b/templates/s5.tpl @@ -9,10 +9,10 @@ <meta name="presdate" content="20041007" /> <meta name="author" content="{displayname user_id=`$gContent->mInfo.user_id` nolink='yes'}" /> <meta name="company" content="" /> - <link rel="stylesheet" href="{$gBitLoc.THEMES_PKG_URL}s5/i18n/slides.css" type="text/css" media="projection" id="slideProj" /> - <link rel="stylesheet" href="{$gBitLoc.THEMES_PKG_URL}s5/i18n/print.css" type="text/css" media="print" id="slidePrint" /> - <link rel="stylesheet" href="{$gBitLoc.THEMES_PKG_URL}s5/opera.css" type="text/css" media="projection" id="operaFix" /> - <script src="{$gBitLoc.THEMES_PKG_URL}s5/slides.js" type="text/javascript"></script> + <link rel="stylesheet" href="{$smarty.const.THEMES_PKG_URL}s5/i18n/slides.css" type="text/css" media="projection" id="slideProj" /> + <link rel="stylesheet" href="{$smarty.const.THEMES_PKG_URL}s5/i18n/print.css" type="text/css" media="print" id="slidePrint" /> + <link rel="stylesheet" href="{$smarty.const.THEMES_PKG_URL}s5/opera.css" type="text/css" media="projection" id="operaFix" /> + <script src="{$smarty.const.THEMES_PKG_URL}s5/slides.js" type="text/javascript"></script> </head> <body> <div class="layout"> diff --git a/templates/show_page.tpl b/templates/show_page.tpl index 4d46e11..f6486fa 100644 --- a/templates/show_page.tpl +++ b/templates/show_page.tpl @@ -42,7 +42,7 @@ {tr}The content on this page is licensed under the terms of the{/tr} <a href="{$wikiLicensePage}"><b>{tr}{$wikiSubmitNotice}{/tr}</b></a>. {/if} {if $gBitUser->hasPermission( 'bit_p_edit_copyrights' )} - <br />{tr}To edit the copyright notices{/tr} <a href="{$gBitSystem.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}">{tr}click here{/tr}</a>. + <br />{tr}To edit the copyright notices{/tr} <a href="{$smarty.const.WIKI_PKG_URL}copyrights.php?page_id={$pageInfo.page_id}">{tr}click here{/tr}</a>. {/if} </p> {/if} @@ -50,17 +50,16 @@ {if $print_page ne 'y'} {include file="bitpackage:wiki/page_action_bar.tpl"} {/if} - - {if $gBitSystem->isPackageActive( 'pigeonholes' )} - {include file="bitpackage:pigeonholes/display_members.tpl"} - {/if} - - {if $gBitSystem->isPackageActive( 'categories' )} - {include file="bitpackage:categories/categories_objects.tpl"} - {/if} </div><!-- end .wiki --> {if $comments_at_top_of_page ne 'y' and $print_page ne 'y' and $feature_wiki_comments eq 'y' } {include file="bitpackage:liberty/comments.tpl"} {/if} +{if $gBitSystem->isPackageActive( 'pigeonholes' )} + {include file="bitpackage:pigeonholes/display_members.tpl"} +{/if} + +{if $gBitSystem->isPackageActive( 'categories' )} + {include file="bitpackage:categories/categories_objects.tpl"} +{/if} diff --git a/templates/slideshow.tpl b/templates/slideshow.tpl index fdc006a..55a44f0 100644 --- a/templates/slideshow.tpl +++ b/templates/slideshow.tpl @@ -5,9 +5,9 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> <!-- - @import url({$gBitLoc.THEMES_PKG_URL}base.css); - @import url({$gBitLoc.THEMES_PKG_URL}styles/{$slide_style}/{$slide_style}.css); - @import url({$gBitLoc.THEMES_PKG_URL}styles/{$slide_style}/slideshow.css); + @import url({$smarty.const.THEMES_PKG_URL}base.css); + @import url({$smarty.const.THEMES_PKG_URL}styles/{$slide_style}/{$slide_style}.css); + @import url({$smarty.const.THEMES_PKG_URL}styles/{$slide_style}/slideshow.css); --> </style> <title>{$page_info.pageName}</title> @@ -29,18 +29,18 @@ <tr class="navigation"> {if $structure eq 'y'} <td width="33%" align="left"> - <a href="{$gBitLoc.WIKI_PKG_URL}slideshow2.php?structure_id={$prev_info.structure_id}">{$prev_info.pageName}</a> + <a href="{$smarty.const.WIKI_PKG_URL}slideshow2.php?structure_id={$prev_info.structure_id}">{$prev_info.pageName}</a> </td> <td width="34%" align="center"> - <a href="{$gBitLoc.WIKI_PKG_URL}slideshow2.php?structure_id={$home_info.structure_id}">{$home_info.pageName}</a> + <a href="{$smarty.const.WIKI_PKG_URL}slideshow2.php?structure_id={$home_info.structure_id}">{$home_info.pageName}</a> </td> <td width="33%" align="right"> - <a href="{$gBitLoc.WIKI_PKG_URL}slideshow2.php?structure_id={$next_info.structure_id}">{$next_info.pageName}</a> + <a href="{$smarty.const.WIKI_PKG_URL}slideshow2.php?structure_id={$next_info.structure_id}">{$next_info.pageName}</a> </td> {else} <td width="33%" align="left"> {if $slide_prev_title} - <a href="{$gBitLoc.WIKI_PKG_URL}slideshow.php?page={$page}&slide={$prev_slide}">{$slide_prev_title}</a> + <a href="{$smarty.const.WIKI_PKG_URL}slideshow.php?page={$page}&slide={$prev_slide}">{$slide_prev_title}</a> {else} {/if} @@ -50,9 +50,9 @@ </td> <td width="33%" align="right"> {if $slide_next_title} - <a href="{$gBitLoc.WIKI_PKG_URL}slideshow.php?page={$page}&slide={$next_slide}">{$slide_next_title}</a> + <a href="{$smarty.const.WIKI_PKG_URL}slideshow.php?page={$page}&slide={$next_slide}">{$slide_next_title}</a> {else} - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?page={$page_info.pageName}" title="{tr}back to{/tr} {$page_info.pageName}">{$page_info.pageName}</a> + <a href="{$smarty.const.WIKI_PKG_URL}index.php?page={$page_info.pageName}" title="{tr}back to{/tr} {$page_info.pageName}">{$page_info.pageName}</a> {/if} </td> {/if} diff --git a/templates/user_watch_wiki_page_changed.tpl b/templates/user_watch_wiki_page_changed.tpl index dab62bd..59db5f1 100644 --- a/templates/user_watch_wiki_page_changed.tpl +++ b/templates/user_watch_wiki_page_changed.tpl @@ -1,12 +1,24 @@ -{tr}The page {$mail_page} was changed by {$mail_user} at {$mail_date|bit_short_datetime}{/tr} -{tr}You can edit the page following this link:{/tr} -{$mail_machine}?page={$mail_page|escape:"url"} +{tr}The page {$mail_page} was changed at {$mail_date|bit_short_datetime}{/tr} by {$mail_user} + +{tr}You can view the page by following this link: + {$mail_machine}{$smarty.const.WIKI_PKG_URL}index.php?page={$mail_page|escape:"url"}{/tr} + + +{tr}You can edit the page by following this link: + {$mail_machine}{$smarty.const.WIKI_PKG_URL}edit.php?page={$mail_page|escape:"url"}{/tr} + + +{tr}You can view a diff back to the previous version by following +this link: + {$mail_machine}{$smarty.const.WIKI_PKG_URL}page_history.php?page={$mail_page|escape:"url"}&diff2={$mail_last_version}{/tr} + + {tr}Comment:{/tr} {$mail_comment} -{tr}Diff:{/tr} {$mail_machine_raw}/{$gBitLoc.WIKI_PKG_URL}pagehistory.php?page={$mail_page|escape:"url"}&diff2={$mail_last_version} -{tr}If you don't want to receive these notifications follow this link:{/tr} -{$mail_machine_raw}/{$gBitLoc.USERS_PKG_URL}user_watches.php?hash={$mail_hash} +{tr}The new page content follows below.{/tr} + +*********************************************************** -{tr}The new page content is:{/tr} {$mail_pagedata} + diff --git a/templates/user_watch_wiki_page_comment.tpl b/templates/user_watch_wiki_page_comment.tpl index 5dbc700..65ee787 100644 --- a/templates/user_watch_wiki_page_comment.tpl +++ b/templates/user_watch_wiki_page_comment.tpl @@ -6,4 +6,4 @@ {tr}Comment:{/tr} {$mail_comment} {tr}If you don't want to receive these notifications follow this link:{/tr} -{$mail_machine_raw}/{$gBitLoc.USERS_PKG_URL}user_watches.php?hash={$mail_hash} +{$mail_machine_raw}/{$smarty.const.USERS_PKG_URL}user_watches.php?hash={$mail_hash} diff --git a/templates/wiki_change_notification.tpl b/templates/wiki_change_notification.tpl index c510062..64fb040 100644 --- a/templates/wiki_change_notification.tpl +++ b/templates/wiki_change_notification.tpl @@ -3,16 +3,16 @@ {tr}You can view the page by following this link: - {$mail_machine}/{$gBitLoc.WIKI_PKG_URL}index.php?page={$mail_page|escape:"url"}{/tr} + {$mail_machine}{$smarty.const.WIKI_PKG_URL}index.php?page={$mail_page|escape:"url"}{/tr} {tr}You can edit the page by following this link: - {$mail_machine}/{$gBitLoc.WIKI_PKG_URL}edit.php?page={$mail_page|escape:"url"}{/tr} + {$mail_machine}{$smarty.const.WIKI_PKG_URL}edit.php?page={$mail_page|escape:"url"}{/tr} {tr}You can view a diff back to the previous version by following this link: - {$mail_machine}/{$gBitLoc.WIKI_PKG_URL}page_history.php?page={$mail_page|escape:"url"}&diff2={$mail_last_version}{/tr} + {$mail_machine}{$smarty.const.WIKI_PKG_URL}page_history.php?page={$mail_page|escape:"url"}&diff2={$mail_last_version}{/tr} {tr}Comment:{/tr} {$mail_comment} |
