summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2006-02-19 18:02:16 +0000
committerLester Caine <lester@lsces.co.uk>2006-02-19 18:02:16 +0000
commit97164dc8f1520a8ec28e6a46c40c4920e9658b0c (patch)
tree0750d204d33a5645ecb03b88833d8978e506a40f
parent963cb33ad947ebce82028e199085c208b35f1f9d (diff)
downloadnexus-97164dc8f1520a8ec28e6a46c40c4920e9658b0c.tar.gz
nexus-97164dc8f1520a8ec28e6a46c40c4920e9658b0c.tar.bz2
nexus-97164dc8f1520a8ec28e6a46c40c4920e9658b0c.zip
Fix reserved word field names
TYPE - SQL Reserved
-rw-r--r--Nexus.php16
-rw-r--r--admin/schema_inc.php2
-rw-r--r--menus.php4
-rw-r--r--plugins/menu.formelements.php18
-rw-r--r--plugins/menu.suckerfish.php14
-rw-r--r--plugins/menu.tikiwiki.php4
-rw-r--r--templates/menu_details_inc.tpl2
-rw-r--r--templates/menus.tpl6
8 files changed, 33 insertions, 33 deletions
diff --git a/Nexus.php b/Nexus.php
index f9bb52c..6a5537f 100644
--- a/Nexus.php
+++ b/Nexus.php
@@ -4,7 +4,7 @@
*
* @abstract
* @author xing <xing@synapse.plus.com>
-* @version $Revision: 1.16 $
+* @version $Revision: 1.17 $
* @package nexus
*/
@@ -209,10 +209,10 @@ class Nexus extends NexusSystem {
}
$type_name = 'type_' . $pParamHash['plugin_guid'];
if ( empty( $pParamHash[$type_name] )) {
- $pParamHash['type'] = 'nor';
+ $pParamHash['menu_type'] = 'nor';
}
else {
- $pParamHash['type'] = $pParamHash[$type_name];
+ $pParamHash['menu_type'] = $pParamHash[$type_name];
}
if( empty( $pParamHash['editable'][0] ) || !is_numeric( $pParamHash['editable'][0] ) ) {
$pParamHash['editable'][0] = 0;
@@ -226,7 +226,7 @@ class Nexus extends NexusSystem {
* @param menu_id if set, will update given menu - if not set, we create a new entry in the db
* @param title title of menu
* @param description description of menu
- * @param type type of menu
+ * @param menu_type type of menu
* @param editable if menu is editable by other users - takes 0 or 1
* @return new menu menu_id or FALSE if not created
*/
@@ -234,13 +234,13 @@ class Nexus extends NexusSystem {
$ret = FALSE;
if( $this->verifyMenu( $pParamHash ) ) {
if( !@BitBase::verifyId( $pParamHash['menu_id'] ) ) {
- $query = "INSERT INTO `".BIT_DB_PREFIX."nexus_menus`( `title`,`description`,`type`,`plugin_guid`,`editable` ) VALUES(?,?,?,?,?)";
- $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['type'], $pParamHash['plugin_guid'], $pParamHash['editable'] ) );
+ $query = "INSERT INTO `".BIT_DB_PREFIX."nexus_menus`( `title`,`description`,`menu_type`,`plugin_guid`,`editable` ) VALUES(?,?,?,?,?)";
+ $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'] ) );
$query = "SELECT MAX(`menu_id`) FROM `".BIT_DB_PREFIX."nexus_menus`";
$ret = $this->mDb->getOne( $query, array() );
} else {
- $query = "UPDATE `".BIT_DB_PREFIX."nexus_menus` SET `title`=?,`description`=?,`type`=?,`plugin_guid`=?,`editable`=? WHERE `".BIT_DB_PREFIX."nexus_menus`.`menu_id`=?";
- $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['type'], $pParamHash['plugin_guid'], $pParamHash['editable'], $pParamHash['menu_id'] ) );
+ $query = "UPDATE `".BIT_DB_PREFIX."nexus_menus` SET `title`=?,`description`=?,`menu_type`=?,`plugin_guid`=?,`editable`=? WHERE `".BIT_DB_PREFIX."nexus_menus`.`menu_id`=?";
+ $result = $this->mDb->query( $query, array( $pParamHash['title'], $pParamHash['description'], $pParamHash['menu_type'], $pParamHash['plugin_guid'], $pParamHash['editable'], $pParamHash['menu_id'] ) );
$ret = $pParamHash['menu_id'];
}
$this->writeModuleCache( $ret );
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index c31f942..d52eca0 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -14,7 +14,7 @@ $tables = array(
plugin_guid C(16) NOTNULL,
title C(128),
description C(255),
- type C(16),
+ menu_type C(16),
editable I4 DEFAULT 0
",
diff --git a/menus.php b/menus.php
index 3ee07aa..13773e0 100644
--- a/menus.php
+++ b/menus.php
@@ -1,7 +1,7 @@
<?php
/**
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
* @package nexus
* @subpackage functions
*/
@@ -88,7 +88,7 @@ $gBitSmarty->assign( 'formfeedback', $formfeedback );
if( is_file( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) {
// if the top bar is set and we don't need it, remove it.
foreach( $menuList as $menu ) {
- if( !( $menu['plugin_guid'] == NEXUS_PLUGIN_GUID_SUCKERFISH && $menu['type'] == 'hor' ) ) {
+ if( !( $menu['plugin_guid'] == NEXUS_PLUGIN_GUID_SUCKERFISH && $menu['menu_type'] == 'hor' ) ) {
$nuke_top_bar = TRUE;
}
}
diff --git a/plugins/menu.formelements.php b/plugins/menu.formelements.php
index a43c9b9..6791777 100644
--- a/plugins/menu.formelements.php
+++ b/plugins/menu.formelements.php
@@ -6,7 +6,7 @@
* @abstract implements javascript menu using form elements
* @author william@elan.net
* copied copied from menu.suckerfish.php originally by xing
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
* @package nexus
* @subpackage plugins
*/
@@ -47,7 +47,7 @@ function writeFormMenuCache( $pMenuHash ) {
$menu_name = preg_replace( "/ +/", "_", trim( $pMenuHash->mInfo['title'] ) );
$menu_name = strtolower( $menu_name );
$menu_file = $pMenuHash->mInfo['cache']['file'];
- if ( $pMenuHash->mInfo['type'] != 'qdd' ) {
+ if ( $pMenuHash->mInfo['menu_type'] != 'qdd' ) {
$data = '{bitmodule title="{tr}'.$pMenuHash->mInfo['title'].'{/tr}" name="'.$menu_name.'"}';
}
else {
@@ -63,26 +63,26 @@ function writeFormMenuCache( $pMenuHash ) {
}
if( $item['first'] ) {
$data .= '<form id="menu_nexus'.$pMenuHash->mInfo['menu_id'].'" action="">';
- if ( $pMenuHash->mInfo['type'] == 'qdd' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 'qdd' ) {
$data .= $gBitSmarty->fetch( NEXUS_PKG_PATH.'templates/formelements/start_center.tpl' );
}
$data .= '<select ';
- if ( $pMenuHash->mInfo['type'] == 's3' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 's3' ) {
$data .= 'size="3" ';
}
- if ( $pMenuHash->mInfo['type'] == 's5' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 's5' ) {
$data .= 'size="5" ';
}
- if ( $pMenuHash->mInfo['type'] == 'sal' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 'sal' ) {
$data .= 'size="$pMenuHash->sizeof()" ';
}
if( $key == 0 ) {
$data .= ' onchange="go(this.form.elements[0]);" ';
$data .= ' name="menu_nexus'.$pMenuHash->mInfo['menu_id'].'" >';
- if ( $pMenuHash->mInfo['type'] == 'sdd' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 'sdd' ) {
$data .= '<option value=""></option>';
}
- if ( $pMenuHash->mInfo['type'] == 'qdd' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 'qdd' ) {
$data .= '<option value="">'.$pMenuHash->mInfo['title'].'</option>' ;
}
} else {
@@ -104,7 +104,7 @@ function writeFormMenuCache( $pMenuHash ) {
}
if( $item['last'] ) {
$data .= '</select>' ;
- if ( $pMenuHash->mInfo['type'] == 'qdd' ) {
+ if ( $pMenuHash->mInfo['menu_type'] == 'qdd' ) {
$data .= $gBitSmarty->fetch( NEXUS_PKG_PATH.'templates/formelements/finish_center.tpl' );
}
$data .= '</form>' ;
diff --git a/plugins/menu.suckerfish.php b/plugins/menu.suckerfish.php
index 183e4d5..0c62d4b 100644
--- a/plugins/menu.suckerfish.php
+++ b/plugins/menu.suckerfish.php
@@ -5,7 +5,7 @@
*
* @abstract creates a simple &lt;ul&gt; and &lt;li&gt; based list of items
* @author xing@synapse.plus.com
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
* @package nexus
* @subpackage plugins
*/
@@ -44,7 +44,7 @@ function writeSuckerfishCache( $pMenuHash ) {
$menu_name = preg_replace( "/ +/", "_", trim( $pMenuHash->mInfo['title'] ) );
$menu_name = strtolower( $menu_name );
- if( $pMenuHash->mInfo['type'] != 'hor' ) {
+ if( $pMenuHash->mInfo['menu_type'] != 'hor' ) {
$menu_file = $pMenuHash->mInfo['cache']['file'];
$data = '{bitmodule title="{tr}'.$pMenuHash->mInfo['title'].'{/tr}" name="'.$menu_name.'"}';
$data .= '<div class="suckerfish">';
@@ -61,8 +61,8 @@ function writeSuckerfishCache( $pMenuHash ) {
if( $item['first'] ) {
if( $key == 0 ) {
// don't print the first ul if it's a horizontal menu - needed to insert in top bar
- if( $pMenuHash->mInfo['type'] != 'hor' ) {
- $data .= '<ul id="nexus'.$pMenuHash->mInfo['menu_id'].'" class="menu '.$pMenuHash->mInfo['type'].'">';
+ if( $pMenuHash->mInfo['menu_type'] != 'hor' ) {
+ $data .= '<ul id="nexus'.$pMenuHash->mInfo['menu_id'].'" class="menu '.$pMenuHash->mInfo['menu_type'].'">';
}
} else {
$data .= '<ul>';
@@ -102,15 +102,15 @@ function writeSuckerfishCache( $pMenuHash ) {
}
// remove last </ul>
- if( $pMenuHash->mInfo['type'] == 'hor' ) {
+ if( $pMenuHash->mInfo['menu_type'] == 'hor' ) {
$data = preg_replace( "/<\/ul>$/", '', $data );
}
- if( $pMenuHash->mInfo['type'] == 'ver' ) {
+ if( $pMenuHash->mInfo['menu_type'] == 'ver' ) {
$data .= '<div class="clear"></div>';
}
- if( $pMenuHash->mInfo['type'] != 'hor' ) {
+ if( $pMenuHash->mInfo['menu_type'] != 'hor' ) {
$data .= '</div>';
$data .= '{/bitmodule}';
}
diff --git a/plugins/menu.tikiwiki.php b/plugins/menu.tikiwiki.php
index c464ad5..a95fcd9 100644
--- a/plugins/menu.tikiwiki.php
+++ b/plugins/menu.tikiwiki.php
@@ -4,7 +4,7 @@
*
* @abstract creates a javascript expandable menu
* @author xing@synapse.plus.com
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
* @package nexus
* @subpackage plugins
*/
@@ -52,7 +52,7 @@ function writeTikiWikiCache( $pMenuHash ) {
$permCloseIds = array();
$perm_close = FALSE;
$perm_cycle = FALSE;
- $type = $pMenuHash->mInfo['type'];
+ $type = $pMenuHash->mInfo['menu_type'];
foreach( $pMenuHash->mInfo['tree'] as $key => $item ) {
if( $item['first'] ) {
$data .= '<div id="togid'.$item['item_id'].'">';
diff --git a/templates/menu_details_inc.tpl b/templates/menu_details_inc.tpl
index bf5ddbe..f27ad64 100644
--- a/templates/menu_details_inc.tpl
+++ b/templates/menu_details_inc.tpl
@@ -37,7 +37,7 @@
{forminput}
{assign var=plugin_guid value=$gNexus->mInfo.plugin_guid}
{foreach from=$gNexusSystem->mPlugins.$plugin_guid.menu_types item=menu_type key=m_type}
- {if $m_type eq $gNexus->mInfo.type}{$menu_type.label}{/if}
+ {if $m_type eq $gNexus->mInfo.menu_type}{$menu_type.label}{/if}
{/foreach}
{/forminput}
</div>
diff --git a/templates/menus.tpl b/templates/menus.tpl
index 6e822da..83e4b72 100644
--- a/templates/menus.tpl
+++ b/templates/menus.tpl
@@ -61,10 +61,10 @@
&nbsp;
<select name="type_{$plugin.plugin_guid}" id="type_{$plugin.plugin_guid}">
{foreach from=$plugin.menu_types key=type item=menu_type}
- {if $type eq hor and $use_custom_top_bar and !$editMenu.type eq 'hor'}
+ {if $type eq hor and $use_custom_top_bar and !$editMenu.menu_type eq 'hor'}
<option value="">{tr}Only one horizontal menu can exist.{/tr}</option>
{else}
- <option value="{$type}"{if $type eq $editMenu.type} selected="selected"{/if}>{$menu_type.label}</option>
+ <option value="{$type}"{if $type eq $editMenu.menu_type} selected="selected"{/if}>{$menu_type.label}</option>
{/if}
{/foreach}
</select>
@@ -139,7 +139,7 @@
<td>
{assign var=plugin_guid value=$menu.plugin_guid}
{foreach from=$gNexusSystem->mPlugins.$plugin_guid.menu_types item=menu_type key=m_type}
- {if $m_type eq $menu.type}{$menu_type.label}{/if}
+ {if $m_type eq $menu.menu_type}{$menu_type.label}{/if}
{/foreach}
</td>
<td style="text-align:right;">{$menu.items|@count}</td>