Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19461/includes Modified Files: mx_functions.php mx_functions_admincp.php mx_functions_auth.php mx_functions_blockcp.php mx_functions_core.php Removed Files: mx_functions_parameter.php Log Message: fixing up 2.8 Index: mx_functions_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_auth.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_functions_auth.php 20 Aug 2005 18:19:11 -0000 1.1 --- mx_functions_auth.php 9 Sep 2005 08:53:03 -0000 1.2 *************** *** 26,30 **** * - menu_auth * - get_auth_forum ! * - mx_auth_group * - mx_get_groups */ --- 26,30 ---- * - menu_auth * - get_auth_forum ! * - mx_is_group_member (old mx_auth_group) * - mx_get_groups */ Index: mx_functions_blockcp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_blockcp.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_functions_blockcp.php 6 Sep 2005 18:51:56 -0000 1.3 --- mx_functions_blockcp.php 9 Sep 2005 08:53:03 -0000 1.4 *************** *** 27,38 **** /********************************************************************************\ | Class: mx_blockcp ! | The mx_blockcp class will provide a block control panel. | This class will load additional module specific parameters, eg advanced textblocks (bbcode/html/mxBB/wysiwyg) and serialized data types | | // | // Methods | // ! | $mx_blockcp->panel($block_id); ! | $mx_blockcp->do_it(ACTION, TYPE, $block_id) | | // --- 27,39 ---- /********************************************************************************\ | Class: mx_blockcp ! | The mx_blockcp class provides a Block Control Panel, extending the mx_block class. | This class will load additional module specific parameters, eg advanced textblocks (bbcode/html/mxBB/wysiwyg) and serialized data types | + | This class is instantiated in admin_mx_block_cp.php (adminCP mode) or in coreblocks/blockcp.php (user mode) + | | // | // Methods | // ! | $mx_blockcp->generate_cp($block_id); | | // *************** *** 40,47 **** | // | - | $mx_blockcp->panel($block_id, $new_block); : This will create new block dialog - | $mx_blockcp->panel($block_id); : This will create edit block dialog - | - | $mx_blockcp->do_it(ACTION, TYPE, $block_id) | \********************************************************************************/ --- 41,44 ---- *************** *** 451,562 **** } - /* - function _get_parameter_option($parameter_id, $id) - { - global $db; - - $table = PARAMETER_OPTION_TABLE; - $idfield = 'option_code'; - $namefield = 'option_desc'; - - $sql = "SELECT * FROM " . $table; - $sql .= " WHERE parameter_id = $parameter_id"; - $sql .= " ORDER BY $namefield "; - - if( !($result = $db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, "Couldn't get list options parameter", "", __LINE__, __FILE__, $sql); - } - - $column_list = ''; - - while( $row = $db->sql_fetchrow($result) ) - { - $s = ''; - if( $row[$idfield] == $id ) - { - $s = " selected=\"selected\""; - } - $columnlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; - } - - return $columnlist; - } - */ - - function _do_update($block_id) - { - global $template, $lang, $phpEx, $db, $board_config, $theme, $HTTP_POST_VARS, $portalpage, $phpbb_root_path, $mx_root_path, $phpEx; - - while( list($param_id, $param_value) = each($HTTP_POST_VARS) ) - { - if( !( $param_id == 'mode' || $param_id == 'submit' || $param_id == 'block_title' || $param_id == 'block_desc' || $param_id == 'show_block' ) ) - { - if( is_array($param_value) ) - { - $param_value = implode(',' , $param_value); - } - - $param_info = get_info(PARAMETER_TABLE, 'parameter_id', intval($param_id)); - - if( $param_info['parameter_type'] == 'BBText' ) - { - $bbcode_uid = make_bbcode_uid(); - $param_value = prepare_message($param_value, true, true, true, $bbcode_uid); - } - - $sql = "UPDATE " . BLOCK_SYSTEM_PARAMETER_TABLE . " - SET parameter_value = '$param_value', - bbcode_uid = '$bbcode_uid' - WHERE block_id = '$block_id' - AND parameter_id = '$param_id'"; - - if( !($db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, "Couldn't update system parameter table", "", __LINE__, __FILE__, $sql); - } - } - } - - $block_title = ( isset($HTTP_POST_VARS['block_title']) ) ? trim(strip_tags($HTTP_POST_VARS['block_title'])) : $block_config[$block_id]['block_title']; - $block_desc = trim(strip_tags($HTTP_POST_VARS['block_desc'])); - $show_block = intval($HTTP_POST_VARS['show_block']); - $show_title = intval($HTTP_POST_VARS['show_title']); - $show_stats = intval($HTTP_POST_VARS['show_stats']); - - $block_time = time(); - $block_editor_id = $userdata['user_id']; - - $sql = "UPDATE " . BLOCK_TABLE . " - SET block_title = '" . str_replace("\'", "''", $block_title) . "', - block_desc = '" . str_replace("\'", "''", $block_desc) . "', - block_time = '" . str_replace("\'", "''", $block_time) . "', - block_editor_id = '" . intval($block_editor_id) . "', - show_block = '" . intval($show_block) . "', - show_title = '" . intval($show_title) . "', - show_stats = '" . intval($show_stats) . "' - WHERE block_id = $block_id"; - - if( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) ) - { - mx_message_die(GENERAL_ERROR, "Could not update block title information.", "", __LINE__, __FILE__, $sql); - } - - // - // Update cache - // - update_session_cache($block_id); - - if( !empty($portalpage) ) - { - $message = $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?page=$portalpage") . '">', '</a>') . "<br /><br />" . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.php?pane=right" ) . '">', '</a>'); - } - else - { - $message = $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], '<a href="' . append_sid("admin_mx_block.$phpEx") . '">', '</a>') . "<br /><br />" . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.php?pane=right") . '">', '</a>'); - } - mx_message_die(GENERAL_MESSAGE, $message); - } - // ------------------------------ // Public Methods --- 448,451 ---- *************** *** 583,615 **** } } - - // - // $action: MX_DO_INSERT, MX_DO_UPDATE, MX_DO_DELETE, MX_DO_SAVE_SETTINGS - // - function submit( $action = '', $id = 0, $parent = false, $recache = true ) - { - $mx_status = ''; - - switch ( $action ) - { - case MX_DO_INSERT: - $mx_status = $this->_do_insert( $id ); - break; - - case MX_DO_UPDATE: - $mx_status = $this->_do_update( $id ); - break; - - case MX_DO_DELETE: - $mx_status = $this->_do_delete( $id, $parent, $recache ); - break; - } - - if (!empty($mx_status)) - { - //mx_message_die( GENERAL_MESSAGE, $message ); - return $mx_status; - } - } } // class mx_blockcp --- 472,475 ---- Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_functions_core.php 8 Sep 2005 21:16:18 -0000 1.5 --- mx_functions_core.php 9 Sep 2005 08:53:03 -0000 1.6 *************** *** 43,49 **** | // | ! | $mx_cache->update( MX_ALL_DATA ); : Updates all cache ! | $mx_cache->update( MX_BLOCK, [$block_id] ); : Optional parameter $block_id to update only specific cache fle ! | $mx_cache->update( MX_PAGE, [$page_id] ); : Optional parameter $page_id to update only specific cache file \********************************************************************************/ --- 43,49 ---- | // | ! | $mx_cache->update( MX_CACHE_ALL ); : Updates all cache ! | $mx_cache->update( MX_CACHE_BLOCK_TYPE, [$block_id] ); : Optional parameter $block_id to update only specific cache fle ! | $mx_cache->update( MX_CACHE_PAGE_TYPE, [$page_id] ); : Optional parameter $page_id to update only specific cache file \********************************************************************************/ *************** *** 52,56 **** // define('MX_CACHE_ALL' , -1); // Flag - all ! define('MX_CACHE_SINGLE' , -2); // Flag - all define('MX_CACHE_PAGE_TYPE' , -3); // Flag - blocks data define('MX_CACHE_BLOCK_TYPE' , -4); // Flag - pages data --- 52,56 ---- // define('MX_CACHE_ALL' , -1); // Flag - all ! define('MX_CACHE_SINGLE' , -2); // Flag - single define('MX_CACHE_PAGE_TYPE' , -3); // Flag - blocks data define('MX_CACHE_BLOCK_TYPE' , -4); // Flag - pages data *************** *** 583,587 **** /********************************************************************************\ | Class: mx_block ! | The mx_block class defines all block properties and handle all block contents output, and is called from index.php. | The object calls the mx_cache class for retrieving block data. | Once initiated, $mx_block->init($block_id), the mx_block object has the following public properties and methods. --- 583,587 ---- /********************************************************************************\ | Class: mx_block ! | The mx_block class defines all block properties, extending the mx_parameter class, and handle all block contents output, and is called from index.php. | The object calls the mx_cache class for retrieving block data. | Once initiated, $mx_block->init($block_id), the mx_block object has the following public properties and methods. *************** *** 932,938 **** $layouttemplate->assign_block_vars( 'layout_column.blocks.edit.switch_edit_' . ( $edit_on ? 'on' : 'off' ), array() ); } - - - } // class mx_block --- 932,935 ---- *************** *** 940,944 **** /********************************************************************************\ | Class: mx_block_parameter ! | The mx_block_parameter class is actually a mx_block subclass, and shouldn't be called by itself ;). | | // --- 937,942 ---- /********************************************************************************\ | Class: mx_block_parameter ! | The mx_block_parameter class is actually a mx_block parent class, and shouldn't be called by itself ;). ! | This class handles all block parameter editing and loads module specific block parameters. | | // *************** *** 950,957 **** | // | - | Initiate/Kill: - | $mx_block->init($block_id) : Initiate all block properties for passed $block_id | ! | Output to template: | | // --- 948,955 ---- | // | | ! | $this->load_block_parameters($block_id) : Load all block parameters and format the form element ! | $this->load_block_panels($block_id) : Load (if exists) an additional module panel. Eg the Navigation Menu Panel ! | $this->submit_parameters($block_id) : Submit all block parameters and update cache | | // *************** *** 961,972 **** \********************************************************************************/ - // Parameter Types - define( 'INPUT', 0 ); - define( 'TEXTAREA', 1 ); - define( 'RADIO', 2 ); - define( 'SELECT', 3 ); - define( 'SELECT_MULTIPLE', 4 ); - define( 'CHECKBOX', 5 ); - class mx_block_parameter { --- 959,962 ---- *************** *** 1615,1626 **** } - /* - function get_field_data( $field_id ) - { - $return_array = $this->mxParameter[$field_id]; - $return_array['data'] = !empty( $return_array['data'] ) ? implode( "\n", unserialize( stripslashes( $return_array['data'] ) ) ) : ''; - return $return_array; - } - */ } --- 1605,1608 ---- Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_functions_admincp.php 7 Sep 2005 19:36:30 -0000 1.4 --- mx_functions_admincp.php 9 Sep 2005 08:53:03 -0000 1.5 *************** *** 27,31 **** /********************************************************************************\ | Class: mx_admin ! | The mx_admin class provides all (most) tools for db actions. To be used by the adminCP - module, block and page administration. | | // --- 27,31 ---- /********************************************************************************\ | Class: mx_admin ! | The mx_admin class provides all (most) tools for the adminCP Panels - Module area, Module CP, Block CP and Page CP administration. | | // *************** *** 33,55 **** | // | ! | $mx_admin->do_it($mode, $action, $id); | | // | // Usage examples: | // | | case 'create_block': // Insert ! | $result_message = $mx_admin->do_it(MX_BLOCK_TYPE, MX_DO_INSERT); ! | // block_create_block(); | break; | | case 'delete_block': ! | $result_message = $mx_admin->do_it(MX_BLOCK_TYPE, MX_DO_DELETE, $block_id); ! | // block_delete($block_id); | break; | | case 'modify_block': ! | $result_message = $mx_admin->do_it(MX_BLOCK_TYPE, MX_DO_UPDATE, $block_id); ! | // block_modify($block_id); | break; | --- 33,66 ---- | // | ! | $mx_admin->do_it( $mode, $action, $id, $parent [optional boolean], $recache [optional boolean] ) | | // + | // Switches + | // + | + | $action: + | - MX_DO_INSERT, MX_DO_UPDATE, MX_DO_DELETE, + | - MX_DO_MOVE, MX_DO_SYNC, + | - MX_DO_INSTALL, MX_DO_UPGRADE, MX_DO_EXPORT + | + | $type: + | - MX_MODULE_TYPE, MX_FUNCTION_TYPE, MX_PARAMETER_TYPE, + | - MX_BLOCK_TYPE, MX_BLOCK_PARAMETER_TYPE, MX_BLOCK_PRIVATE_TYPE, MX_BLOCK_SETTINGS_TYPE, + | - MX_PAGE_TYPE, MX_PAGE_COLUMN_TYPE, MX_PAGE_BLOCK_TYPE, MX_PAGE_PRIVATE_TYPE, MX_PAGE_TEMPLATE_TYPE, MX_PAGE_TEMPLATE_COLUMN_TYPE + | + | // | // Usage examples: | // | | case 'create_block': // Insert ! | $result_message = $mx_admin->do_it(MX_DO_INSERT, MX_BLOCK_TYPE ); | break; | | case 'delete_block': ! | $result_message = $mx_admin->do_it(MX_DO_DELETE, MX_BLOCK_TYPE, $block_id); | break; | | case 'modify_block': ! | $result_message = $mx_admin->do_it(MX_DO_UPDATE, MX_BLOCK_TYPE, $block_id); | break; | *************** *** 3023,3043 **** // ! // ! // Examples ! // ! ! // $block_config = $mx_cache->read( MX_BLOCK, $block_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query ! // $page_config = $mx_cache->read( MX_PAGE, $page_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query ! ! // $mx_cache->update( MX_ALL_DATA ); // Updates all cache ! // $mx_cache->update( MX_BLOCK, [$block_id] ); // Optional parameter $block_id to update only specific cache fle ! // $mx_cache->update( MX_PAGE, [$page_id] ); // Optional parameter $page_id to update only specific cache file ! ! // ! // Switches ! // ! // $action: MX_DO_INSERT, MX_DO_UPDATE, MX_DO_DELETE, MX_DO_SAVE_SETTINGS ! // $type: MX_MODULE, MX_BLOCK, MX_FUNCTION, MX_PARAMETER, MX_PAGE, MX_PAGE_COLUMN, MX_PAGE_ITEM function do_it( $mode = '', $action = '', $id = '', $parent = false, $recache = true ) --- 3034,3046 ---- // ! // $action: ! // - MX_DO_INSERT, MX_DO_UPDATE, MX_DO_DELETE, ! // - MX_DO_MOVE, MX_DO_SYNC, ! // - MX_DO_INSTALL, MX_DO_UPGRADE, MX_DO_EXPORT ! // $type: ! // - MX_MODULE_TYPE, MX_FUNCTION_TYPE, MX_PARAMETER_TYPE, ! // - MX_BLOCK_TYPE, MX_BLOCK_PARAMETER_TYPE, MX_BLOCK_PRIVATE_TYPE, MX_BLOCK_SETTINGS_TYPE, ! // - MX_PAGE_TYPE, MX_PAGE_COLUMN_TYPE, MX_PAGE_BLOCK_TYPE, MX_PAGE_PRIVATE_TYPE, MX_PAGE_TEMPLATE_TYPE, MX_PAGE_TEMPLATE_COLUMN_TYPE function do_it( $mode = '', $action = '', $id = '', $parent = false, $recache = true ) *************** *** 3110,3134 **** $message .= '<br /> If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules'; - if ( $main_install ) - { - if ( !$inst_error ) - { - $message .= '-> no db errors :-)<br /><br /><b>Portal installed successfully! </b><hr><br /><br />'; - $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; - $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; - $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; - - $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; - } - else - { - $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; - $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; - $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; - $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; - - $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; - } - } return $message; } --- 3113,3116 ---- --- mx_functions_parameter.php DELETED --- Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** mx_functions.php 6 Sep 2005 18:51:56 -0000 1.45 --- mx_functions.php 9 Sep 2005 08:53:03 -0000 1.46 *************** *** 23,33 **** * Included functions in this file: * - get_info - * - get_old_items * - get_exists * - get_list - * - get_mx_select_list - * - get_list_formatted * - get_list_static * - get_list_multiple * - get_list_opt [...1002 lines suppressed...] - $mx_module_copy = '<h1>' . $lang['mx_copy'] . '</h1><hr /><br />'; - $mx_module_copy .= $lang['mx_copy_text'] . '<br /><br />'; - $mx_module_copy .= $lang['mx_modules_text'] . '<br />'; - - for( $i = 0; $i < count($module); $i++ ) - { - if( !empty($module[$i]['module_version']) ) - { - $mx_module_copy .= '<br />' . $module[$i]['module_version'] . ', ' . $module[$i]['module_copy']; - } - } - - $mx_module_copy = $mx_module_copy . '<br /><br /><hr />'; - - mx_message_die(GENERAL_MESSAGE, $mx_module_copy, 'Modules info and copyrights'); - } - ?> \ No newline at end of file --- 1499,1501 ---- |