diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-08-24 20:52:15 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-08-24 20:52:15 +0000 |
| commit | 1b0b2cdb732c5e737aca3eb032e99c60d103bbac (patch) | |
| tree | 68c9f310b302c284a836ed25a1bb728db60a8bd2 | |
| parent | 22473a9ca7ccf4b044cd268a2a038447c11dea6a (diff) | |
| download | kernel-1b0b2cdb732c5e737aca3eb032e99c60d103bbac.tar.gz kernel-1b0b2cdb732c5e737aca3eb032e99c60d103bbac.tar.bz2 kernel-1b0b2cdb732c5e737aca3eb032e99c60d103bbac.zip | |
synch recent changes from R1 to HEAD
31 files changed, 354 insertions, 210 deletions
diff --git a/BitDate.php b/BitDate.php index 7a7fa6a..5b9d649 100644 --- a/BitDate.php +++ b/BitDate.php @@ -3,7 +3,7 @@ * Date Handling Class * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitDate.php,v 1.3 2005/08/07 17:38:44 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitDate.php,v 1.4 2005/08/24 20:52:14 squareing Exp $ * * Created by: Jeremy Jongsma (jjongsma@tickchat.com) * Created on: Sat Jul 26 11:51:31 CDT 2003 @@ -52,7 +52,7 @@ class BitDate { * returns: Display-offset timestamp. */ function getDisplayDateFromUTC($_timestamp) { - return $_timestamp + $this->display_offset; + return $this->getTimestampFromISO($_timestamp) + $this->display_offset; } /** @@ -61,7 +61,7 @@ class BitDate { * returns: UTC timestamp. */ function getUTCFromDisplayDate($_timestamp) { - return $_timestamp - $this->display_offset; + return $this->getTimestampFromISO($_timestamp) - $this->display_offset; } /** @@ -70,7 +70,7 @@ class BitDate { * returns: Server timestamp. */ function getServerDateFromUTC($_timestamp) { - return $_timestamp + $this->server_offset; + return $this->getTimestampFromISO($_timestamp) + $this->server_offset; } /** @@ -79,7 +79,7 @@ class BitDate { * returns: UTC timestamp. */ function getUTCFromServerDate($_timestamp) { - return $_timestamp - $this->server_offset; + return $this->getTimestampFromISO($_timestamp) - $this->server_offset; } /** @@ -88,7 +88,8 @@ class BitDate { * returns: Server timestamp. */ function getServerDateFromDisplayDate($_timestamp) { - return $this->getServerDateFromUTC($this->getUTCFromDisplayDate($_timestamp)); + return $this->getServerDateFromUTC($this->getUTCFromDisplayDate($this->getTimestampFromISO($_timestamp))); + } /** @@ -97,7 +98,7 @@ class BitDate { * returns: Display timestamp. */ function getDisplayDateFromServerDate($_timestamp) { - return $this->getDisplayDateFromUTC($this->getUTCFromServerDate($_timestamp)); + return $this->getDisplayDateFromUTC($this->getUTCFromServerDate($this->getTimestampFromISO($_timestamp))); } /** @@ -118,6 +119,28 @@ class BitDate { else return ""; } + + /** + * Convert ISO date to numberic timestamp. + * + * @param string ISO format date<br> + * yYYY-mM-dD hH:mM:sS.s ( Lower case letters optional, but should be 0 ) + * @return integer Seconds count based on 1st Jan 1970<br> + * returns $iso_date if it is a number, or 0 if format invalid + */ + function getTimestampFromISO($iso_date) { + $ret = 0; + if ( is_numeric($iso_date) ) $ret = $iso_date; + else if (preg_match( + "|^([0-9]{3,4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", + ($iso_date), $rr)) { + // h-m-s-MM-DD-YY + if (!isset($rr[5])) $ret = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]); + else $ret = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]); + } + return $ret; + } + } ?>
\ No newline at end of file @@ -3,7 +3,7 @@ * ADOdb Library interface Class * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/BitDb.php,v 1.10 2005/08/11 13:03:45 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/BitDb.php,v 1.11 2005/08/24 20:52:14 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -392,7 +392,7 @@ class BitDb } /** - * List columns in a database as an array of ADOFieldObjects. + * List columns in a database as an array of ADOFieldObjects. * See top of file for definition of object. * * @param table table name to query @@ -476,7 +476,7 @@ class BitDb } /** - * Used to start query timer if in debug mode + * Used to start query timer if in debug mode */ function queryStart() { global $gDebug; @@ -484,6 +484,7 @@ class BitDb global $gBitSystem; $this->mQueryLap = $gBitSystem->mTimer->elapsed(); $this->mDb->debug = $gDebug; + flush(); } } @@ -502,6 +503,7 @@ class BitDb $style = ( $interval > .5 ) ? 'color:red;' : (( $interval > .15 ) ? 'color:orange;' : ''); print '<p style="'.$style.'">### Query: '.$num_queries.' Start time: '.$this->mQueryLap.' ### Query run time: '.$interval.'</p>'; $this->mQueryLap = 0; + flush(); } } @@ -560,7 +562,7 @@ class BitDb * at the location identified in updateId which holds a name and value entry * @param updateTable Name of the table to be updated * @param updateData Array of data to be changed. Array keys provide the field names - * @param updateId Array identifying the record to update. + * @param updateId Array identifying the record to update. * Array key 'name' provide the field name, and 'value' the record key * @return Error status of the insert */ @@ -605,7 +607,7 @@ class BitDb return $this->mDb->Execute(sprintf($this->_genSeqSQL,$seqname,$startID)); } - /** + /** * A database portable IFNULL function. * * @param pField argument to compare to NULL @@ -649,7 +651,7 @@ class BitDb * If NULL an offset from the current time is supplied * @return New number of days * - * @todo Not currently used - this is database specific and uses TIMESTAMP + * @todo Not currently used - this is database specific and uses TIMESTAMP * rather than unix seconds */ function OffsetDate( $pDays, $pColumn=NULL ) { @@ -848,15 +850,16 @@ class BitDb } /** - * Used to encode blob data (eg PostgreSQL) + * Used to encode blob data (eg PostgreSQL). Can be called statically * @todo had a lot of trouble with AdoDB BlobEncode and BlobDecode * the code works but will need work for dbs other than PgSQL * @param pData a string of raw blob data * @return escaped blob data */ function db_byte_encode( &$pData ) { - global $ADODB_LASTDB; - switch ($ADODB_LASTDB) { + // need to use this global so as not to break static calls + global $gBitDbType; + switch ( $gBitDbType ) { case "postgres": $search = array(chr(92), chr(0), chr(39)); $replace = array('\\\134', '\\\000', '\\\047'); @@ -877,8 +880,7 @@ class BitDb * @return a string of raw blob data */ function db_byte_decode( &$pData ) { - global $ADODB_LASTDB; - switch ($ADODB_LASTDB) { + switch ($this->mDb->mType) { case "postgres": $ret = stripcslashes( $pData ); break; @@ -892,7 +894,7 @@ class BitDb /** * Improved method of initiating a transaction. Used together with CompleteTrans(). * Advantages include: - * + * * a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. * Only the outermost block is treated as a transaction.<br> * b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.<br> @@ -906,8 +908,8 @@ class BitDb /** * Used together with StartTrans() to end a transaction. Monitors connection * for sql errors, and will commit or rollback as appropriate. - * - * autoComplete if true, monitor sql errors and commit and rollback as appropriate, + * + * autoComplete if true, monitor sql errors and commit and rollback as appropriate, * and if set to false force rollback even if no SQL error detected. * @returns true on commit, false on rollback. */ @@ -928,7 +930,7 @@ class BitDb /** * Create a list of tables available in the current database * - * @param ttype can either be 'VIEW' or 'TABLE' or false. + * @param ttype can either be 'VIEW' or 'TABLE' or false. * If false, both views and tables are returned. * "VIEW" returns only views * "TABLE" returns only tables @@ -936,19 +938,19 @@ class BitDb * @param mask is the input mask - only supported by oci8 and postgresql * * @return array of tables for current database. - */ + */ function MetaTables( $ttype = false, $showSchema = false, $mask=false ) { return $this->mDb->MetaTables( $ttype, $showSchema, $mask ); } /** * @return # rows affected by UPDATE/DELETE - */ + */ function Affected_Rows() { return $this->mDb->Affected_Rows(); } - /** - * Check for Postgres specific extensions + /** + * Check for Postgres specific extensions */ function isAdvancedPostgresEnabled() { // This code makes use of the badass /usr/share/pgsql/contrib/tablefunc.sql @@ -956,4 +958,4 @@ class BitDb return defined( 'ADVANCED_PGSQL' ); } } -?> +?>
\ No newline at end of file diff --git a/BitSmarty.php b/BitSmarty.php index 84adc36..6a06047 100755 --- a/BitSmarty.php +++ b/BitSmarty.php @@ -3,7 +3,7 @@ * Smarty Library Inteface Class * * @package Smarty - * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSmarty.php,v 1.5 2005/08/07 17:38:44 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSmarty.php,v 1.6 2005/08/24 20:52:14 squareing Exp $ */ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. @@ -170,7 +170,7 @@ function add_link_ticket($tpl_source, &$smarty) if ( is_object( $gBitUser ) && $gBitUser->isValid() ) { $from = '#href="(.*PKG_URL.*php)\?(.*)&(.*)"#i'; - $to = 'href="\\1?\\2&fTicket='.$gBitUser->mTicket.'&\\3"'; + $to = 'href="\\1?\\2&tk={$gBitUser->mTicket}&\\3"'; $ret = preg_replace($from, $to, $tpl_source); } else { $ret = $tpl_source; diff --git a/BitSystem.php b/BitSystem.php index 8d02d2c..d559551 100755 --- a/BitSystem.php +++ b/BitSystem.php @@ -3,7 +3,7 @@ * Main bitweaver systems functions * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSystem.php,v 1.13 2005/08/11 13:03:45 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitSystem.php,v 1.14 2005/08/24 20:52:14 squareing Exp $ * @author spider <spider@steelsun.com> */ // +----------------------------------------------------------------------+ @@ -759,7 +759,7 @@ class BitSystem extends BitBase $this->mPackages[$pPackage]['defaults'] = array(); } if( is_array( $pMixedDefaultSql ) ) { - foreach( $pMixedDefaultSql AS $def ) { + foreach( $pMixedDefaultSql as $def ) { $this->mPackages[$pPackage]['defaults'][] = $def; } } elseif( is_string( $pMixedDefaultSql ) ) { @@ -2177,31 +2177,6 @@ Proceed to the installer <b>at <a href=\"".BIT_ROOT_URL."install/install.php\">" } return $html; } - - // function to scan other package for files that need to be integrated - // @param $pFile path and filename in question. if the file is a template, no template/ needs to be prepended - // @param $pTrippleCheck (boolean) set to TRUE if you want to make sure all appropriate files are present for the integration - function getPackageIntegrationFiles( $pFile=NULL, $pTrippleCheck=FALSE ) { - global $gBitSystem; - $ret = array(); - if( !empty( $pFile ) ) { - foreach( $gBitSystem->mPackages as $package => $packageInfo ) { - if( is_file( $packageInfo['path'].$pFile ) ) { - if( preg_match( "/\.tpl$/", $pFile ) ) { - $ret[$package] = 'bitpackage:'.$package.'/'.preg_replace( "/templates\//", "", $pFile ); - } else { - $ret[$package] = $packageInfo['path'].$pFile; - } - } - - // if we are doing the tripple check and not all files are present, unset the info for that package - if( $pTrippleCheck && !( is_file( $packageInfo['path'].'get_form_info_inc.php' ) && is_file( $packageInfo['path'].'get_form_info_inc.php' ) && is_file( $packageInfo['path'].'get_form_info_inc.php' ) ) ) { - unset( $ret[$package] ); - } - } - } - return $ret; - } } // === installError diff --git a/admin/admin_general_inc.php b/admin/admin_general_inc.php index 672ee4c..a9b306a 100644 --- a/admin/admin_general_inc.php +++ b/admin/admin_general_inc.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_general_inc.php,v 1.2 2005/08/01 18:40:34 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_general_inc.php,v 1.3 2005/08/24 20:52:15 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. @@ -45,6 +45,7 @@ if ($processForm) { } $pref_simple_values = array( + "site_menu_title", "maxRecords", "urlIndex", ); diff --git a/admin/admin_menu_options_inc.php b/admin/admin_menu_options_inc.php index b4556f6..7a0bb95 100644 --- a/admin/admin_menu_options_inc.php +++ b/admin/admin_menu_options_inc.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_menu_options_inc.php,v 1.2 2005/08/01 18:40:34 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_menu_options_inc.php,v 1.3 2005/08/24 20:52:15 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. @@ -28,8 +28,8 @@ if (!isset($_REQUEST["menu_id"])) { $maxPos = $menulib->get_max_option($_REQUEST["menu_id"]); $gBitSmarty->assign('menu_id', $_REQUEST["menu_id"]); -$menu_info = $menulib->get_menu($_REQUEST["menu_id"]); -$gBitSmarty->assign('menu_info', $menu_info); +$admmenu_info = $menulib->get_menu($_REQUEST["menu_id"]); +$gBitSmarty->assign('admmenu_info', $admmenu_info); if (!isset($_REQUEST["option_id"])) { $_REQUEST["option_id"] = 0; @@ -105,13 +105,13 @@ if (isset($_REQUEST["find"])) { $gBitSmarty->assign('find', $find); $gBitSmarty->assign_by_ref('sort_mode', $sort_mode); -$allchannels = $menulib->list_menu_options($_REQUEST["menu_id"], 0, -1, $sort_mode, $find); -$channels = $menulib->list_menu_options($_REQUEST["menu_id"], $offset, $maxRecords, $sort_mode, $find, true); -$cant_pages = ceil($channels["cant"] / $maxRecords); +$allmoptions = $menulib->list_menu_options($_REQUEST["menu_id"], 0, -1, $sort_mode, $find); +$admmoptions = $menulib->list_menu_options($_REQUEST["menu_id"], $offset, $maxRecords, $sort_mode, $find, true); +$cant_pages = ceil($admmoptions["cant"] / $maxRecords); $gBitSmarty->assign_by_ref('cant_pages', $cant_pages); $gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); -if ($channels["cant"] > ($offset + $maxRecords)) { +if ($admmoptions["cant"] > ($offset + $maxRecords)) { $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { $gBitSmarty->assign('next_offset', -1); @@ -124,8 +124,8 @@ if ($offset > 0) { $gBitSmarty->assign('prev_offset', -1); } -$gBitSmarty->assign_by_ref('channels', $channels["data"]); -$gBitSmarty->assign_by_ref('allchannels', $allchannels["data"]); +$gBitSmarty->assign_by_ref('admmoptions', $admmoptions["data"]); +$gBitSmarty->assign_by_ref('allmoptions', $allmoptions["data"]); ?> diff --git a/admin/admin_menus_inc.php b/admin/admin_menus_inc.php index 9400084..c30b23b 100644 --- a/admin/admin_menus_inc.php +++ b/admin/admin_menus_inc.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_menus_inc.php,v 1.2 2005/08/01 18:40:34 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_kernel/admin/Attic/admin_menus_inc.php,v 1.3 2005/08/24 20:52:15 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. @@ -92,13 +92,13 @@ if (isset($_REQUEST["find"])) { $gBitSmarty->assign('find', $find); $gBitSmarty->assign_by_ref('sort_mode', $sort_mode); -$channels = $menulib->list_menus($offset, $maxRecords, $sort_mode, $find); +$menus = $menulib->list_menus($offset, $maxRecords, $sort_mode, $find); -$cant_pages = ceil($channels["cant"] / $maxRecords); +$cant_pages = ceil($menus["cant"] / $maxRecords); $gBitSmarty->assign_by_ref('cant_pages', $cant_pages); $gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); -if ($channels["cant"] > ($offset + $maxRecords)) { +if ($menus["cant"] > ($offset + $maxRecords)) { $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { $gBitSmarty->assign('next_offset', -1); @@ -111,7 +111,7 @@ if ($offset > 0) { $gBitSmarty->assign('prev_offset', -1); } -$gBitSmarty->assign_by_ref('channels', $channels["data"]); +$gBitSmarty->assign_by_ref('menus', $menus["data"]); diff --git a/admin/db_performance.php b/admin/db_performance.php index ba079ca..cfe2261 100644 --- a/admin/db_performance.php +++ b/admin/db_performance.php @@ -28,6 +28,6 @@ For more information, see the <a href="http://phplens.com/lens/adodb/docs-perf.h </p> <?php - $perf =& NewPerfMonitor( $gBitSystem->mDb ); + $perf =& NewPerfMonitor( $gBitSystem->mDb->mDb ); $perf->UI($pollsecs=5); ?> diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 3a69452..7ada715 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -41,9 +41,7 @@ array( 'QUERY' => "INSERT INTO `".BIT_DB_PREFIX."tiki_layouts_modules` ( `moduleId`, `availability`, `title`, `cache_time`, `rows`, `params`, `groups` ) VALUES ( 2, NULL, NULL, NULL, NULL, NULL, '-1' )", "INSERT INTO `".BIT_DB_PREFIX."tiki_layouts` (`userId`, `moduleId`, `position`, `ord`, `layout`) VALUES (1, 1, 'r', 1, 'kernel')", "INSERT INTO `".BIT_DB_PREFIX."tiki_layouts` (`userId`, `moduleId`, `position`, `ord`, `layout`) VALUES (1, 2, 'l', 1, 'kernel')", -"INSERT INTO `".BIT_DB_PREFIX."tiki_preferences` ( `name`, `value` ) VALUES ( 'feature_top_bar_dropdown', 'y' )", "DELETE FROM `".BIT_DB_PREFIX."tiki_preferences` WHERE `value` LIKE 'tiki-%.php%'", -"UPDATE `".BIT_DB_PREFIX."tiki_preferences` SET `value`='native' WHERE `name`='style'", )), ), @@ -80,7 +78,8 @@ array( 'RENAMECOLUMN' => array( 'tiki_programmed_content' => array( '`pId`' => '`p_id` I4 AUTO', '`contentId`' => '`content_id` I4', '`publishDate`' => '`publish_date` I8' ), - 'sessions' => array( '`data`' => '`session_data` X' ), +// Appears to be giving errors - wolff_borg 20050812 +// 'sessions' => array( '`data`' => '`session_data` X' ), )), array( 'ALTER' => array( @@ -97,6 +96,10 @@ array( 'ALTER' => array( array( 'QUERY' => array( 'SQL92' => array( "UPDATE `".BIT_DB_PREFIX."tiki_module_map` SET `module_rsrc` = replace( `module_rsrc`, 'tikipackage', 'bitpackage' )", + "UPDATE `".BIT_DB_PREFIX."tiki_preferences` SET `value`='native' WHERE `name`='style'", + "DELETE FROM `".BIT_DB_PREFIX."tiki_preferences` WHERE `name`='tikiIndex'", + "INSERT INTO `".BIT_DB_PREFIX."tiki_preferences` ( `name`, `value` ) VALUES ( 'bitIndex', 'wiki' )", + "INSERT INTO `".BIT_DB_PREFIX."tiki_preferences` ( `name`, `value` ) VALUES ( 'feature_top_bar_dropdown', 'y' )", ) )), diff --git a/array_fill.func.php b/array_fill.func.php index 155f6a3..6100622 100644 --- a/array_fill.func.php +++ b/array_fill.func.php @@ -11,12 +11,14 @@ /** * array_fill */ -function array_fill($iStart, $iLen, $vValue) { - $aResult = array(); - for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) { - $aResult[$iCount] = $vValue; - } - return $aResult; +if( !function_exists( 'array_fill' ) ) { + function array_fill($iStart, $iLen, $vValue) { + $aResult = array(); + for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) { + $aResult[$iCount] = $vValue; + } + return $aResult; + } } ?> diff --git a/menu_lib.php b/menu_lib.php index ce8b459..44f7417 100644 --- a/menu_lib.php +++ b/menu_lib.php @@ -3,7 +3,7 @@ * Menu Management Library * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/menu_lib.php,v 1.4 2005/08/07 17:38:45 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/menu_lib.php,v 1.5 2005/08/24 20:52:14 squareing Exp $ */ /** @@ -183,6 +183,7 @@ class MenuLib extends BitBase { } +global $menulib; $menulib = new MenuLib(); ?> diff --git a/menu_register_inc.php b/menu_register_inc.php index d54cff2..a16da6a 100644 --- a/menu_register_inc.php +++ b/menu_register_inc.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_kernel/menu_register_inc.php,v 1.4 2005/08/01 18:40:33 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/menu_register_inc.php,v 1.5 2005/08/24 20:52:14 squareing Exp $ * @package kernel * @subpackage functions * @@ -16,7 +16,8 @@ // =========================== My =========================== if( $gBitUser->isValid() ) { - $gBitSystem->registerAppMenu( 'users', 'My '.$gBitSystem->getPreference('siteTitle', 'bitweaver'), ($gBitSystem->getPreference('feature_userPreferences') == 'y' ? USERS_PKG_URL.'my.php':''), 'bitpackage:users/menu_users.tpl' ); + $displayTitle = !empty( $gBitSystem->mPrefs['site_menu_title'] ) ? $gBitSystem->mPrefs['site_menu_title'] : $gBitSystem->getPreference( 'siteTitle', 'Site' ); + $gBitSystem->registerAppMenu( 'users', 'My '.$displayTitle, ($gBitSystem->getPreference('feature_userPreferences') == 'y' ? USERS_PKG_URL.'my.php':''), 'bitpackage:users/menu_users.tpl' ); } // =========================== Admin menu =========================== diff --git a/mod_lib.php b/mod_lib.php index d3715bd..2012b02 100644 --- a/mod_lib.php +++ b/mod_lib.php @@ -3,7 +3,7 @@ * Modules Management Library * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/mod_lib.php,v 1.6 2005/08/11 13:03:45 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/Attic/mod_lib.php,v 1.7 2005/08/24 20:52:14 squareing Exp $ */ /** @@ -184,23 +184,23 @@ class ModLib extends BitBase { } function assignModule( $pModuleId, $pUserId, $pLayout, $pPosition, $pOrder = 0, $securityOK = FALSE ) { - global $bit_p_admin, $gBitUser; + global $gBitUser; // security check - if( ($bit_p_admin || $securityOK || ( $gBitUser->mUserId==$pUserId )) && is_numeric( $pModuleId ) ) { + if( ($gBitUser->isAdmin() || $securityOK || ( $gBitUser->mUserId==$pUserId )) && is_numeric( $pModuleId ) ) { $this->unassignModule( $pModuleId, $pUserId, $pLayout ); $query = "INSERT INTO `".BIT_DB_PREFIX."tiki_layouts` (`user_id`, `module_id`, `layout`, `position`, `ord`) VALUES(?,?,?,?,?)"; $result = $this->mDb->query( $query, array( $pUserId, (int)$pModuleId, $pLayout, $pPosition, $pOrder ) ); } } - + function removeAllLayoutModules( $pUserId = NULL, $pLayout = NULL, $securityOK = FALSE) { - global $bit_p_admin, $gBitUser; - if ( ($bit_p_admin || $securityOK || ( $gBitUser->mUserId == $pUserId )) && ($pUserId && $pLayout)) { + global $gBitUser; + if ( ($gBitUser->isAdmin() || $securityOK || ( $gBitUser->mUserId == $pUserId )) && ($pUserId && $pLayout)) { $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_layouts` WHERE `user_id` = ? AND `layout` = ?"; $result = $this->mDb->query( $query, array($pUserId, $pLayout)); } } - + function unassignModule( $pModuleId, $pUserId = NULL, $pLayout = NULL ) { global $gBitUser; global $gQueryUser; @@ -350,7 +350,7 @@ class ModLib extends BitBase { } $allGroupNames = array(); foreach( array_keys( $allGroups ) as $groupId ) { - array_push( $allGroupNames, $allGroups[$groupId] ); + $allGroupNames["$groupId"] = $allGroups[$groupId]["group_name"]; } if( $modGroups = @unserialize( $result->fields["groups"] ) ) { foreach( $modGroups as $groupName ) { @@ -363,7 +363,7 @@ class ModLib extends BitBase { $result->fields["groups"] = trim( $result->fields["groups"] ); if( !empty( $result->fields["groups"] ) ) { - $result->fields["groups"] = explode( $result->fields["groups"], ' ' ); + $result->fields["groups"] = explode( ' ', $result->fields["groups"] ); } if ( $gBitUser->isAdmin() || !empty( $result->fields['groups'] ) || (is_array($result->fields['groups']) && in_array($gBitUser->mGroups, $result->fields['groups'])) ) { array_push( $ret[$subArray], $result->fields ); diff --git a/modules/help_mod_time.tpl b/modules/help_mod_time.tpl new file mode 100644 index 0000000..567e069 --- /dev/null +++ b/modules/help_mod_time.tpl @@ -0,0 +1,28 @@ +{tr}<strong>Summary</strong>: Display a flash clock.{/tr}<br /> +<table class="data"> + <tr> + <th style="width:20%;">{tr}Parameter{/tr}</th> + <th style="width:20%;">{tr}Value{/tr}</th> + <th style="width:60%;">{tr}Description{/tr}</th> + </tr> + <tr class="odd"> + <td>width</td> + <td>( {tr}numeric{/tr} )</td> + <td>{tr}Set the width of the clock using pixels. Defaults to the column width.{/tr}</td> + </tr> + <tr class="even"> + <td>height</td> + <td>( {tr}numeric{/tr} )</td> + <td>{tr}Set the height of the clock using pixels.{/tr}</td> + </tr> + <tr class="odd"> + <td>background</td> + <td>( {tr}string{/tr} )</td> + <td>{tr}You can override the default white background by specifying it here with a color name (e.g.: blue, green) or using a web standard hex value (e.g.: #B32F69).{/tr}</td> + </tr> + <tr class="even"> + <td>src</td> + <td>( {tr}url{/tr} )<br />text<br />javascript</td> + <td>{tr}You can get an embed source from e.g.: <a href="http://www.colclocks.com/FlashClocks/index.html">Colclocks</a>. You need to insert the full URL. If this is set to <strong>text</strong> or <strong>javascript</strong>, a plain text or javascript clock will be shown.{/tr}</td> + </tr> +</table> diff --git a/modules/mod_package_menu.php b/modules/mod_package_menu.php index 9706de4..010e27d 100644 --- a/modules/mod_package_menu.php +++ b/modules/mod_package_menu.php @@ -13,4 +13,8 @@ if( ACTIVE_PACKAGE == 'messu' ) { if( !empty( $gBitSystem->mAppMenu[$active]['template'] ) ) { $gBitSmarty->assign( 'packageMenu', $gBitSystem->mAppMenu[$active] ); } + +if( empty( $module_title ) ) { + $gBitSmarty->assign( 'moduleTitle', ucfirst( constant( strtoupper( ACTIVE_PACKAGE ).'_PKG_NAME' ) ) ); +} ?> diff --git a/modules/mod_time.php b/modules/mod_time.php new file mode 100644 index 0000000..44955f8 --- /dev/null +++ b/modules/mod_time.php @@ -0,0 +1,16 @@ +<?php +/** + * $Header: /cvsroot/bitweaver/_bit_kernel/modules/mod_time.php,v 1.2 2005/08/24 20:52:15 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 + * + * @package kernel + * @subpackage modules + */ + +if( !empty( $module_params ) ) { + $gBitSmarty->assign( 'modParams', $module_params ); +} +?> diff --git a/modules/mod_time.tpl b/modules/mod_time.tpl new file mode 100644 index 0000000..75a6313 --- /dev/null +++ b/modules/mod_time.tpl @@ -0,0 +1,56 @@ +{bitmodule title="$moduleTitle" name="clock"} + <div style="text-align:center;"> + {if $modParams.src eq 'text'} + {$smarty.now|bit_short_time} + {elseif $modParams.src eq 'javascript'} + {literal} + <div id="js_clock" style="height:2.4em;font-family:monospace;"> + <script type="text/javascript"> + //<![CDATA[ + function js_clock(){ + var clock_time = new Date(); + var clock_hours = clock_time.getHours(); + var clock_minutes = clock_time.getMinutes(); + var clock_seconds = clock_time.getSeconds(); + if (clock_hours < 10){clock_hours = "0" + clock_hours;} + if (clock_minutes < 10){clock_minutes = "0" + clock_minutes;} + if (clock_seconds < 10){clock_seconds = "0" + clock_seconds;} + var clock_div = document.getElementById('js_clock'); + clock_div.innerHTML = clock_hours + ":" + clock_minutes + ":" + clock_seconds; + setTimeout("js_clock()", 1000); + } + js_clock(); + //]]> + </script> + </div> + {/literal} + {elseif $modParams.src eq 'javascript12'} + {literal} + <div id="js_clock" style="font-family:monospace;"> + <script type="text/javascript"> + //<![CDATA[ + function js_clock(){ + var clock_time = new Date(); + var clock_hours = clock_time.getHours(); + var clock_minutes = clock_time.getMinutes(); + var clock_seconds = clock_time.getSeconds(); + var clock_suffix = "AM"; + if (clock_hours > 11){clock_suffix = "PM";clock_hours = clock_hours - 12;} + if (clock_hours == 0){clock_hours = 12;} + if (clock_hours < 10){clock_hours = "0" + clock_hours;} + if (clock_minutes < 10){clock_minutes = "0" + clock_minutes;} + if (clock_seconds < 10){clock_seconds = "0" + clock_seconds;} + var clock_div = document.getElementById('js_clock'); + clock_div.innerHTML = clock_hours + ":" + clock_minutes + ":" + clock_seconds + " " + clock_suffix; + setTimeout("js_clock()", 1000); + } + js_clock(); + //]]> + </script> + </div> + {/literal} + {else} + <embed {if $modParams.width or $modParams.height}style="width:{$modParams.width}px;height:{$modParams.height}px;"{/if} src="{$modParams.src|default:"http://www.internettime.com/Learning/relog.swf"}" quality="high" wmode="transparent" bgcolor="{$modParams.color|default:"#ffffff"}" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> + {/if} + </div> +{/bitmodule} diff --git a/smarty_bit/block.form.php b/smarty_bit/block.form.php index 4e9bf58..d2558f2 100644 --- a/smarty_bit/block.form.php +++ b/smarty_bit/block.form.php @@ -51,7 +51,7 @@ function smarty_block_form($params, $content, &$gBitSmarty) { } } if( !isset( $url ) ) { - $url = $_SERVER['PHP_SELF']; + $url = $_SERVER['REQUEST_URI']; } $ret = '<form action="'.$url.'" '.$atts.'>'; $ret .= isset( $legend ) ? '<fieldset>'.$legend : '<div>'; // adding the div makes it easier to be xhtml compliant diff --git a/smarty_bit/function.biticon.php b/smarty_bit/function.biticon.php index 789033c..13b8441 100644 --- a/smarty_bit/function.biticon.php +++ b/smarty_bit/function.biticon.php @@ -3,6 +3,7 @@ * Smarty plugin * @package Smarty * @subpackage plugins + * @link http://www.bitweaver.org/wiki/function_biticon function_biticon */ /** @@ -42,33 +43,36 @@ function get_first_match($dir,$filename) function output_icon($params, $file) { global $gBitSystem; + $iexplain = isset( $params["iexplain"] ) ? tra( $params["iexplain"] ) : 'please set iexplain'; + if( isset( $params["url"] ) ) { $outstr = $file; } else { if( $gBitSystem->getPreference( 'biticon_display' ) == 'text' && $params['iforce'] != 'icon' ) { - $outstr = isset( $params["iexplain"] ) ? tra($params["iexplain"]) : 'please set iexplain'; + $outstr = $iexplain; } else { $outstr="<img src=\"".$file."\""; - if(isset($params["iexplain"])) { - $outstr=$outstr." alt=\"".tra($params["iexplain"])."\" title=\"".tra($params["iexplain"])."\""; + if( isset( $params["iexplain"] ) ) { + $outstr .= " alt=\"".tra( $params["iexplain"] )."\" title=\"".tra($params["iexplain"])."\""; } else { - $outstr=$outstr." alt=\"\""; + $outstr .= " alt=\"\""; } foreach ($params as $name => $val) { if($name != "ipackage" && $name != "ipath" && $name != "iname" && $name != "iexplain" && $name != "iforce") { - $outstr = $outstr." ".$name."=\"".$val."\""; + $outstr .= " ".$name."=\"".$val."\""; } } if(!isset($params["class"])) { - $outstr=$outstr." class=\"icon\""; + $outstr .= " class=\"icon\""; } - $outstr = $outstr." />"; + $outstr .= " />"; } - if( $gBitSystem->getPreference( 'biticon_display' ) == 'icon_text' && $params['iforce'] != 'icon' ) { - $outstr .= ' '.isset( $params["iexplain"] ) ? tra($params["iexplain"]) : 'please set iexplain'; + + if( $gBitSystem->getPreference( 'biticon_display' ) == 'icon_text' && $params['iforce'] != 'icon' || $params['iforce'] == 'icon_text' ) { + $outstr .= ' '.$iexplain; } } return $outstr; @@ -79,7 +83,7 @@ function output_icon($params, $file) { */ function smarty_function_biticon($params, &$gBitSmarty) { global $gBitSystem, $icon_style; - + if (!isset($params['ipath'])) $params['ipath'] = ''; @@ -107,7 +111,7 @@ function smarty_function_biticon($params, &$gBitSmarty) { $ret = output_icon($params, BIT_ROOT_URL."themes/force/icons/".$params['ipackage'].'/'.$params['ipath'].$matchFile); return $ret; } - + //if we have site styles, look there if (false !== ($matchFile = get_first_match( $gBitSystem->getStylePath().'/icons/'.$params['ipackage']."/".$params['ipath'],$params['iname']))) { return output_icon($params, $gBitSystem->getStyleUrl().'/icons/'.$params['ipackage']."/".$params['ipath'].$matchFile); diff --git a/smarty_bit/function.formhelp.php b/smarty_bit/function.formhelp.php index 34330d0..121bf46 100644 --- a/smarty_bit/function.formhelp.php +++ b/smarty_bit/function.formhelp.php @@ -38,6 +38,7 @@ function smarty_function_formhelp( $params, &$gBitSmarty ) { switch( $key ) { case 'note': case 'link': + case 'label': case 'page': case 'package': case 'install': diff --git a/smarty_bit/function.libertypagination.php b/smarty_bit/function.libertypagination.php index e7d4b65..c353584 100644 --- a/smarty_bit/function.libertypagination.php +++ b/smarty_bit/function.libertypagination.php @@ -1,28 +1,37 @@ <?php /** - * Smarty plugin + * Smarty {libertypagination} function plugin + * + * This provides a means of paging through longer lists of data using an up and down arrow. + * In addition, if the 'direct_pagination' feature is enabled, then a direct page number can be entered jump directly to + * + * Type: function<br> + * Name: libertypagination<br> + * Input:<br> + * - numPages Number of pages in total<br> + * - page current page<br> + * - pgnName (optional) parameter name used by script to find page you're on. defaults to page<br> + * - ianchor (optional) set an anchor<br> + * - ihash (optional) you can pass in all the above as an array called ihash or secondary * items common to all links<br> + * The ihash option allow the inclusion of additional link values as provided for smartlink navigation<br> + * Output: url of the form: $PHP_SELF?attribute1=value1&attribute2=value2 + * * @package Smarty * @subpackage plugins + * @link http://www.bitweaver.org/wiki/function_libertypagination function.libertypagination */ /** * Smarty {libertypagination} function plugin - * - * Type: function - * Name: libertypagination - * Input: numPages Number of pages in total - * page current page - * pgnName (optional) parameter name used by script to find page you're on. defaults to page - * ianchor (optional) set an anchor - * Output: url of the form: $PHP_SELF?attribute1=value1&attribute2=value2 */ - function smarty_function_libertypagination($params, &$gBitSmarty) { - if( isset( $params['hash'] ) && is_array( $params['hash'] ) ) { - $params = $params['hash']; + if( isset( $params['ihash'] ) && is_array( $params['ihash'] ) ) { + $params = array_merge( $params['ihash'], $params ); + $params['ihash'] = NULL; } if( isset( $params['url'] ) ) { + $urlParams = ''; parse_str( preg_replace( "/.*\?/", "", $params['url'] ), $urlParams ); $params = array_merge( $urlParams, $params ); } @@ -36,7 +45,6 @@ function smarty_function_libertypagination($params, &$gBitSmarty) { $pgnHidden[$form_param] = $form_val; } } - $pgnVars .= ( !empty( $params['ianchor'] ) ? '#'.$params['ianchor'] : '' ); for( $pageCount = 1; $pageCount < $params['numPages']+1; $pageCount++ ) { diff --git a/smarty_bit/function.menu.php b/smarty_bit/function.menu.php index 2a9633c..4e5ad3f 100644 --- a/smarty_bit/function.menu.php +++ b/smarty_bit/function.menu.php @@ -6,6 +6,11 @@ */ /** + * required setup + */ +include_once( KERNEL_PKG_PATH . 'menu_lib.php' ); + +/** * smarty_function_menu */ function smarty_function_menu($params, &$gBitSmarty) @@ -19,9 +24,9 @@ function smarty_function_menu($params, &$gBitSmarty) return; } $menu_info = $menulib->get_menu($id); - $channels = $menulib->list_menu_options($id,0,-1,'position_asc',''); + $moptions = $menulib->list_menu_options($id,0,-1,'position_asc',''); $gBitSmarty->assign('menu_info',$menu_info); - $gBitSmarty->assign('channels',$channels["data"]); + $gBitSmarty->assign('moptions',$moptions["data"]); $gBitSmarty->display('bitpackage:users/user_menu.tpl'); } diff --git a/smarty_bit/function.pagination.php b/smarty_bit/function.pagination.php index 071e1b7..1669221 100644 --- a/smarty_bit/function.pagination.php +++ b/smarty_bit/function.pagination.php @@ -1,17 +1,18 @@ <?php /** - * Smarty plugin + * Smarty {pagination} function plugin * @package Smarty * @subpackage plugins + * @link http://www.bitweaver.org/wiki/function_pagination function_pagination */ /** * Smarty {pagination} function plugin * - * Type: function - * Name: pagination - * Input: - * - <attribute>=<value> (optional) - pass in any attributes and they will be added to the pagination string + * Type: function<br> + * Name: pagination<br> + * Input:<br> + * - <attribute>=<value> (optional) - pass in any attributes and they will be added to the pagination string<br> * Output: url of the form: $PHP_SELF?attribute1=value1&attribute2=value2 */ function smarty_function_pagination( $params, &$gBitSmarty ) { @@ -25,7 +26,7 @@ function smarty_function_pagination( $params, &$gBitSmarty ) { $pgnHidden[$form_param] = $form_val; } $gBitSmarty->assign( 'pgnVars', $pgnVars ); - + $gBitSmarty->assign( 'pgnHidden', $pgnHidden ); $gBitSmarty->display('bitpackage:kernel/pagination.tpl'); } ?> diff --git a/smarty_bit/function.smartlink.php b/smarty_bit/function.smartlink.php index 4a80b87..a5df811 100644 --- a/smarty_bit/function.smartlink.php +++ b/smarty_bit/function.smartlink.php @@ -4,46 +4,49 @@ * @package Smarty * @subpackage plugins * @author xing <xing$synapse.plus.com> + * @link http://www.bitweaver.org/wiki/function_smartlink function.smartlink */ /** * Smarty {smartlink} function plugin * - * Type: function - * Name: smartlink - * Input: - * - ititle (required) words that are displayed - * - ianchor (optional) set the anchor where the link should point to - * - isort (optional) name of the sort column without the orientation (e.g.: title) - * - isort_mode(optional) this can be used to manually pass the sort mode to smartlink - * overrides the value given in $_REQUEST['sort_mode'], which is the default - * - iorder (optional) if set to asc or desc, it sets the default sorting order of this particular column - * asc is default - * - idefault (optional) if set, it will highlight this link if no $isort_mode is given - * this should only be set once per sorting group since it represents the default sorting column - * - itype (optional) can be set to - * url --> outputs only url - * li --> outputs link as <li><a ... ></li> - * - ionclick (optional) pass in any actions that should occur onclick - * - ibiticon (optional) if you want to display an icon instead of text use ibiticon - * format is: '<ipackage>/<iname>' - * e.g.: 'liberty/edit' + * Type: function<br> + * Name: smartlink<br> + * Input:<br> + * - ititle (required) words that are displayed<br> + * - ianchor (optional) set the anchor where the link should point to<br> + * - isort (optional) name of the sort column without the orientation (e.g.: title)<br> + * - isort_mode(optional) this can be used to manually pass the sort mode to smartlink<br> + * overrides the value given in $_REQUEST['sort_mode'], which is the default<br> + * - iorder (optional) if set to asc or desc, it sets the default sorting order of this particular column<br> + * asc is default<br> + * - idefault (optional) if set, it will highlight this link if no $isort_mode is given<br> + * this should only be set once per sorting group since it represents the default sorting column<br> + * - itype (optional) can be set to<br> + * url --> outputs only url<br> + * li --> outputs link as <li><a ... ></li><br> + * - ionclick (optional) pass in any actions that should occur onclick<br> + * - ibiticon (optional) if you want to display an icon instead of text use ibiticon<br> + * format is: '<ipackage>/<iname>'<br> + * e.g.: 'liberty/edit'<br> + * - iforce (optional) pass iforce parameter through to biticon * - iurl (optional) pass in a full url - * - ifile (optional) set the file where the link should point (default is the current file) - * - ipackage (optional) set the package the link should point to (default is the current package) - * - * (optional) anything else that gets added to the pile of items is appended using &$key=$val - * - ihash (optional) you can pass in all the above as an array called ihash + * - ifile (optional) set the file where the link should point (default is the current file)<br> + * - ipackage (optional) set the package the link should point to (default is the current package)<br> + * - * (optional) anything else that gets added to the pile of items is appended using &$key=$val<br> + * - ihash (optional) you can pass in all the above as an array called ihash or secondary * items common to all links<br> * Output: any kind of link. especially useful when it comes to links used to sort a table, due to the simplified syntax and loss of cumbersome if clauses - * also useful if the you want to display an icon as link since smartlink takes biticon parameters - * Example - {smartlink ititle="Page Name" isort="title"} - * - {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() + * also useful if the you want to display an icon as link since smartlink takes biticon parameters<br> + * Example - {smartlink ititle="Page Name" isort="title"}<br> + * - {smartlink ititle="Page Name" isort="title" iorder="desc" idefault=1}<br> + * setting iorder and idefault here, makes this link sort in a descending order by default (iorder)<br> + * and it is highlighted when $isort_mode ( or $_REQUEST['sort_mode'] ) is not set (idefault)<br> + * Note Don't use this plugin if ititle is generated dynamically since it is passed through tra()<br> */ function smarty_function_smartlink( $params, &$gBitSmarty ) { if( !empty( $params['ihash'] ) ) { - $hash = &$params['ihash']; + $hash = array_merge( $params['ihash'], $params ); + $hash['ihash'] = NULL; } else { // maybe params were passed in separately $hash = &$params; @@ -142,6 +145,9 @@ function smarty_function_smartlink( $params, &$gBitSmarty ) { 'iname' => $tmp[1], 'iexplain' => $hash['ititle'], ); + if( !empty( $hash['iforce'] ) ) { + $ibiticon['iforce'] = $hash['iforce']; + } $ret .= smarty_function_biticon( $ibiticon, $gBitSmarty ); } else { $ret .= tra( $hash['ititle'] ); diff --git a/templates/admin_general.tpl b/templates/admin_general.tpl index 4506b54..759680b 100644 --- a/templates/admin_general.tpl +++ b/templates/admin_general.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/Attic/admin_general.tpl,v 1.2 2005/07/17 17:36:06 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_kernel/templates/Attic/admin_general.tpl,v 1.3 2005/08/24 20:52:15 squareing Exp $ *} {strip} {form} <input type="hidden" name="page" value="{$page}" /> @@ -84,6 +84,14 @@ {jstab title="Miscellaneous"} {legend legend="Miscellaneous Settings"} <div class="row"> + {formlabel label="Menu Title" for="site_menu_title"} + {forminput} + <input size="40" type="text" name="site_menu_title" id="site_menu_title" value="{$gBitSystemPrefs.site_menu_title|escape}" /> + {formhelp note="Override the default home page link name in the top menu bar."} + {/forminput} + </div> + + <div class="row"> {formlabel label="Maximum number of records in listings" for="maxRecords"} {forminput} <input size="5" type="text" name="maxRecords" id="maxRecords" value="{$gBitSystemPrefs.maxRecords|escape}" /> diff --git a/templates/admin_layout.tpl b/templates/admin_layout.tpl index 05d7c2c..bc528b5 100644 --- a/templates/admin_layout.tpl +++ b/templates/admin_layout.tpl @@ -29,16 +29,16 @@ {/if} <div style="text-align:center;"> - {smartlink ititle="Up" ibiticon="liberty/move_up" page=layout fMove=up fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} + {smartlink ititle="Up" ibiticon="liberty/move_up" iforce="icon" page=layout fMove=up fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} - {smartlink ititle="Down" ibiticon="liberty/move_down" page=layout fMove=down fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} + {smartlink ititle="Down" ibiticon="liberty/move_down" iforce="icon" page=layout fMove=down fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} {if $colkey ne 'center'} - {smartlink ititle="Move to Right" ibiticon="liberty/move_$colkey" page=layout fMove=$colkey fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} + {smartlink ititle="Move to Right" ibiticon="liberty/move_$colkey" iforce="icon" page=layout fMove=$colkey fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} {/if} {if $column[ix].type ne 'P'} - {smartlink ititle="Unassign" ibiticon="liberty/delete_small" ionclick="return confirm('Are you sure you want to remove `$layout.$area[ix].name`?');" page=layout fMove=unassign fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} + {smartlink ititle="Unassign" ibiticon="liberty/delete_small" iforce=icon ionclick="return confirm('Are you sure you want to remove `$layout.$area[ix].name`?');" page=layout fMove=unassign fPackage=$fPackage fModule=`$layout.$area[ix].module_id`} {/if} </div> </td> @@ -56,7 +56,7 @@ </tr> </table> -{form legend="Select Section"} +{form action=$smarty.server.PHP_SELF legend="Select Section"} <input type="hidden" name="page" value="{$page}" /> <div class="row"> {formlabel label="Create Customized layout for" for="fPackage"} @@ -80,7 +80,7 @@ {jstabs} {jstab title="Assign column module"} - {form legend="Assign column module"} + {form action=$smarty.server.PHP_SELF legend="Assign column module"} <input type="hidden" name="page" value="{$page}" /> <input type="hidden" name="fPackage" value="{$fPackage}" /> <div class="row"> @@ -153,7 +153,7 @@ {formlabel label="Parameters" for="params"} {forminput} <input type="text" name="fAssign[params]" id="params" value="{$fAssign.params|escape}" /> - {formhelp note="Here you can enter any additional parameters the module might need. Use the http query string form, e.g. foo=123&bar=ABC (optional)"} + {formhelp note="Here you can enter any additional parameters the module might need. Use the http query string form, e.g. foo=123&bar=ABC (optional)"} {/forminput} </div> @@ -183,7 +183,7 @@ {/jstab} {jstab title="Assign center piece"} - {form legend="Assign center piece"} + {form action=$smarty.server.PHP_SELF legend="Assign center piece"} <input type="hidden" name="page" value="{$page}" /> <input type="hidden" name="fPackage" value="{$fPackage}" /> <input type="hidden" name="fAssign[pos]" value="c" /> @@ -270,7 +270,7 @@ {/jstab} {jstab title="Miscellaneous Settigns"} - {form legend="Miscellaneous Settigns"} + {form action=$smarty.server.PHP_SELF legend="Miscellaneous Settigns"} <input type="hidden" name="page" value="{$page}" /> {foreach from=$formMiscFeatures key=feature item=output} <div class="row"> @@ -291,12 +291,15 @@ <h1>{tr}Modules Help{/tr}</h1> {formhelp note="Below you can find information on what modules do and what parameters they take. If a module is not listed, the module probably doesn't take any special parameters." page="ModuleParameters"} +<noscript><div>{smartlink ititle="Expand Help" page=$page expand_all=1}</div></noscript> {foreach from=$allModulesHelp key=package item=help} - <h2>{$package}</h2> - {foreach from=$help key=file item=title} - {box title=$title} - {include file=$file} - {/box} - {/foreach} + <h2><a href="javascript:flip('id{$package}')">{$package}</a></h2> + <div id="id{$package}" {if !$smarty.request.expand_all}style="display:none;"{/if}> + {foreach from=$help key=file item=title} + {box title=$title} + {include file=$file} + {/box} + {/foreach} + </div> {/foreach} {/strip} diff --git a/templates/admin_menu_options.tpl b/templates/admin_menu_options.tpl index cbde053..fbce157 100644 --- a/templates/admin_menu_options.tpl +++ b/templates/admin_menu_options.tpl @@ -3,8 +3,8 @@ <table> <tr> <td style="vertical-align:top;"> - {box title="`$menu_info.name`"} - {include file="bitpackage:users/user_menu.tpl" channels=$allchannels} + {box title="`$admmenu_info.name`"} + {include file="bitpackage:users/user_menu.tpl" moptions=$allmoptions menu_info=$admmenu_info} {/box} </td> <td style="vertical-align:top;"> @@ -100,19 +100,19 @@ <th>{tr}Action{/tr}</th> </tr> {cycle values="even,odd" print=false} - {section name=user loop=$channels} + {section name=user loop=$admmoptions} <tr class="{cycle}"> - <td>{$channels[user].menu_id}</td> - <td>{$channels[user].position}</td> - <td>{$channels[user].name}</td> - <td>{$channels[user].url}</td> - <td>{$channels[user].type}</td> - <td>{$channels[user].section}</td> - <td>{$channels[user].perm}</td> - <td>{$channels[user].groupname}</td> + <td>{$admmoptions[user].menu_id}</td> + <td>{$admmoptions[user].position}</td> + <td>{$admmoptions[user].name}</td> + <td>{$admmoptions[user].url}</td> + <td>{$admmoptions[user].type}</td> + <td>{$admmoptions[user].section}</td> + <td>{$admmoptions[user].perm}</td> + <td>{$admmoptions[user].groupname}</td> <td align="right"> - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&menu_id={$menu_id}&offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].option_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this menu item?{/tr}')" title="{tr}Delete this menu{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&menu_id={$menu_id}&offset={$offset}&sort_mode={$sort_mode}&option_id={$channels[user].option_id}" title="Edit this menu">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&menu_id={$menu_id}&offset={$offset}&sort_mode={$sort_mode}&remove={$admmoptions[user].option_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this menu item?{/tr}')" title="{tr}Delete this menu{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&menu_id={$menu_id}&offset={$offset}&sort_mode={$sort_mode}&option_id={$admmoptions[user].option_id}" title="Edit this menu">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> </td> </tr> {sectionelse} diff --git a/templates/admin_menus.tpl b/templates/admin_menus.tpl index fb25819..e84315b 100644 --- a/templates/admin_menus.tpl +++ b/templates/admin_menus.tpl @@ -1,14 +1,14 @@ {strip} - {jstabs} - {if $menu_id > 0} - {jstab title="Edit {$name} Menu"} - {else} - {jstab title="Create new Menu"} - {/if} - {if $menu_id > 0} - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}">{tr}Create new Menu{/tr}</a> - {/if} + {if $menu_id > 0} + {assign var=title value="Edit Menu"} + {else} + {assign var=title value="Create Menu"} + {/if} + {jstab title=$title} + {if $menu_id > 0} + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}">{tr}Create new Menu{/tr}</a> + {/if} {form legend="Edit/Create new Menu"} <input type="hidden" name="page" value="{$page}" /> <input type="hidden" name="menu_id" value="{$menu_id|escape}" /> @@ -59,17 +59,17 @@ </tr> {cycle values="even,odd" print=false} - {section name=user loop=$channels} + {section name=user loop=$menus} <tr class="{cycle}"> - <td>{$channels[user].menu_id}</td> - <td>{$channels[user].name}</td> - <td>{$channels[user].description}</td> - <td>{$channels[user].type}</td> - <td>{$channels[user].options}</td> + <td>{$menus[user].menu_id}</td> + <td>{$menus[user].name}</td> + <td>{$menus[user].description}</td> + <td>{$menus[user].type}</td> + <td>{$menus[user].options}</td> <td class="actionicon"> - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&offset={$offset}&sort_mode={$sort_mode}&menu_id={$channels[user].menu_id}" title="{tr}Edit this menu{/tr}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=menu_options&menu_id={$channels[user].menu_id}" title="{tr}Configure this menu{/tr}">{biticon ipackage=liberty iname="config" iexplain="configure"}</a> - <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].menu_id}" + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&offset={$offset}&sort_mode={$sort_mode}&menu_id={$menus[user].menu_id}" title="{tr}Edit this menu{/tr}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=menu_options&menu_id={$menus[user].menu_id}" title="{tr}Configure this menu{/tr}">{biticon ipackage=liberty iname="config" iexplain="configure"}</a> + <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&offset={$offset}&sort_mode={$sort_mode}&remove={$menus[user].menu_id}" onclick="return confirm('{tr}Are you sure you want to delete this menu?{/tr}')" title="{tr}Delete this menu{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a> </td> </tr> diff --git a/templates/menu_admin.tpl b/templates/menu_admin.tpl index 5480500..4f7e715 100644 --- a/templates/menu_admin.tpl +++ b/templates/menu_admin.tpl @@ -22,8 +22,6 @@ {/if} {/if}{if $gBitSystem->isFeatureActive( 'feature_chat' ) and $gBitUser->hasPermission( 'bit_p_admin_chat' )} <li><a class="item" href="{$smarty.const.CHAT_PKG_URL}admin/index.php">{tr}Chat{/tr}</a></li> -{/if}{if $gBitSystem->isPackageActive( 'categories' ) and $gBitUser->hasPermission( 'bit_p_admin_categories' )} - <li><a class="item" href="{$smarty.const.CATEGORIES_PKG_URL}admin/index.php">{tr}Categories{/tr}</a></li> {/if}{if $gBitSystem->isFeatureActive( 'feature_banners' ) and $gBitUser->hasPermission( 'bit_p_admin_banners' )} <li><a class="item" href="{$smarty.const.BANNERS_PKG_URL}admin/index.php">{tr}Banners{/tr}</a></li> {/if}{if $gBitSystem->isFeatureActive( 'feature_drawings' ) and $gBitUser->hasPermission( 'bit_p_admin_drawings' )} @@ -34,8 +32,6 @@ <li><a class="item" href="{$smarty.const.WEBMAIL_PKG_URL}admin/admin_mailin.php">{tr}Mail-in{/tr}</a></li> {/if}{if $gBitSystem->isFeatureActive( 'feature_html_pages' ) and $gBitUser->hasPermission( 'bit_p_edit_html_pages' )} <li><a class="item" href="{$smarty.const.HTML_PKG_URL}admin/admin_html_pages.php">{tr}HTML pages{/tr}</a></li> -{/if}{if $gBitSystem->isFeatureActive( 'feature_referer_stats' ) and $gBitUser->hasPermission( 'bit_p_view_referer_stats' )} - <li><a class="item" href="{$smarty.const.STATS_PKG_URL}referer_stats.php">{tr}Referer stats{/tr}</a></li> {/if}{if $gBitSystem->isFeatureActive( 'feature_integrator' ) and $gBitUser->hasPermission( 'bit_p_admin_integrator' )} <li><a class="item" href="{$smarty.const.INTEGRATOR_PKG_URL}admin/index.php">{tr}Integrator{/tr}</a></li> {/if} diff --git a/templates/menu_kernel_admin.tpl b/templates/menu_kernel_admin.tpl index c55acf5..f7252f0 100644 --- a/templates/menu_kernel_admin.tpl +++ b/templates/menu_kernel_admin.tpl @@ -4,6 +4,7 @@ <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=features" title="{tr}Features{/tr}" >{tr}Features{/tr}</a></li> <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=general" title="{tr}General{/tr}" >{tr}General Settings{/tr}</a></li> <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=server" title="{tr}Server{/tr}" >{tr}Server Settings{/tr}</a></li> + <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=menus" title="{tr}Custom Menus{/tr}" >{tr}Custom Menus{/tr}</a></li> {if $gBitUser->hasPermission( 'bit_p_edit_content_templates' )} <li><a class="item" href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php">{tr}Content templates{/tr}</a></li> diff --git a/templates/top_bar.tpl b/templates/top_bar.tpl index 4effcf8..1784cd8 100644 --- a/templates/top_bar.tpl +++ b/templates/top_bar.tpl @@ -1,5 +1,4 @@ {strip} -<a class="skip" style="position:absolute;top:0;left:-999em;" href="#content">{tr}Skip Navigation{/tr}</a> <div id="bittopbar"> <ul id="nav" class="menu hor"> {if $use_custom_top_bar and $gBitSystemPrefs.top_bar_position eq 'replace'} @@ -10,14 +9,14 @@ {/if} <li class="m-home"> - <a class="head" accesskey="h" href="{$smarty.const.BIT_ROOT_URL}">{tr}{$siteTitle|default:"Home"}{/tr}</a> + <a class="head" accesskey="h" href="{$smarty.const.BIT_ROOT_URL}">{$gBitSystemPrefs.site_menu_title|default:$siteTitle}</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 $smarty.const.ACTIVE_PACKAGE eq $menu.adminPanel} current{/if}"> - <a accesskey="{$key|regex_replace:"/(.).*/":"\$1"}" class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $smarty.const.ACTIVE_PACKAGE eq $menu.adminPanel} selected{/if}" href="{$menu.titleUrl}">{tr}{$menu.title}{/tr}</a> + <a accesskey="{$key|truncate:1:""}" class="{if $gBitSystem->isFeatureActive( 'feature_top_bar_dropdown' )}head{else}item{/if}{if $smarty.const.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} |
