summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-07-25 20:02:11 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-07-25 20:02:11 +0000
commitf16cc32de9e8cdd56c139276ab458dc5261efd86 (patch)
tree2544e68bfe4f05fe591bda427d1b27ade2741be5
parent021a4f8d0e7811c28d427373b5c19cec921e4015 (diff)
downloadkernel-f16cc32de9e8cdd56c139276ab458dc5261efd86.tar.gz
kernel-f16cc32de9e8cdd56c139276ab458dc5261efd86.tar.bz2
kernel-f16cc32de9e8cdd56c139276ab458dc5261efd86.zip
Merge recent changes R1 1.0.2 beta --> HEAD
-rwxr-xr-xBitBase.php26
-rwxr-xr-xBitDb.php37
-rwxr-xr-xBitSmarty.php13
-rwxr-xr-xBitSystem.php105
-rw-r--r--admin/admin_features_inc.php14
-rw-r--r--admin/schema_inc.php4
-rw-r--r--admin/upgrade_inc.php1
-rwxr-xr-xbit_error_inc.php12
-rw-r--r--config_defaults_inc.php3
-rw-r--r--mod_lib.php4
-rw-r--r--preflight_inc.php34
-rw-r--r--setup_inc.php10
-rw-r--r--smarty_bit/function.smartlink.php1
-rwxr-xr-xsmarty_bit/resource.bitpackage.php2
-rw-r--r--templates/admin_modules.tpl39
-rw-r--r--templates/admin_server.tpl4
-rw-r--r--templates/menu_global.tpl18
-rw-r--r--templates/menu_layout_admin.tpl2
-rw-r--r--templates/top_bar.tpl73
19 files changed, 251 insertions, 151 deletions
diff --git a/BitBase.php b/BitBase.php
index bf17d93..fd433b6 100755
--- a/BitBase.php
+++ b/BitBase.php
@@ -1,12 +1,12 @@
<?php
/**
-* $Header: /cvsroot/bitweaver/_bit_kernel/BitBase.php,v 1.2 2005/06/28 07:45:45 spiderr Exp $
+* $Header: /cvsroot/bitweaver/_bit_kernel/BitBase.php,v 1.3 2005/07/25 20:02:07 squareing Exp $
*
* Copyright (c) 2004 bitweaver.org
* 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: BitBase.php,v 1.2 2005/06/28 07:45:45 spiderr Exp $
+* $Id: BitBase.php,v 1.3 2005/07/25 20:02:07 squareing Exp $
*
* Virtual base class (as much as one can have such things in PHP) for all
* derived tikiwiki classes that require database access.
@@ -17,7 +17,7 @@
*
* @author spider <spider@steelsun.com>
*
-* @version $Revision: 1.2 $ $Date: 2005/06/28 07:45:45 $ $Author: spiderr $
+* @version $Revision: 1.3 $ $Date: 2005/07/25 20:02:07 $ $Author: squareing $
*/
/**
@@ -230,6 +230,26 @@ class BitBase
return $this->mDb->GenID( $seqTitle );
}
+ /** Calls ADODB method to begin a transaction, calls can be nested
+ */
+ function StartTrans() {
+ return $this->mDb->StartTrans();
+ }
+
+ /** Calls ADODB method to finalize a transaction, calls can be nested
+ */
+ function CompleteTrans() {
+ return $this->mDb->CompleteTrans();
+ }
+
+ function RollbackTrans() {
+ return $this->mDb->RollbackTrans();
+ }
+
+ function MetaTables( $ttype = false, $showSchema = false, $mask=false ) {
+ return $this->mDb->MetaTables( $ttype, $showSchema, $mask );
+ }
+
// =-=-=-=-=-=-=-=-=-=-=- Non-DB related functions =-=-=-=-=-=-=-=-=-=-=-=-=
/**
diff --git a/BitDb.php b/BitDb.php
index 878f7f1..27d4894 100755
--- a/BitDb.php
+++ b/BitDb.php
@@ -1,6 +1,6 @@
<?php
/**
-* @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/BitDb.php,v 1.6 2005/07/17 17:36:05 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/BitDb.php,v 1.7 2005/07/25 20:02:08 squareing Exp $
*
* @package kernel
*
@@ -12,7 +12,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: BitDb.php,v 1.6 2005/07/17 17:36:05 squareing Exp $
+* $Id: BitDb.php,v 1.7 2005/07/25 20:02:08 squareing Exp $
*/
/**
@@ -69,6 +69,11 @@ class BitDb
*/
var $mCacheFlag;
/**
+ * Determines if fatal query functions should terminate script execution. Defaults to TRUE. Can be deactived for things like expected duplicate inserts
+ * @private
+ */
+ var $mFatalActive;
+ /**
* During initialisation, database parameters are passed to the class.
* If these parameters are not valid, class will not be initialised.
*/
@@ -77,6 +82,8 @@ class BitDb
global $gBitDbType, $gBitDbHost, $gBitDbUser, $gBitDbPassword, $gBitDbName, $ADODB_FETCH_MODE;
$this->mCacheFlag = FALSE;
$this->mNumQueries = 0;
+ $this->setFatalActive();
+
global $ADODB_CACHE_DIR;
if( empty( $ADODB_CACHE_DIR ) ) {
$ADODB_CACHE_DIR = getTempDir().'/adodb/'.$_SERVER['HTTP_HOST'].'/';
@@ -177,6 +184,23 @@ class BitDb
}
/**
+ * Determines if the database connection is valid
+ * @return true if DB connection is valid, false if not
+ */
+ function isFatalActive() {
+ return( $this->mFatalActive );
+ }
+
+ /**
+ * Determines if the database connection is valid
+ * @return true if DB connection is valid, false if not
+ */
+ function setFatalActive( $pActive=TRUE ) {
+ $this->mFatalActive = $pActive;
+ }
+
+
+ /**
* Used to create tables - most commonly from package/schema_inc.php files
* @todo remove references to BIT_DB_PREFIX, us a member function
* @param pTables an array of tables and creation information in DataDict
@@ -443,7 +467,7 @@ class BitDb
if( $gDebug ) {
global $gBitSystem;
$this->mQueryLap = $gBitSystem->mTimer->elapsed();
- $this->mDb->debug = 99;
+ $this->mDb->debug = $gDebug;
}
}
@@ -777,6 +801,8 @@ class BitDb
return $ret;
}
+ /** Calls ADODB method to begin a transaction
+ */
function StartTrans() {
return $this->mDb->StartTrans();
}
@@ -793,5 +819,10 @@ class BitDb
return $this->mDb->MetaTables( $ttype, $showSchema, $mask );
}
+ function isAdvancedPostgresEnabled() {
+ // This code makes use of the badass /usr/share/pgsql/contrib/tablefunc.sql
+ // contribution that you have to install like: psql foo < /usr/share/pgsql/contrib/tablefunc.sql
+ return defined( 'ADVANCED_PGSQL' );
+ }
}
?>
diff --git a/BitSmarty.php b/BitSmarty.php
index 129d2e9..11255c5 100755
--- a/BitSmarty.php
+++ b/BitSmarty.php
@@ -1,6 +1,6 @@
<?php
/**
-* @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSmarty.php,v 1.2 2005/06/28 07:45:45 spiderr Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSmarty.php,v 1.3 2005/07/25 20:02:08 squareing Exp $
* @package Smarty
*/
@@ -76,9 +76,20 @@ class BitSmarty extends Smarty
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false)
{
+ global $gBitSystem;
$this->verifyCompileDir();
$_smarty_cache_id = $_smarty_cache_id;
$_smarty_compile_id = $_smarty_compile_id;
+ if( strpos( $_smarty_tpl_file, ':' ) ) {
+ list($resource, $location) = split(':', $_smarty_tpl_file);
+ if ($resource == 'bitpackage') {
+ list($package, $template) = split('/', $location);
+ if( !$gBitSystem->isPackageActive( $package ) ) {
+ return '';
+ }
+ }
+ }
+
// the PHP sibling file needs to be included here, before the fetch so caching works properly
$this->includeSiblingPhp($_smarty_tpl_file);
return parent::fetch($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_display);
diff --git a/BitSystem.php b/BitSystem.php
index c5f4167..9f5ca89 100755
--- a/BitSystem.php
+++ b/BitSystem.php
@@ -2,7 +2,7 @@
/**
* @package kernel
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.9 $
+* @version $Revision: 1.10 $
*/
// +----------------------------------------------------------------------+
// | PHP version 4.??
@@ -19,7 +19,7 @@
// +----------------------------------------------------------------------+
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-// $Id: BitSystem.php,v 1.9 2005/07/17 17:36:05 squareing Exp $
+// $Id: BitSystem.php,v 1.10 2005/07/25 20:02:08 squareing Exp $
/**
* required setup
@@ -46,7 +46,7 @@ define('HOMEPAGE_LAYOUT', 'home');
* is Package specific should be moved into that package
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
* @package kernel
* @subpackage BitSystem
*/
@@ -128,19 +128,17 @@ class BitSystem extends BitBase
$bitdomain = "";
}
- global $smarty, $gBitSmarty;
+ global $gBitSmarty;
// make sure we only create one BitSmarty
- if( !is_object( $smarty ) ) {
- // $smarty = new BitSmarty($bitdomain);
- $smarty = new BitSmarty();
+ if( !is_object( $gBitSmarty ) ) {
+ $gBitSmarty = new BitSmarty();
// set the default handler
- $smarty->load_filter('pre', 'tr');
- // $smarty->load_filter('output','trimwhitespace');
+ $gBitSmarty->load_filter('pre', 'tr');
+ // $gBitSmarty->load_filter('output','trimwhitespace');
if (isset($_REQUEST['highlight']))
{
- $smarty->load_filter('output', 'highlight');
+ $gBitSmarty->load_filter('output', 'highlight');
}
- $gBitSmarty = &$smarty;
}
}
@@ -312,8 +310,8 @@ class BitSystem extends BitBase
* @access public
*/
function display( $pMid, $pBrowserTitle=NULL ) {
- global $smarty;
- $smarty->verifyCompileDir();
+ global $gBitSmarty;
+ $gBitSmarty->verifyCompileDir();
header( 'Content-Type: text/html; charset=utf-8' );
if( !empty( $pBrowserTitle ) ) {
@@ -324,9 +322,9 @@ class BitSystem extends BitBase
$pMid = 'bitpackage:kernel/error.tpl';
}
$this->preDisplay( $pMid );
- $smarty->assign( 'mid', $pMid );
- $smarty->assign( 'page', !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : NULL );
- $smarty->display( 'bitpackage:kernel/bitweaver.tpl' );
+ $gBitSmarty->assign( 'mid', $pMid );
+ $gBitSmarty->assign( 'page', !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : NULL );
+ $gBitSmarty->display( 'bitpackage:kernel/bitweaver.tpl' );
$this->postDisplay( $pMid );
}
// >>>
@@ -339,7 +337,7 @@ class BitSystem extends BitBase
*/
function preDisplay($pMid)
{
- global $gCenterPieces, $fHomepage, $smarty, $gBitUser, $gBitLoc, $gPreviewStyle;
+ global $gCenterPieces, $fHomepage, $gBitSmarty, $gBitUser, $gBitLoc, $gPreviewStyle;
// setup our theme style and check if a preview theme has been picked
if( $gPreviewStyle !== FALSE ) {
$this->setStyle( $gPreviewStyle );
@@ -353,14 +351,14 @@ class BitSystem extends BitBase
$gBitLoc['altStyleSheets'] = $this->getAltStyleCss();
$gBitLoc['THEMES_STYLE_URL'] = $this->getStyleUrl();
$gBitLoc['JSCALENDAR_PKG_URL'] = UTIL_PKG_URL.'jscalendar/';
- $smarty->assign_by_ref("gBitLoc", $gBitLoc);
+ $gBitSmarty->assign_by_ref("gBitLoc", $gBitLoc);
// dont forget to assign slideshow stylesheet if we are viewing page as slideshow
-// $smarty->assign('slide_style', $this->getStyleCss("slide_style"));
+// $gBitSmarty->assign('slide_style', $this->getStyleCss("slide_style"));
$this->loadLayout(($this->getPreference('feature_user_layout') == 'h' && !empty($fHomepage)) ? $fHomepage : ($this->getPreference('feature_user_layout') == 'y' ? $gBitUser->mUsername : null));
if ($pMid == 'bitpackage:kernel/dynamic.tpl')
{
- $smarty->assign_by_ref('gCenterPieces', $gCenterPieces);
+ $gBitSmarty->assign_by_ref('gCenterPieces', $gCenterPieces);
}
else
{
@@ -407,7 +405,8 @@ class BitSystem extends BitBase
function getHeaderIncFiles() {
global $gBitSystem, $gBitLoc;
foreach( $gBitSystem->mPackages as $package => $info ) {
- if( is_file( $file = $info['path'].'templates/header_inc.tpl' ) ) {
+ $file = $info['path'].'templates/header_inc.tpl';
+ if( is_readable( $file ) ) {
$ret[] = $file;
}
}
@@ -437,8 +436,8 @@ class BitSystem extends BitBase
*/
function setHelpInfo($package, $context, $desc)
{
- global $smarty;
- $smarty->assign('TikiHelpInfo', array('URL' => 'http://doc.bitweaver.org/wiki/index.php?page=' . $package . $context , 'Desc' => $desc));
+ global $gBitSmarty;
+ $gBitSmarty->assign('TikiHelpInfo', array('URL' => 'http://doc.bitweaver.org/wiki/index.php?page=' . $package . $context , 'Desc' => $desc));
}
// >>>
@@ -520,7 +519,7 @@ class BitSystem extends BitBase
*/
function verifyPermission( $pPermission, $pMsg = NULL )
{
- global $smarty, $gBitUser, ${$pPermission};
+ global $gBitSmarty, $gBitUser, ${$pPermission};
if( $gBitUser->hasPermission($pPermission) ) {
return true;
} else {
@@ -529,7 +528,7 @@ class BitSystem extends BitBase
}
function fatalPermission( $pPermission, $pMsg=NULL ) {
- global $gBitUser, $smarty;
+ global $gBitUser, $gBitSmarty;
if( empty( $pMsg ) ) {
$permDesc = $this->getPermissionInfo( $pPermission );
$pMsg = "You do not have the required permissions ";
@@ -543,14 +542,13 @@ class BitSystem extends BitBase
}
if( !$gBitUser->isRegistered() ) {
$pMsg .= '</p><p>You must be logged in. Please <a href="'.USERS_PKG_URL.'login.php">login</a> or <a href="'.USERS_PKG_URL.'register.php">register</a>.';
- $smarty->assign( 'template', 'bitpackage:users/login_inc.tpl' );
+ $gBitSmarty->assign( 'template', 'bitpackage:users/login_inc.tpl' );
}
- $smarty->assign( 'msg', tra( $pMsg ) );
+ $gBitSmarty->assign( 'msg', tra( $pMsg ) );
$this->display( "error.tpl" );
die;
}
- // === verifyPermission
/**
* This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.
* It will verify if a given user has a given $permission and if not, it will display the error template and die()
@@ -560,17 +558,17 @@ class BitSystem extends BitBase
*/
function confirmDialog( $pFormHash, $pMsg )
{
- global $smarty;
+ global $gBitSmarty;
if( !empty( $pMsg ) ) {
if( empty( $pParamHash['cancel_url'] ) ) {
- $smarty->assign( 'backJavascript', 'onclick="history.back();"' );
+ $gBitSmarty->assign( 'backJavascript', 'onclick="history.back();"' );
}
if( !empty( $pFormHash['input'] ) ) {
- $smarty->assign( 'inputFields', $pFormHash['input'] );
+ $gBitSmarty->assign( 'inputFields', $pFormHash['input'] );
unset( $pFormHash['input'] );
}
- $smarty->assign( 'msgFields', $pMsg );
- $smarty->assign_by_ref( 'hiddenFields', $pFormHash );
+ $gBitSmarty->assign( 'msgFields', $pMsg );
+ $gBitSmarty->assign_by_ref( 'hiddenFields', $pFormHash );
$this->display( 'bitpackage:kernel/confirm.tpl' );
die;
}
@@ -836,8 +834,8 @@ class BitSystem extends BitBase
*/
function fatalError($pMsg)
{
- global $smarty;
- $smarty->assign('msg', tra($pMsg) );
+ global $gBitSmarty;
+ $gBitSmarty->assign('msg', tra($pMsg) );
$this->display( 'error.tpl' );
die;
}
@@ -965,7 +963,7 @@ asort( $this->mAppMenu );
}
}
- foreach( array_keys( $this->mPackages ) as $package ) {
+ foreach( array_keys( $this->mPackages ) as $package ) {
if (!empty( $this->mPackages[$package]['installed'] ) && $this->getPreference("package_".strtolower($package)) != 'y') {
$this->storePreference('package_'.strtolower( $package ), 'n');
} elseif( empty( $this->mPackages[$package]['installed'] ) ) {
@@ -1077,9 +1075,9 @@ asort( $this->mAppMenu );
*/
function setStyle($pStyle)
{
- global $smarty;
+ global $gBitSmarty;
$this->mStyle = $pStyle;
- $smarty->assign( 'style', $pStyle );
+ $gBitSmarty->assign( 'style', $pStyle );
}
// === setBrowserTitle
/**
@@ -1104,10 +1102,10 @@ asort( $this->mAppMenu );
*/
function setBrowserTitle($pTitle)
{
- global $smarty, $gPageTitle;
+ global $gBitSmarty, $gPageTitle;
$gPageTitle = $pTitle;
- $smarty->assign('browserTitle', $pTitle);
- $smarty->assign('gPageTitle', $pTitle);
+ $gBitSmarty->assign('browserTitle', $pTitle);
+ $gBitSmarty->assign('gPageTitle', $pTitle);
}
// === getStyleCss
/**
@@ -1267,7 +1265,7 @@ asort( $this->mAppMenu );
if ($pForceReload || empty($this->mLayout) || !count($this->mLayout))
{
unset($this->mLayout);
- $this->mLayout = &$this->getLayout($pUserMixed, $pLayout, $pLayout, $pFallbackLayout);
+ $this->mLayout = $this->getLayout($pUserMixed, $pLayout, $pLayout, $pFallbackLayout);
}
}
@@ -1296,7 +1294,7 @@ asort( $this->mAppMenu );
// This saves a count() query to see if the ACTIVE_PACKAGE has a layout, since it usually probably doesn't
// I don't know if it's better or not to save the count() query and retrieve more data - my gut says so,
// but i've done no research - spiderr
- if ($pLayout != DEFAULT_PACKAGE && $pFallback && $this->mDb->mType != 'firebird') {
+ if ($pLayout != DEFAULT_PACKAGE && $pFallback && $this->mDb->mType != 'firebird' && $this->mDb->mType != 'mssql') {
// ORDER BY comparison is crucial so current layout modules come up first
$whereClause .= " (tl.`layout`=? OR tl.`layout`=? ) ORDER BY tl.`layout`=? DESC, ";
array_push($bindVars, $pLayout);
@@ -1491,7 +1489,7 @@ asort( $this->mAppMenu );
{
$errors .= "The directory '$save_path' does not exist or PHP is not allowed to access it (check open_basedir entry in php.ini).\n";
}
- else if (!is_writeable($save_path))
+ else if (!bw_is_writeable($save_path))
{
$errors .= "The directory '$save_path' is not writeable.\n";
}
@@ -1500,7 +1498,7 @@ asort( $this->mAppMenu );
{
$save_path = getTempDir();
- if (is_dir($save_path) && is_writeable($save_path))
+ if (is_dir($save_path) && bw_is_writeable($save_path))
{
ini_set('session.save_path', $save_path);
@@ -1514,9 +1512,13 @@ asort( $this->mAppMenu );
if (isWindows())
{
- $wwwuser = 'SYSTEM';
-
- $wwwgroup = 'SYSTEM';
+ if ( strpos($_SERVER["SERVER_SOFTWARE"],"IIS") && isset($_SERVER['COMPUTERNAME']) ) {
+ $wwwuser = 'IUSR_'.$_SERVER['COMPUTERNAME'];
+ $wwwgroup = 'IUSR_'.$_SERVER['COMPUTERNAME'];
+ } else {
+ $wwwuser = 'SYSTEM';
+ $wwwgroup = 'SYSTEM';
+ }
}
if (function_exists('posix_getuid'))
@@ -1577,7 +1579,7 @@ $permFiles = array(
}
// chmod( $target, 02775 );
- if( $present && !is_writeable($target) ) {
+ if( $present && (!bw_is_writeable($target))) {
if (!isWindows())
{ $errors .= "<p><b style='color:red;'>$target</b> is not writeable by $wwwuser. To give $wwwuser write permission, execute a command such as:<pre>
\$ chmod 777 $target
@@ -1590,7 +1592,7 @@ $permFiles = array(
// {
// $errors .= "The directory '$docroot$dir' does not exist.\n";
// }
- // else if (!is_writeable("$docroot/$dir"))
+ // else if (!bw_is_writeable("$docroot/$dir"))
// {
// $errors .= "The directory '$docroot$dir' is not writeable by $wwwuser.\n";
// }
@@ -2210,7 +2212,8 @@ function installError($pMsg = null)
} else {
$step = 0;
}
- header( "Location: ".BIT_ROOT_URL."install/install.php?step=".$step );
+
+ header( "Location: http://".$_SERVER['HTTP_HOST'].BIT_ROOT_URL."install/install.php?step=".$step );
/* // figure out our subdirectories, if any.
echo '<html><head><meta http-equiv="pragma" content="no-cache"><meta http-equiv="expires" content="1" /></head><body>';
echo "<p>$pMsg</p>";
diff --git a/admin/admin_features_inc.php b/admin/admin_features_inc.php
index e177414..19c4a52 100644
--- a/admin/admin_features_inc.php
+++ b/admin/admin_features_inc.php
@@ -1,6 +1,5 @@
<?php
-
-// $Header: /cvsroot/bitweaver/_bit_kernel/admin/admin_features_inc.php,v 1.2 2005/07/17 17:36:05 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_kernel/admin/admin_features_inc.php,v 1.3 2005/07/25 20:02:09 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.
@@ -79,12 +78,6 @@ $formFeaturesContent = array(
'note' => 'Enables you to edit CSS files - this setting is antiquated and will be removed soon. use the stylist package if you want to modify css files.',
'page' => 'EditCss',
),
- /* in preparation of dill release
- 'feature_jstabs' => array(
- 'label' => 'Javascript Tabs',
- 'note' => 'If you should not like the Javascript Tabs that are used throughout bitweaver, or if you experience problems with them, you can desable them here.<br />We recommend that you add something like <strong>.tabsystem h4 {display: none;}</strong> to your css file to remove duplicate headings. Some pages might be disorienting if this feature is disabled.',
- ),
- */
);
$smarty->assign( 'formFeaturesContent',$formFeaturesContent );
@@ -121,9 +114,8 @@ $smarty->assign( 'users_list', ( count( $users_list ) < 50 ) ? $users_list : NUL
$processForm = set_tab();
if( $processForm ) {
-
- $featureToggles = array_merge( $formFeaturesTiki,$formFeaturesContent,$formFeaturesAdmin,$formFeaturesHelp );
- foreach( $featureToggles as $item => $data ) {
+ $featureToggles = array_merge( $formFeaturesTiki,$formFeaturesContent,$formFeaturesAdmin,$formFeaturesHelp,array( 'feature_contact' => 0 ) );
+ foreach( array_keys( $featureToggles ) as $item ) {
simple_set_toggle( $item );
}
simple_set_value( "contact_user" );
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 30e24ca..c8000c1 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -20,8 +20,8 @@ $tables = array(
ip3 C(3),
ip4 C(3),
`user` C(40),
- date_from TIMESTAMP NOTNULL,
- date_to TIMESTAMP NOTNULL,
+ date_from T NOTNULL,
+ date_to T NOTNULL,
use_dates C(1),
created I8,
message X
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index 0c94380..3a69452 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -96,6 +96,7 @@ array( 'ALTER' => array(
// STEP 2
array( 'QUERY' =>
array( 'SQL92' => array(
+ "UPDATE `".BIT_DB_PREFIX."tiki_module_map` SET `module_rsrc` = replace( `module_rsrc`, 'tikipackage', 'bitpackage' )",
)
)),
diff --git a/bit_error_inc.php b/bit_error_inc.php
index 4150fca..cae63e3 100755
--- a/bit_error_inc.php
+++ b/bit_error_inc.php
@@ -17,7 +17,7 @@
* set error handling
*/
if( !defined( 'BIT_INSTALL' ) && !defined( 'ADODB_ERROR_HANDLER' ) ) {
- define( 'ADODB_ERROR_HANDLER', 'tiki_error_handler' );
+ define( 'ADODB_ERROR_HANDLER', 'bit_error_handler' );
}
/*
@@ -30,12 +30,12 @@ if( !defined( 'BIT_INSTALL' ) && !defined( 'ADODB_ERROR_HANDLER' ) ) {
* @param $p1 $fn specific parameter - see below
* @param $P2 $fn specific parameter - see below
*/
-function tiki_error_handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) {
- global $gBitSystem;
+function bit_error_handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) {
+ global $gBitSystem, $gBitDb;
if (ini_get('error_reporting') == 0) return; // obey @ protocol
$dbParams = array('gDB'=>&$thisConnection, 'db_type'=>$dbms, 'call_func'=>$fn, 'errno'=>$errno, 'db_msg'=>$errmsg, 'sql'=>$p1, 'p2'=>$p2);
- $logString = tiki_error_string( $dbParams );
+ $logString = bit_error_string( $dbParams );
/*
* Log connection error somewhere
* 0 message is sent to PHP's system logger, using the Operating System's system
@@ -54,7 +54,7 @@ function tiki_error_handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnect
$subject = isset( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : 'BITWEAVER';
$fatal = FALSE;
- if ( ($fn == 'EXECUTE') && ($thisConnection->MetaError() != -5) ) {
+ if ( ($fn == 'EXECUTE') && ($thisConnection->MetaError() != -5) && $gBitDb->isFatalActive() ) {
$subject .= ' FATAL';
$fatal = TRUE;
} else {
@@ -85,7 +85,7 @@ function tiki_error_handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnect
}
}
-function tiki_error_string( $iDBParms ) {
+function bit_error_string( $iDBParms ) {
global $gBitDb;
global $gBitUser;
global $_SERVER;
diff --git a/config_defaults_inc.php b/config_defaults_inc.php
index d7d5ae1..140941e 100644
--- a/config_defaults_inc.php
+++ b/config_defaults_inc.php
@@ -28,6 +28,9 @@ if( !defined( 'BIT_QUERY_CACHE_TIME' ) ) {
if( !defined( 'DISPLAY_ERRORS' ) ) {
define( 'DISPLAY_ERRORS', 0 );
}
+
+// this is broken if the virtual directory under the webserver is
+// not the same name as the physical directory on the drive - wolff_borg
if (!defined('BIT_ROOT_URL' )) {
preg_match('/.*'.basename(dirname(dirname(__FILE__ ) ) ).'\//', $_SERVER['PHP_SELF'], $match );
$subpath = ( isset($match[0] ) ) ? $match[0] : '/';
diff --git a/mod_lib.php b/mod_lib.php
index 6e29958..ba2c939 100644
--- a/mod_lib.php
+++ b/mod_lib.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/mod_lib.php,v 1.3 2005/07/17 17:36:05 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/mod_lib.php,v 1.4 2005/07/25 20:02:08 squareing Exp $
* @package kernel
*/
@@ -88,7 +88,7 @@ class ModLib extends BitBase {
}
$result = $this->query( $query, $bindVars );
- if( $pHash['layout'] == 'kernel' ) {
+ if( !isset($pHash['layout']) || $pHash['layout'] == 'kernel' ) {
$this->query( "UPDATE `".BIT_DB_PREFIX."tiki_layouts_modules` SET `params`=? WHERE `module_id`=?", array( $pHash['params'], $pHash['module_id'] ) );
}
diff --git a/preflight_inc.php b/preflight_inc.php
index ad20399..0f84574 100644
--- a/preflight_inc.php
+++ b/preflight_inc.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/preflight_inc.php,v 1.2 2005/06/28 07:45:45 spiderr Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/preflight_inc.php,v 1.3 2005/07/25 20:02:08 squareing Exp $
* @package kernel
* @subpackage functions
*/
@@ -40,7 +40,7 @@ function isWindows()
function mkdir_p($target, $perms = 0777)
{
global $gDebug;
- $target;
+
if (file_exists($target) || is_dir($target))
{
if ($gDebug) echo "mkdir_p() - file already exists $target<br>";
@@ -153,7 +153,7 @@ function isFileWriteable($pFile)
} elseif (!@is_file($pFile)) {
$success = 0;
$data = "not file";
- } elseif (!@is_writable($pFile)) {
+ } elseif (!@bw_is_writeable($pFile)) {
$success = 0;
$data = "not writeable";
}
@@ -174,7 +174,7 @@ function isDirectoryWriteable($pDir)
} elseif (!@is_dir($pDir)) {
$success = 0;
$data = "not directory";
- } elseif (!@is_writable($pDir)) {
+ } elseif (!@bw_is_writeable($pDir)) {
$success = 0;
$data = "not writeable";
}
@@ -203,4 +203,30 @@ function chkPhpSetting($pName, $pValue, $pComp='')
return $success;
// redundant $data = serialize(array("check" => $pValue, "actual" => $actual));
}
+
+// added check for Windows - wolff_borg - see http://bugs.php.net/bug.php?id=27609
+function bw_is_writeable($filename) {
+ if (!isWindows()) {
+ return is_writeable($filename);
+ } else {
+ $writeable = FALSE;
+ if (is_dir($filename)) {
+ $rnd = rand();
+ $writeable = @fopen($filename."/".$rnd,"a");
+ if ($writeable) {
+ fclose($writeable);
+ unlink($filename."/".$rnd);
+ $writeable = true;
+ }
+ } else {
+ $writeable = @fopen($filename,"a");
+ if ($writeable) {
+ fclose($writeable);
+ $writeable = true;
+ }
+ }
+ return $writeable;
+ }
+}
+
?>
diff --git a/setup_inc.php b/setup_inc.php
index 8630ed9..07774eb 100644
--- a/setup_inc.php
+++ b/setup_inc.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_kernel/setup_inc.php,v 1.8 2005/07/17 17:36:05 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_kernel/setup_inc.php,v 1.9 2005/07/25 20:02:08 squareing Exp $
* @package kernel
* @subpackage functions
*/
@@ -17,8 +17,8 @@ error_reporting( BIT_PHP_ERROR_REPORTING );
define( 'BIT_MAJOR_VERSION', '1' );
define( 'BIT_MINOR_VERSION', '0' );
-define( 'BIT_SUB_VERSION', '1' );
-define( 'BIT_LEVEL', '' ); // 'beta' or 'dev' or 'rc' etc..
+define( 'BIT_SUB_VERSION', '2' );
+define( 'BIT_LEVEL', 'beta' ); // 'beta' or 'dev' or 'rc' etc..
define( 'BIT_PKG_PATH', BIT_ROOT_PATH );
@@ -64,6 +64,10 @@ $gRefreshSitePrefs = FALSE;
global $gBitSystem;
$gBitSystem = new BitSystem();
+// deprecated referenced variable alias - will be nuked soon - spiderr
+global $smarty;
+$smarty = &$gBitSmarty;
+
global $gPreviewStyle;
$gPreviewStyle = FALSE;
BitSystem::prependIncludePath(UTIL_PKG_PATH . '/');
diff --git a/smarty_bit/function.smartlink.php b/smarty_bit/function.smartlink.php
index 87b2a6c..7c4ec31 100644
--- a/smarty_bit/function.smartlink.php
+++ b/smarty_bit/function.smartlink.php
@@ -39,6 +39,7 @@
* - {smartlink ititle="Page Name" isort="title" iorder="desc" idefault=1}
* setting iorder and idefault here, makes this link sort in a descending order by default (iorder)
* and it is highlighted when $isort_mode ( or $_REQUEST['sort_mode'] ) is not set (idefault)
+ * @Note Don't use this plugin if ititle is generated dynamically since it is passed through tra()
*/
function smarty_function_smartlink( $params, &$smarty ) {
if( !empty( $params['ihash'] ) ) {
diff --git a/smarty_bit/resource.bitpackage.php b/smarty_bit/resource.bitpackage.php
index 63d09e4..eb260ff 100755
--- a/smarty_bit/resource.bitpackage.php
+++ b/smarty_bit/resource.bitpackage.php
@@ -15,7 +15,7 @@
* -------------------------------------------------------------
*/
function smarty_resource_bitpackage_source($tpl_name, &$tpl_source, &$smarty) {
- global $gBitSystem, $gBitSystem; // gBitSystem is just for temporary backward compatibility
+ global $gBitSystem;
$ret = false;
$path = explode( '/', $tpl_name );
diff --git a/templates/admin_modules.tpl b/templates/admin_modules.tpl
index 9e1071d..2b45ef8 100644
--- a/templates/admin_modules.tpl
+++ b/templates/admin_modules.tpl
@@ -1,10 +1,27 @@
-{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/Attic/admin_modules.tpl,v 1.1 2005/06/19 04:52:54 bitweaver Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/Attic/admin_modules.tpl,v 1.2 2005/07/25 20:02:10 squareing Exp $ *}
{$moduleJavascript}
{jstabs}
- {jstab title="Edit Modules"}
+ {jstab title="Module Settings"}
+ {form legend="Global Module Settings"}
+ <input type="hidden" name="page" value="{$page}" />
+ {foreach from=$formModuleFeatures key=feature item=output}
+ <div class="row">
+ {formlabel label=`$output.label` for=$feature}
+ {forminput}
+ {html_checkboxes name="$feature" values="y" checked=`$gBitSystemPrefs.$feature` labels=false id=$feature}
+ {formhelp note=`$output.note` page=`$output.page`}
+ {/forminput}
+ </div>
+ {/foreach}
+ <div class="row submit">
+ <input type="submit" name="ModulesTabSubmit" value="{tr}Change preferences{/tr}" />
+ </div>
+ {/form}
+ {/jstab}
+ {jstab title="Module Accessibility"}
{form legend="Edit Modules" onsubmit="PostSubmitProcess()"}
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="fPackage" value="{$fPackage}" />
@@ -98,24 +115,6 @@
</ul>
{/if}
{/jstab}
-
- {jstab title="Module Settings"}
- {form legend="Global Module Settings"}
- <input type="hidden" name="page" value="{$page}" />
- {foreach from=$formModuleFeatures key=feature item=output}
- <div class="row">
- {formlabel label=`$output.label` for=$feature}
- {forminput}
- {html_checkboxes name="$feature" values="y" checked=`$gBitSystemPrefs.$feature` labels=false id=$feature}
- {formhelp note=`$output.note` page=`$output.page`}
- {/forminput}
- </div>
- {/foreach}
- <div class="row submit">
- <input type="submit" name="ModulesTabSubmit" value="{tr}Change preferences{/tr}" />
- </div>
- {/form}
- {/jstab}
{/jstabs}
{literal}
diff --git a/templates/admin_server.tpl b/templates/admin_server.tpl
index d956afa..1631732 100644
--- a/templates/admin_server.tpl
+++ b/templates/admin_server.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/admin_server.tpl,v 1.2 2005/07/17 17:36:06 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/admin_server.tpl,v 1.3 2005/07/25 20:02:11 squareing Exp $ *}
{strip}
{form}
<input type="hidden" name="page" value="{$page}" />
@@ -63,7 +63,7 @@
{formlabel label="Site Emailer return address" for="sender_email"}
{forminput}
<input size="50" type="text" name="sender_email" id="sender_email" value="{$gBitSystemPrefs.sender_email|escape}" />
- {formhelp note="When users recieve an automatically generated email, this is the email address that will be used as return address.<br />this should go in pkg_users???"}
+ {formhelp note="When users recieve an automatically generated email, this is the email address that will be used as return address."}
{/forminput}
</div>
diff --git a/templates/menu_global.tpl b/templates/menu_global.tpl
index 7c65ec2..edf2134 100644
--- a/templates/menu_global.tpl
+++ b/templates/menu_global.tpl
@@ -1,9 +1,9 @@
-{if $gBitSystem->isFeatureActive( 'feature_calendar' ) and $gBitUser->hasPermission( 'bit_p_view_calendar' )}
- <a class="menuoption" href="{$gBitLoc.CALENDAR_PKG_URL}index.php">{tr}Calendar{/tr}</a>
-{/if}
-{if $gBitSystem->isFeatureActive( 'feature_contact' )}
- <a class="menuoption" href="{$gBitLoc.MESSU_PKG_URL}contact.php">{tr}Contact us{/tr}</a>
-{/if}
-{if $gBitSystem->isFeatureActive( 'feature_stats' ) and $gBitUser->hasPermission( 'bit_p_view_stats' )}
- <a class="menuoption" href="{$gBitLoc.STATS_PKG_URL}index.php">{tr}Statistics{/tr}</a>
-{/if}
+{strip}
+<ul>
+ {if $gBitSystem->isFeatureActive( 'feature_contact' )}
+ <li><a class="item" href="{$gBitLoc.MESSU_PKG_URL}contact.php">{biticon ipackage=liberty iname=spacer iforce=icon} {tr}Contact us{/tr}</a></li>
+ {/if}
+ <li><a class="item" href="{$gBitLoc.LIBERTY_PKG_URL}list_content.php">{biticon ipackage=liberty iname=spacer iforce=icon} {tr}All available Content{/tr}</a></li>
+ <li><a class="item" href="{$gBitLoc.USERS_PKG_URL}index.php">{biticon ipackage=users iname=users iforce=icon} {tr}Users List{/tr}</a></li>
+</ul>
+{/strip}
diff --git a/templates/menu_layout_admin.tpl b/templates/menu_layout_admin.tpl
index 53a852d..4f7058a 100644
--- a/templates/menu_layout_admin.tpl
+++ b/templates/menu_layout_admin.tpl
@@ -2,7 +2,7 @@
<ul>
<li><a class="item" href="{$gBitLoc.THEMES_PKG_URL}admin/admin_themes_manager.php">{tr}Themes Manager{/tr}</a></li>
<li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=layout" >{tr}Layout{/tr}</a></li>
- <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=modules">{tr}Modules{/tr}</a></li>
+ <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=modules">{tr}Module Settings{/tr}</a></li>
<li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=custom_modules">{tr}Custom Modules{/tr}</a></li>
{* <li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=menus">{tr}Menus{/tr}</a></li>*}
</ul>
diff --git a/templates/top_bar.tpl b/templates/top_bar.tpl
index 3df843b..065de6e 100644
--- a/templates/top_bar.tpl
+++ b/templates/top_bar.tpl
@@ -1,40 +1,49 @@
{strip}
-{* this link is for textbrowsers *}
<div id="bittopbar">
- <a style="display:none;position:absolute;top:0px;left:0px;" href="#top">{tr}go to top{/tr}</a>
- <ul id="nav" class="menu hor">
- <li class="m-home"><a class="item" href="{$gBitLoc.BIT_ROOT_URL}">{tr}{$siteTitle|default:"Home"}{/tr}</a></li>
- {foreach key=key item=menu from=$appMenu}
- {if $menu.title && $menu.titleUrl && $menu.template}
- <li class="m-{$key}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} current{/if}">
- <a class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} selected{/if}" href="{$menu.titleUrl}">{tr}{$menu.title}{/tr}</a>
+ {if $gBitUser->isAdmin() or !$use_custom_top_bar}
+ {* this link is for textbrowsers *}
+ <a style="display:none;position:absolute;top:0px;left:0px;" href="#top">{tr}go to top{/tr}</a>
+ <ul id="nav" class="menu hor">
+ <li class="m-home">
+ <a class="head" href="{$gBitLoc.BIT_ROOT_URL}">{tr}{$siteTitle|default:"Home"}{/tr}</a>
+ {include file="bitpackage:kernel/menu_global.tpl"}
+ </li>
+
+ {foreach key=key item=menu from=$appMenu}
+ {if $menu.title && $menu.titleUrl && $menu.template}
+ <li class="m-{$key}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} current{/if}">
+ <a class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} selected{/if}" href="{$menu.titleUrl}">{tr}{$menu.title}{/tr}</a>
+ {if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}
+ {include file="`$menu.template`"}
+ {/if}
+ </li>
+ {/if}
+ {/foreach}
+
+ {if $gBitUser->isAdmin()}
+ <li class="m-admin{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} current{/if}">
+ <a class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} selected{/if}" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Administration{/tr}</a>
{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}
- {include file="`$menu.template`"}
+ <ul>
+ {foreach key=key item=menu from=$adminMenu}
+ <li>
+ <a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}{$key|capitalize}{/tr}</a>
+ {include file=`$menu.tpl`}
+ </li>
+ {/foreach}
+ <li>
+ <a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Layout and Design{/tr}</a>
+ {include file="bitpackage:kernel/menu_layout_admin.tpl"}
+ </li>
+ </ul>
{/if}
</li>
{/if}
- {/foreach}
- {if $gBitUser->isAdmin()}
- <li class="m-admin{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} current{/if}">
- <a class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} selected{/if}" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Administration{/tr}</a>
- {if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}
- <ul>
- {foreach key=key item=menu from=$adminMenu}
- <li>
- <a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}{$key|capitalize}{/tr}</a>
- {include file=`$menu.tpl`}
- </li>
- {/foreach}
- <li>
- <a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Layout and Design{/tr}</a>
- {include file="bitpackage:kernel/menu_layout_admin.tpl"}
- </li>
- </ul>
- {/if}
- </li>
- {/if}
- </ul>
- <div class="clear"></div>
- <a style="padding:0;margin:0;border:0;" name="top"></a>
+ </ul>
+ <div class="clear"></div>
+ <a style="padding:0;margin:0;border:0;" name="top"></a>
+ {else}
+ {include file="`$gBitLoc.TEMP_PKG_PATH`nexus/modules/top_bar_inc.tpl"}
+ {/if}
</div>
{/strip}