You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:31
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/includes Modified Files: mx_form.php mx_functions.php mx_functions_ch.php mx_functions_phpbb.php template.php Added Files: mx_functions_admincp.php mx_functions_auth.php mx_functions_blockcp.php mx_functions_core.php mx_functions_parameter.php Removed Files: mx_admincp.php mx_auth.php mx_cache.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) Index: mx_functions_ch.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_ch.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_functions_ch.php 25 Apr 2005 01:40:01 -0000 1.1 --- mx_functions_ch.php 20 Aug 2005 18:19:11 -0000 1.2 *************** *** 20,23 **** --- 20,28 ---- ***************************************************************************/ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + // // This code is part of common.php in Categories Hierarchy 2.1.0 --- NEW FILE: mx_functions_auth.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_functions_auth.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License', or * ('at your option) any later version. */ /** * Included functions in this file: * - block_auth * - page_auth * - menu_auth * - get_auth_forum * - mx_auth_group * - mx_get_groups */ /********************************************************************************\ | $type's accepted (pre-pend with AUTH_): | VIEW, READ, POST, REPLY, EDIT, DELETE, STICKY, ANNOUNCE, VOTE, POLLCREATE | | Possible options ($type/module_id combinations): | | * If you include a type and module_id then a specific lookup will be done and | the single result returned | | * If you set type to AUTH_ALL and specify a module_id an array of all auth types | will be returned | | * If you provide a module_id a specific lookup on that module will be done | | * If you set module_id to AUTH_LIST_ALL and specify a type an array listing the | results for all modules will be returned | | * If you set module_id to AUTH_LIST_ALL and type to AUTH_ALL a multidimensional | array containing the auth permissions for all types and all modules for that | user is returned | | All results are returned as associative arrays, even when a single auth type is | specified. | | If available you can send an array (either one or two dimensional) containing the | module auth levels, this will prevent the auth function having to do its own | lookup \********************************************************************************/ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } function block_auth($type, $module_id, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; switch( $type ) { // case AUTH_ALL: // $a_sql = 'a.auth_view, a.auth_edit, a.auth_delete'; // $a_sql_groups = 'a.auth_view_group, a.auth_edit_group, a.auth_delete_group'; // $auth_fields = array('auth_view', 'auth_edit', 'auth_delete'); // $auth_fields_groups = array('auth_view_group', 'auth_edit_group', 'auth_delete_group'); // break; case AUTH_VIEW: $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; $auth_fields = array('auth_view'); $auth_fields_groups = array('auth_view_group'); break; case AUTH_EDIT: $a_sql = 'a.auth_edit'; $a_sql_groups = 'a.auth_edit_group'; $auth_fields = array('auth_edit'); $auth_fields_groups = array('auth_edit_group'); break; case AUTH_DELETE: $a_sql = 'a.auth_delete'; $a_sql_groups = 'a.auth_delete_group'; $auth_fields = array('auth_delete'); $auth_fields_groups = array('auth_delete_group'); break; default: break; } if( $module_id == 0 ) { if( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) { $auth_user[$auth_fields[0]] = 1; $auth_user[$auth_fields[0] . '_type'] = $lang['Auth_Moderators']; } else { $auth_user[$auth_fields[0]] = 0; $auth_user[$auth_fields[0] . '_type'] = $lang['Auth_Moderators']; } return $auth_user; } $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; // // If the user is logged on and the module type is either ALL or REG then the user has access // // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) // // Now we compare the users access level against the modules. We assume here that a moderator // and admin automatically have access to an ACL module, similarly we assume admins meet an // auth requirement of MOD // $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; switch( $value ) { case AUTH_ALL: $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($value_groups) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group['auth_moderator_group']) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; $auth_user[$key . '_type'] = $lang['Auth_Administrators']; break; default: $auth_user[$key] = 0; break; } } // // Is user a moderator? $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group['auth_moderator_group']) || $is_admin : 0; return $auth_user; } /********************************************************************************\ | \********************************************************************************/ function page_auth($type, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; $auth_fields = array('auth_view'); $auth_fields_groups = array('auth_view_group'); $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; switch( $value ) { case AUTH_ALL: $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($value_groups) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group['auth_moderator_group']) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; $auth_user[$key . '_type'] = $lang['Auth_Administrators']; break; default: $auth_user[$key] = 0; break; } } // // Is user a moderator? $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group['auth_moderator_group']) || $is_admin : 0; return $auth_user; } /********************************************************************************\ | \********************************************************************************/ function menu_auth($type, $menu_id, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; switch( $type ) { case AUTH_ALL: $a_sql = 'a.auth_view'; $auth_fields = array('auth_view'); break; case AUTH_VIEW: $a_sql = 'a.auth_view'; $auth_fields = array('auth_view'); break; default: break; } // // If f_access has been passed, or auth is needed to return an array of menus // then we need to pull the auth information on the given menu (or all menus) // $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; // // If the user is logged on and the menu type is either ALL or REG then the user has access // // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) // // Now we compare the users access level against the menus. We assume here that a moderator // and admin automatically have access to an ACL menu, similarly we assume admins meet an // auth requirement of MOD // $value = $f_access[$key]; switch( $value ) { case AUTH_ALL: $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; $auth_user[$key . '_type'] = $lang['Auth_Administrators']; break; default: $auth_user[$key] = 0; break; } } // // Is user a moderator? // $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($f_access_group) || $is_admin : 0; return $auth_user; } /********************************************************************************\ | Temporary function for getting all block_ids vith auth_edit \********************************************************************************/ function get_auth_blocks() { global $userdata, $mx_root_path, $phpEx, $db; // // Try to reuse auth_view query result. // $userdata_key = 'mx_get_auth_block' . $userdata['user_id']; if( !empty($userdata[$userdata_key]) ) { $auth_data_sql = $userdata[$userdata_key]; return $auth_data_sql; } // // Get block data // // Generate dynamic block select $sql = "SELECT * FROM " . BLOCK_TABLE . " ORDER BY block_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't get blocks", '', __LINE__, __FILE__, $sql); } // // Loop through the list of forums to retrieve the ids for // those with AUTH_VIEW allowed. // $auth_data_sql = ''; while ( $row = $db->sql_fetchrow($result) ) { $block_edit_auth = block_auth( AUTH_EDIT, $row['block_id'] , $userdata, $row['auth_edit'], $row['auth_edit_group'] ); if( $block_edit_auth['auth_edit'] ) { $auth_data_sql .= ( $auth_data_sql != '' ) ? ', ' . $row['block_id'] : $row['block_id']; } } if( empty($auth_data_sql) ) { $auth_data_sql = -1; } $userdata[$userdata_key] = $auth_data_sql; return $auth_data_sql; } /********************************************************************************\ | New optimized get_auth_forum | Credits to Markus_Petrux :-) \********************************************************************************/ function get_auth_forum($mode = 'phpbb') { global $userdata, $mx_root_path, $phpEx; // // Try to reuse auth_view query result. // $userdata_key = 'mx_get_auth_' . $mode . $userdata['user_id']; if( !empty($userdata[$userdata_key]) ) { $auth_data_sql = $userdata[$userdata_key]; return $auth_data_sql; } // // Now, this tries to optimize DB access involved in auth(), // passing AUTH_LIST_ALL will load info for all forums at once. // if( $mode == 'kb' ) { include_once($mx_root_path . 'modules/mx_kb/includes/functions_kb_auth.' . $phpEx); $auth_func = 'kb_auth'; } else { $auth_func = 'auth'; } $is_auth_ary = $auth_func(AUTH_VIEW, AUTH_LIST_ALL, $userdata); // // Loop through the list of forums to retrieve the ids for // those with AUTH_VIEW allowed. // $auth_data_sql = ''; foreach( $is_auth_ary as $fid => $is_auth_row ) { if( $is_auth_row['auth_view'] ) { $auth_data_sql .= ( $auth_data_sql != '' ) ? ', ' . $fid : $fid; } } if( empty($auth_data_sql) ) { $auth_data_sql = -1; } $userdata[$userdata_key] = $auth_data_sql; return $auth_data_sql; } /********************************************************************************\ | Validates if user belongs to group included in group_ids list | Also, adds all usergroups to userdata array \********************************************************************************/ function mx_is_group_member($group_ids = '', $group_mod_mode = false) { global $userdata, $db; if( empty($group_ids) ) { return false; } // // Try to reuse group_id results. // $userdata_key = 'mx_usergroups' . ( $group_mod_mode ? '_mod' : '' ) . $userdata['user_id']; if( empty($userdata[$userdata_key]) ) { if( $group_mod_mode ) // Get the groups the user is moderator of. { $sql = "SELECT group_id FROM " . GROUPS_TABLE . " WHERE group_moderator = '" . $userdata['user_id'] . "' AND group_single_user = 0"; } else // Get the groups the user is member of. { $sql = "SELECT group_id FROM " . USER_GROUP_TABLE . " WHERE user_id = '" . $userdata['user_id'] . "' AND user_pending = 0"; } if ( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query group rights information"); } $userdata[$userdata_key] = $db->sql_fetchrowset($result); } $group_ids_array = explode(',', $group_ids); for( $i = 0; $i < count($userdata[$userdata_key]); $i++ ) { if( in_array($userdata[$userdata_key][$i]['group_id'], $group_ids_array) ) { return true; } } return false; } /********************************************************************************\ | \********************************************************************************/ function mx_get_groups($sel_id, $field_entry = 'auth_view_group') { global $db, $lang; $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . TRUE . " ORDER BY group_name"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Couldn't get list of groups", '', __LINE__, __FILE__, $sql); } $grouplist = '<select name="'.$field_entry.'">'; $grouplist .= '<option value="0">' . $lang['Select_group'] . '</option>'; while( $row = $db->sql_fetchrow($result) ) { $selected = ( $sel_id == $row['group_id'] ? ' selected="selected"' : '' ); $grouplist .= '<option value="' .$row['group_id'] . '"' . $selected . '>' . $row['group_name'] . '</option>'; } $grouplist .= '</select>'; return $grouplist; } ?> --- NEW FILE: mx_functions_blockcp.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_functions_blockcp.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License', or * ('at your option) any later version. */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /********************************************************************************\ | 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) | | // | // Usage examples: | // | | $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) | \********************************************************************************/ define('MX_BLOCKCP_DEBUG' , false); class mx_blockcp extends mx_block { // ------------------------------ // Private Methods // // // ****************************************************************** // DIALOG // ****************************************************************** function _controlpanel( $id, $new_block ) { global $blockcptemplate, $lang, $db, $board_config, $theme, $HTTP_GET_VARS, $HTTP_POST_VARS, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $portalpage, $cookie_states, $module_nav_icon_url, $portalpage; if (empty($id)) { die('Invalid block panel call - no id'); } // // Main parameters // $block_keys = array( 'block_title' => 'block_title', 'block_desc' => 'block_desc', 'show_block' => 'show_block', 'show_title' => 'show_title', 'show_stats' => 'show_stats'); // // Instantiate the Block Class // //$mx_block = new mx_block(); // // Toggle add/edit action // if( !$new_block ) { if ( MX_BLOCKCP_DEBUG ) { echo('DIALOG - BLOCK - EDIT <br>'); } $mode_general = MX_BLOCK_TYPE; $mode_permissions = MX_BLOCK_PRIVATE_TYPE; $mode_settings = MX_BLOCK_SETTINGS_TYPE; $action = MX_DO_UPDATE; $block_id = $id; //$this->init($block_id); $function_id = $this->function_id; $l_title = $lang['Edit_block']; $newmode = 'modify_block'; $buttonvalue = $lang['Update']; $block_title = ( isset($HTTP_POST_VARS[$block_keys['block_title']]) ) ? stripslashes(htmlspecialchars($HTTP_POST_VARS[$block_keys['block_title']])) : $this->$block_keys['block_title']; $block_desc = ( isset($HTTP_POST_VARS[$block_keys['block_desc']]) ) ? stripslashes(htmlspecialchars($HTTP_POST_VARS[$block_keys['block_desc']])) : $this->$block_keys['block_desc']; $show_block = ( isset($HTTP_POST_VARS[$block_keys['show_block']]) ) ? intval($HTTP_POST_VARS[$block_keys['show_block']]) : intval($this->$block_keys['show_block']); $show_title = ( isset($HTTP_POST_VARS[$block_keys['show_title']]) ) ? intval($HTTP_POST_VARS[$block_keys['show_title']]) : intval($this->$block_keys['show_title']); $show_stats = ( isset($HTTP_POST_VARS[$block_keys['show_stats']]) ) ? intval($HTTP_POST_VARS[$block_keys['show_stats']]) : intval($this->$block_keys['show_stats']); } else { if ( MX_BLOCKCP_DEBUG ) { echo('DIALOG - BLOCK - ADD <br>'); } $mode_general = MX_BLOCK_TYPE; $mode_permissions = MX_BLOCK_PRIVATE_TYPE; $mode_settings = MX_BLOCK_SETTINGS_TYPE; $action = MX_DO_INSERT; $function_id = $id; $l_title = $lang['Create_block']; $newmode = 'create_block'; $buttonvalue = $lang['Create_block']; $block_title = ''; $block_desc = ''; $show_block = '1'; $show_title = '1'; $show_stats = '0'; $this->$block_keys['auth_view'] = AUTH_ALL; $this->$block_keys['auth_edit'] = AUTH_ADMIN; } $functionlist = get_list_formatted('function_list', $function_id); // // Define auth constants // $block_auth_fields = array('auth_view', 'auth_edit'); // , 'auth_delete' $block_auth_ary = array( 'auth_view' => AUTH_ALL, 'auth_edit' => AUTH_MOD, ); $block_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN', 'ANONYMOUS'); $block_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN, AUTH_ANONYMOUS); $field_names = array( 'auth_view' => $lang['View'], 'auth_edit' => $lang['Edit'], ); /* // // Populate missing parameters (if any) // $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . " (block_id, parameter_id, parameter_value) SELECT " . $block_id . ", parameter_id, parameter_default FROM " . PARAMETER_TABLE . " par " . " WHERE function_id = " . $block_row['function_id']; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't insert parameter information", "", __LINE__, __FILE__, $sql); } */ // // Hidden fields // $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" />'; $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; $show_block_yes = ( $show_block == 1 ) ? 'checked="checked"' : ''; $show_block_no = ( $show_block == 0 ) ? 'checked="checked"' : ''; $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; // // Define some graphics // $module_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/admin_icons/'; $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; $admin_icon['module'] = $module_nav_icon_url . 'icon_module.gif'; $admin_icon['function'] = $module_nav_icon_url . 'icon_function.gif'; $admin_icon['parameter'] = $module_nav_icon_url . 'icon_parameter.gif'; $admin_icon['block'] = $module_nav_icon_url . 'icon_block.gif'; $admin_icon['edit_block'] = $module_nav_icon_url . 'icon_edit.gif'; // // Variables // $blockcptemplate->assign_vars(array( 'L_TITLE' => $lang['Block_admin'], 'L_EXPLAIN' => $lang['Block_admin_explain'], 'SID' => $userdata['session_id'], 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', // // General // "L_ACTION" => $lang['Action'], "L_DELETE" => $lang['Delete'], 'L_SETTING' => $lang['Settings'], 'L_VIEW' => $lang['View'], "L_EDIT" => $lang['Edit'], "L_ADD" => $lang['Create_parameter'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_SETTING' => $new_block ? '' : $l_setting, 'L_DELETE' => $new_block ? '' : $lang['Delete'], 'L_EDIT' => $new_block ? '' : $lang['Edit'], 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_FUNCTION' => $lang['Function'], 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], 'L_SHOW_BLOCK' => $lang['Show_block'], 'L_SHOW_BLOCK_EXPLAIN' => $lang['Show_block_explain'], 'L_SHOW_TITLE' => $lang['Show_title'], 'L_SHOW_TITLE_EXPLAIN' => $lang['Show_title_explain'], 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], 'BLOCK_ID' => $block_id, 'BLOCK_TITLE' => $new_block ? '<span class="cattitle">'. $lang['Create_block'] . '</span>' : ' ' . $block_title, 'BLOCK_DESC' => ( $block_desc != '' ) ? ' - ' . $block_desc : '', 'U_BLOCK_SETTINGS' => append_sid(PORTAL_URL . "admin/admin_mx_blockcp.$phpEx?block_id=$block_id"), 'U_BLOCK_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_block.$phpEx?mode=delete_block&block_id=$block_id"), 'U_BLOCK_PERMISSIONS' => append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, 'S_FUNCTION_LIST' => $functionlist, 'S_SHOW_BLOCK_YES' => $show_block_yes, 'S_SHOW_BLOCK_NO' => $show_block_no, 'S_SHOW_TITLE_YES' => $show_title_yes, 'S_SHOW_TITLE_NO' => $show_title_no, 'S_SHOW_STATS_YES' => $show_stats_yes, 'S_SHOW_STATS_NO' => $show_stats_no, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SUBMIT_UPDATE' => $buttonvalue, 'S_SUBMIT' => $lang['Update'], 'L_GROUPS' => $lang['Usergroups'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], // // Graphics // 'IMG_URL_CONTRACT' => $admin_icon['contract'], 'IMG_URL_EXPAND' => $admin_icon['expand'], 'IMG_ICON_MODULE' => $admin_icon['module'], 'IMG_ICON_FUNCTION' => $admin_icon['function'], 'IMG_ICON_PARAMETER' => $admin_icon['parameter'], 'IMG_ICON_BLOCK' => $admin_icon['block'], 'IMG_ICON_EDIT_BLOCK' => $admin_icon['edit_block'], )); // // Hidden fields // $s_hidden_general_fields = '<input type="hidden" name="mode" value="' . $mode_general . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $s_hidden_permissions_fields = '<input type="hidden" name="mode" value="' . $mode_permissions . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $s_hidden_settings_fields = '<input type="hidden" name="mode" value="' . $mode_settings . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; // // Activate BlockCP SubPanels, based on auth // $blockcptemplate->assign_block_vars('blockcp_general', array( 'L_TITLE' => $lang['Block_quick_edit'], 'S_HIDDEN_FIELDS' => $s_hidden_general_fields, 'S_SUBMIT' => $buttonvalue )); if (!empty($this->block_parameters)) { $blockcptemplate->assign_block_vars('blockcp_settings', array( 'L_TITLE' => $lang['Settings'], 'S_HIDDEN_FIELDS' => $s_hidden_settings_fields, 'S_SUBMIT' => $buttonvalue )); } if ($this->auth_mod) { $blockcptemplate->assign_block_vars('blockcp_permissions', array( 'L_TITLE' => $lang['Permissions_adv'], 'S_HIDDEN_FIELDS' => $s_hidden_permissions_fields, 'S_SUBMIT' => $buttonvalue )); // // Some general blockcp settings are moderator only // $blockcptemplate->assign_block_vars('blockcp_general.is_auth', array()); // // Now query all permissions data (not needed if not authorized ;) // // // Output values of individual auth fields // for( $j = 0; $j < count($block_auth_fields); $j++ ) { $custom_auth[$j] = ' <select name="' . $block_auth_fields[$j] . '">'; for( $k = 0; $k < count($block_auth_levels); $k++ ) { $selected = ( $this->block_info[$block_auth_fields[$j]] == $block_auth_const[$k] ) ? ' selected="selected"' : ''; $custom_auth[$j] .= '<option value="' . $block_auth_const[$k] . '"' . $selected . '>' . $lang['AUTH_' . $block_auth_levels[$k]] . "</option>\n"; } $custom_auth[$j] .= '</select> '; $cell_title = $field_names[$block_auth_fields[$j]]; $blockcptemplate->assign_block_vars('blockcp_general.block_auth_titles', array( 'CELL_TITLE' => $cell_title )); $blockcptemplate->assign_block_vars('blockcp_general.block_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$j] )); } // // PRIVATE auth // // // Get the list of phpBB usergroups // $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . TRUE . " ORDER BY group_name ASC"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; } $view_groups = @explode(',', $this->block_info['auth_view_group']); $edit_groups = @explode(',', $this->block_info['auth_edit_group']); $delete_groups = @explode(',', $this->block_info['auth_delete_group']); $moderator_groups = @explode(',', $this->block_info['auth_moderator_group']); $row_private = ''; for( $i = 0; $i < count($groupdata); $i++ ) { $row_color = ( !( $i % 2 ) ) ? 'row1' : 'row2'; $row_private .= '<tr>'; $row_private .= '<td width="40%" class="'.$row_color.'" align="center"><span class="gen">'.$groupdata[$i]['group_name'].'</span></td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $this->block_info['auth_view'] == AUTH_ACL ) { $view_checked = in_array($groupdata[$i]['group_id'], $view_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="view[]" type="checkbox" ' . $view_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $this->block_info['auth_edit'] == AUTH_ACL ) { $edit_checked = in_array($groupdata[$i]['group_id'], $edit_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="edit[]" type="checkbox" ' . $edit_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; $row_private .= '<input name="moderator[]" type="checkbox" '. (( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') . '" value="'.$groupdata[$i]['group_id'].'" />'; $row_private .= '</td>'; $row_private .= '</tr>'; } $blockcptemplate->assign_block_vars('blockcp_permissions.grouprows', array( 'GROUP_ROWS' => $row_private )); } // // Load and display additional blockcp panels (if any) // $this->get_blockcp_panels($block_id); // // Load and display additional blockcp parameters (if any) // if (!empty($this->block_parameters)) { $this->get_blockcp_parameters($block_id); } return $template; } /* 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 // // // $action: MX_ADD, MX_EDIT // $type: MX_MODULE, MX_BLOCK, MX_BLOCK_SETTINGS, MX_FUNCTION, MX_PARAMETER, MX_PAGE, MX_PAGE_COLUMN, MX_PAGE_ITEM // function generate_cp( $id = '', $new_block = false ) { $action = $new_block ? MX_ADD : MX_EDIT; switch ( $action ) { case MX_ADD: $function_id = $id; $this->_controlpanel($function_id, $new_block ); break; case MX_EDIT: $block_id = $id; $this->_controlpanel($block_id, $new_block ); break; } } // // $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 ?> --- NEW FILE: mx_functions_core.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_functions_core.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1732 lines suppressed...] } function update_session_cache( $id = '' ) { global $mx_cache; if ($id == MX_ALL_BLOCKS) { $mx_cache->update( MX_ALL_BLOCKS ); } else if ($id == MX_ALL_PAGES) { $mx_cache->update( MX_ALL_PAGES ); } else { $mx_cache->update( MX_BLOCK, $id ); } } ?> Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_functions_phpbb.php 25 Apr 2005 23:56:08 -0000 1.9 --- mx_functions_phpbb.php 20 Aug 2005 18:19:11 -0000 1.10 *************** *** 33,36 **** --- 33,41 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + // // Hacking smilies_pass from phpbb/includes/bbcode.php --- mx_admincp.php DELETED --- --- NEW FILE: mx_functions_parameter.php --- <?php /** * mx_functions_parameter.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group, 2005 mxBB * email : jon...@ho... * * $Id: mx_functions_parameter.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } ?> --- mx_auth.php DELETED --- Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** template.php 1 May 2005 19:46:54 -0000 1.12 --- template.php 20 Aug 2005 18:19:11 -0000 1.13 *************** *** 19,22 **** --- 19,39 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + + /********************************************************************************\ + | Class: mx_Template + | The mx_Template class extends the native phpBB Template class, in reality only redefining the make_filename method. + | Thus modded phpBB templates (eg eXtreme Styles MOD) will also be available for mxBB. + | + | + | // + | // Usage examples: + | // + | + | Nothing new... + \********************************************************************************/ // Index: mx_form.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_form.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_form.php 9 Jan 2005 21:55:44 -0000 1.4 --- mx_form.php 20 Aug 2005 18:19:11 -0000 1.5 *************** *** 19,22 **** --- 19,27 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + class form { --- NEW FILE: mx_functions_admincp.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_functions_admincp.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License', or * ('at your option) any later version. [...1679 lines suppressed...] case MX_DO_UPGRADE: // GET VARS $message = $this->_do_upgrade($mode); break; case MX_DO_EXPORT: // GET VARS $message = $this->_do_export($mode); break; } if (!empty($message)) { return $message; } } } // class mx_admin ?> --- mx_cache.php DELETED --- Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** mx_functions.php 1 May 2005 16:02:12 -0000 1.43 --- mx_functions.php 20 Aug 2005 18:19:11 -0000 1.44 *************** *** 48,51 **** --- 48,56 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + /********************************************************************************\ | [...1088 lines suppressed...] - // Note: _x and _y are used by (at least IE) to return the mouse position at onclick of INPUT TYPE="img" elements. - return ( isset($HTTP_POST_VARS[$var]) || ( isset($HTTP_POST_VARS[$var.'_x']) && isset($HTTP_POST_VARS[$var.'_y']) ) ); - } - function is_get($var) - { - global $HTTP_GET_VARS; - return ( isset($HTTP_GET_VARS[$var]) ); - } - function is_request($var) - { - return ( $this->is_get($var) || $this->is_post($var) ); - } - - } // class mx_request_vars - - - ?> \ No newline at end of file --- 1526,1528 ---- |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:31
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_navmenu/language/lang_english Added Files: lang_admin.php lang_main.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: lang_main.php --- <?php /*************************************************************************** * lang_main.php * ------------------- * begin : Sunday, Mar 31, 2003 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: lang_main.php,v 1.1 2005/08/20 18:19:12 jonohlsson Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ ?> --- NEW FILE: lang_admin.php --- <?php /*************************************************************************** * lang_kb.php * ------------------- * begin : Sunday, Mar 31, 2003 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: lang_admin.php,v 1.1 2005/08/20 18:19:12 jonohlsson Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // // Menu Management // $lang['Menu_admin'] = "Navigation Menu Administration"; $lang['Menu_admin_explain'] = "Use this form to customize your Navigation Menu"; $lang['Menu_edit_delete_explain'] = "Use this form to customize your Navigation Menu"; $lang['Menu_settings'] = "Navigation Menu Information"; $lang['Menu_delete'] = "Delete a Navigation Menu"; $lang['Menu_delete_explain'] = "Use this form to delete (and/or move) a Navigation Menu and its subelement(s)"; $lang['Edit_menu'] = "Edit a Navigation Menu"; $lang['Create_menu'] = "Add new Navigation Menu"; $lang['Create_category'] = "Add new Navigation Category"; $lang['Menu_Config_updated'] = "Navigation Menu Configuration Updated Successfully"; $lang['Menus_updated'] = "Menu and Category information updated successfully"; $lang['Click_return_menuadmin'] = "Click %sHere%s to return to Navigation Menu Administration"; $lang['Menu_name'] = "Navigation Menu Name"; $lang['Menu_icon'] = "Navigation Menu Icon<br /> - the *_hot.gif pic is only used when 'Mark Current Page' is enabled."; $lang['Menu_desc'] = "Description"; $lang['Click_return_admin_index'] = "Click %sHere%s to return to the Administration Index"; $lang['Menu_links'] = "Menu URL<br />- Link to external page (enter full URL) or internal page (enter relative path)<br />- This option may be used together with 'Link Target: - iframe mode'."; $lang['Menu_page'] = "Menu Page (default/standard) <br />- link to internal portal page<br />NOTE: Pages are created using Page Administration."; $lang['Menu_block'] = "Dynamic Block<br />- need a dynamic block on the Page to handle the setting"; $lang['Menu_function'] = "Menu Function (dev only)<br />- link to mxBB specific function (not available)"; $lang['Menu_action_title'] = "<b>Menu Action:</b> <br /><i>(Chose one of the 4 options below.)</i> "; $lang['Menu_action_adv'] = "<b>Advanced Menu Actions:</b> <br /><i>(Use carefully - intended for developers only):</i>"; $lang['Menu_permissions_title'] = "<b>View/Edit Permissions:</b>"; $lang['Link_target'] = "Link Target:<br />- 'default', open in this browser<br />- 'new browser', open in new browser<br />- 'iframe mode', open url (given below) in page with IncludeX block."; $lang['Menu_display_mode'] = "Navigation Mode:<br /> - span horizontal or vertical"; $lang['Menu_page_sync'] = "Highlight selected page in navigation menu<br /> - current menu option is highlighted and its icon will be switched (if you have a *_hot.gif)"; $lang['Menu_par_title'] = "General Menu Navigation Settings:"; $lang['Show_cat'] = "Folded/Unfolded Category: <br /> - Default value, before user value is set:"; // // Parameter Types // $lang['ParType_kb_type_select'] = "Advanced phpBB Source Forum Selection"; $lang['ParType_kb_type_select_info'] = ""; $lang['ParType_default_article_id'] = "Default Article"; $lang['ParType_default_article_id_info'] = "- Article Reader"; // // Parameter Names // $lang['kb_type_select'] = "KB Source:"; $lang['kb_type_select_explain'] = "Select Source KB categories and article types"; $lang['default_article_id'] = "Default Article:"; $lang['default_article_id_explain'] = "- This article is default (first) displayed if noone else is chosen"; ?> |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:29
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_coreblocks Added Files: mx_blockcp.php Removed Files: mx_menu_nav.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- mx_menu_nav.php DELETED --- --- NEW FILE: mx_blockcp.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * $Id: mx_blockcp.php,v 1.1 2005/08/20 18:19:12 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ define( 'IN_PORTAL', 1 ); $mx_root_path = "./../../"; include($mx_root_path . 'extension.inc'); include($mx_root_path . 'common.' . $phpEx); include($mx_root_path . 'includes/mx_functions_blockcp.' . $phpEx); include($mx_root_path . 'includes/mx_functions_admincp.' . $phpEx); $view_page = false; // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); mx_init_userprefs($userdata); // // End session management // include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx); // required for search tables include_once($phpbb_root_path . "includes/functions_post.$phpEx"); // required by mx_generate_smilies // ********************************************************************** // Read language definition // ********************************************************************** // phpBB if( file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) { include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } else if( file_exists($phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx) ) { include($phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx); } // mxBB if( file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) { include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } else if( file_exists($mx_root_path . 'language/lang_english/lang_admin.' . $phpEx) ) { include($mx_root_path . 'language/lang_english/lang_admin.' . $phpEx); } // // Instatiate the mx_admin class // $mx_admin = new mx_admin(); // // Initialize template // $blockcptemplate = new mx_Template( $template->root, $board_config, $db ); // // Load BlockCp // $mx_blockcp = new mx_blockcp(); // // Mode setting // $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, ''); $blog_mode = $mx_request_vars->request('blog_mode', MX_TYPE_NO_TAGS, ''); $sid = $mx_request_vars->request('sid', MX_TYPE_NO_TAGS, ''); // // Initial vars // $block_id = $mx_request_vars->request('block_id', MX_TYPE_INT, ''); $portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, ''); $sub_id = $mx_request_vars->request('sub_id', MX_TYPE_INT, 0); $blog_u = $mx_request_vars->request('u', MX_TYPE_INT, $userdata['user_id']); // // Parameters // $submit = ( isset($HTTP_POST_VARS['submit']) ) ? true : false; $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; $preview = ( isset($HTTP_POST_VARS['preview']) ) ? true : false; $refresh = $preview || $submit_search; // // Cancel // if( $cancel ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid(PORTAL_URL . "index.$phpEx?page=" . $portalpage, true)); exit; } if ( empty($block_id) ) { $cookie_tmp = $board_config['cookie_name'].'_adminBlockCP_block_id'; $block_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : 1; } setcookie($board_config['cookie_name'] . '_adminBlockCP_block_id', $block_id, time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); $mx_blockcp->init($block_id, true); // // Auth // if ( !($mx_blockcp->auth_edit || $mx_blockcp->auth_mod) || $sid != $userdata['session_id']) { die('You are not authorized to edit this block :('); } // // SUBMIT? // if( $submit && !empty($mode) && !empty($action) ) { // // Get vars // // // Send to adminCP // $result_message = $mx_blockcp->submit_parameters($block_id); $message = $lang['BlockCP_Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_blockCP_admin'], '<a href="' . append_sid($mx_root_path ."modules/mx_coreblocks/mx_blockcp.$phpEx?block_id=$block_id&portalpage=$portalpage&sid=$sid") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_portalpage_admin'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?page=$portalpage") . '">', '</a>'); mx_message_die(GENERAL_MESSAGE, $message); } // if .. !empty($mode) $s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $block_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $portalpage . '" />'; $s_hidden_fields .= '<input type="hidden" name="sub_id" value="' . $sub_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="u" value="' . $blog_u . '" />'; $s_hidden_fields .= '<input type="hidden" name="blog_mode" value="' . $blog_mode . '" />'; // ********************************************************************** // Read language definition // ********************************************************************** // Module specific if( file_exists($mx_root_path . $mx_blockcp->module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) { include($mx_root_path . $mx_blockcp->module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } else if( file_exists($mx_root_path . $mx_blockcp->module_root_path . 'language/lang_english/lang_admin.' . $phpEx) ) { include($mx_root_path . $mx_blockcp->module_root_path . 'language/lang_english/lang_admin.' . $phpEx); } // // Load Dynamic Block Navigation // $mx_dynamic_select = new mx_dynamic_select(); $mx_dynamic_select->generate($block_id); // // Setup config parameters // //$block_config = $mode == 'editblog' ? read_block_config($block_id, false, $sub_id) : read_block_config($block_id, false); // // Blog mode: // //$blog_validate = ( $blog_mode == 'group' ) ? mx_auth_group($sub_id, true) : $sub_id == $userdata['user_id']; /* if( !($blog_validate || $is_auth_ary['auth_edit']) ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid(PORTAL_URL . "index.$phpEx", true)); exit; } */ // // Main ------------------------------------- // // // Start output // $blockcptemplate->set_filenames(array( 'body' => 'admin/mx_blockcp_admin_body.tpl' )); // // Variables // $blockcptemplate->assign_vars(array( 'CANCEL' => ' <input type="submit" name="cancel" value="' . $lang['Cancel'] . '"class="liteoption" />', 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', 'S_ACTION' => append_sid($mx_root_path . "modules/mx_coreblocks/mx_blockcp.$phpEx") )); $mx_blockcp->generate_cp($block_id, $new_block); $page_title = $lang['Block_admin']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); $blockcptemplate->pparse('body'); include($mx_root_path . 'includes/page_tail.' . $phpEx); ?> |
Update of /cvsroot/mxbb/core/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/templates/subSilver/admin Modified Files: index_frameset.tpl index_navigate.tpl mx_module_admin_body.tpl page_footer.tpl Removed Files: admin_mx_poll.tpl auth_mx_portal_body.tpl mx_announcement_admin.tpl mx_auth_portal_body.tpl mx_auth_select_body.tpl mx_block_admin_body.tpl mx_block_admin_column.tpl mx_block_auth_body.tpl mx_block_delete_body.tpl mx_block_edit_body.tpl mx_block_setting_body.tpl mx_category_edit_body.tpl mx_function_edit_body.tpl mx_language_body.tpl mx_menu_admin_body.tpl mx_menu_delete_body.tpl mx_menu_edit_body.tpl mx_module_edit_body.tpl mx_page_admin_body.tpl mx_page_admin_column.tpl mx_page_admin_column_template.tpl mx_page_admin_edit.tpl mx_page_auth_body.tpl mx_page_delete_body.tpl mx_page_edit_body.tpl mx_page_template_admin_body.tpl mx_parameter_edit_body.tpl Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- mx_block_setting_body.tpl DELETED --- --- mx_menu_delete_body.tpl DELETED --- --- mx_category_edit_body.tpl DELETED --- --- mx_function_edit_body.tpl DELETED --- --- admin_mx_poll.tpl DELETED --- --- mx_block_delete_body.tpl DELETED --- --- auth_mx_portal_body.tpl DELETED --- --- mx_menu_edit_body.tpl DELETED --- --- mx_menu_admin_body.tpl DELETED --- --- mx_auth_select_body.tpl DELETED --- --- mx_auth_portal_body.tpl DELETED --- --- mx_block_auth_body.tpl DELETED --- Index: page_footer.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/page_footer.tpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** page_footer.tpl 27 Apr 2005 21:51:36 -0000 1.6 --- page_footer.tpl 20 Aug 2005 18:19:12 -0000 1.7 *************** *** 17,21 **** <div align="center"><span class="copyright">Powered by <a href="http://www.mx-system.com/" target="_mx-system" class="copyright">mxBB-Portal</a> {MX_VERSION} © 2001, 2005 & <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001, 2005 phpBB Group</span></div> ! </body> </html> \ No newline at end of file --- 17,22 ---- <div align="center"><span class="copyright">Powered by <a href="http://www.mx-system.com/" target="_mx-system" class="copyright">mxBB-Portal</a> {MX_VERSION} © 2001, 2005 & <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001, 2005 phpBB Group</span></div> ! <!-- This displays generation info at the bottom of the page --> ! {EXECUTION_STATS} </body> </html> \ No newline at end of file Index: index_navigate.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/index_navigate.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index_navigate.tpl 27 Apr 2005 21:51:36 -0000 1.3 --- index_navigate.tpl 20 Aug 2005 18:19:12 -0000 1.4 *************** *** 1,2 **** --- 1,224 ---- + <script language="javascript" type="text/javascript"> + <!-- + + /************************************************************* + * DHTML Slide Menu for ACP MOD + * + * Copyright (C) 2004, Markus (phpMiX) + * This script is released under GPL License. + * Feel free to use this script (or part of it) wherever you need + * it ...but please, give credit to original author. Thank you. :-) + * We will also appreciate any links you could give us. + * + * Enjoy! ;-) + * + * This MOD is adapted for mxBB adminCP, by Jon + *************************************************************/ + + function getCookie(name) + { + var cookies = document.cookie; + var start = cookies.indexOf(name + '='); + if( start < 0 ) return null; + var len = start + name.length + 1; + var end = cookies.indexOf(';', len); + if( end < 0 ) end = cookies.length; + return unescape(cookies.substring(len, end)); + } + function setCookie(name, value, expires, path, domain, secure) + { + document.cookie = name + '=' + escape (value) + + ((expires) ? '; expires=' + ( (expires == 'never') ? 'Thu, 31-Dec-2099 23:59:59 GMT' : expires.toGMTString() ) : '') + + ((path) ? '; path=' + path : '') + + ((domain) ? '; domain=' + domain : '') + + ((secure) ? '; secure' : ''); + } + function delCookie(name, path, domain) + { + if( getCookie(name) ) + { + document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT' + + ((path) ? '; path=' + path : '') + + ((domain) ? '; domain=' + domain : ''); + } + } + + function menuCat(id, rows, mode) + { + this.cat_id = id; + this.cat_rows = rows; + this.menu_mode = mode; + this.status = 'none'; + } + var menuCats = new Array(); + + <!-- BEGIN module_portal --> + <!-- BEGIN catrow --> + menuCats['menuPortal_{module_portal.catrow.MENU_CAT_ID}'] = new menuCat('{module_portal.catrow.MENU_CAT_ID}', {module_portal.catrow.MENU_CAT_ROWS}, 'menuPortal_'); + <!-- END catrow --> + <!-- END module_portal --> + + <!-- BEGIN module_mx --> + <!-- BEGIN catrow --> + menuCats['menuMX_{module_mx.catrow.MENU_CAT_ID}'] = new menuCat('{module_mx.catrow.MENU_CAT_ID}', {module_mx.catrow.MENU_CAT_ROWS}, 'menuMX_'); + <!-- END catrow --> + <!-- END module_mx --> + + <!-- BEGIN module_phpbb --> + <!-- BEGIN catrow --> + menuCats['menuphpBB_{module_phpbb.catrow.MENU_CAT_ID}'] = new menuCat('{module_phpbb.catrow.MENU_CAT_ID}', {module_phpbb.catrow.MENU_CAT_ROWS}, 'menuphpBB_'); + <!-- END catrow --> + <!-- END module_phpbb --> + + function getObj(obj) + { + return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) ); + } + function displayObj(obj, status) + { + var x = getObj(obj); + if( x && x.style ) x.style.display = status; + } + + var queueInterval = 20; // milliseconds between queued steps. + var execInterval = 0; + var queuedSteps; + var currentStep; + + function queueStep(o, s) + { + this.obj = o; + this.status = s; + } + function execQueue() + { + if( currentStep < queuedSteps.length ) + { + var obj = queuedSteps[currentStep].obj; + var status = queuedSteps[currentStep].status; + displayObj(obj, status); + if( menuCats[obj] ) menuCats[obj].status = status; + currentStep++; + setTimeout("execQueue();", execInterval); + } + else + { + execInterval = queueInterval; + } + } + function onMenuCatClick(cat_id, type, init) + { + var currentCat, currentStatus; + + currentCat = type + cat_id; + currentStatus = menuCats[currentCat].status; + + queuedSteps = new Array(); + currentStep = 0; + + for( var catName in menuCats ) + { + if( (menuCats[catName].menu_mode == type && menuCats[catName].status == 'block')) + { + for( var i=(menuCats[catName].cat_rows-1); i >= 0; i-- ) + { + queuedSteps[currentStep++] = new queueStep(catName+'_'+i, 'none'); + } + queuedSteps[currentStep++] = new queueStep(catName, 'none'); + menuCats[catName].status == 'none'; + + if( document.images && document.images['image_' + catName] ) + { + document.images['image_' + catName].src = '{IMG_URL_EXPAND}'; + } + } + } + + if( currentStatus == 'none' ) + { + queuedSteps[currentStep++] = new queueStep(currentCat, 'block'); + for( var i=0; i < menuCats[currentCat].cat_rows; i++ ) + { + queuedSteps[currentStep++] = new queueStep(currentCat+'_'+i, 'block'); + } + menuCats[currentCat].status == 'block'; + + var expdate = new Date(); // 72 Hours from now + expdate.setTime(expdate.getTime() + (72 * 60 * 60 * 1000)); + setCookie('{COOKIE_NAME}_'+type+'cat_id', cat_id, expdate, + ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', + ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}', + ('{COOKIE_SECURE}' == '0') ? false : true); + + if( document.images && document.images['image_' + currentCat] ) + { + document.images['image_' + currentCat].src = '{IMG_URL_CONTRACT}'; + } + } + else + { + delCookie('{COOKIE_NAME}_'+type+'cat_id', + ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', + ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}'); + } + currentStep = 0; + setTimeout("execQueue();", execInterval); + } + + function doOnLoadMenuACP() + { + var cat_id; + + if( getObj('menuPortal_0') ) + { + cat_id = getCookie('{COOKIE_NAME}_menuPortal_cat_id'); + if( !menuCats['menuPortal_'+cat_id] ) + { + cat_id = 0; + } + else + { + menuCats['menuPortal_'+cat_id].status = 'none'; + } + onMenuCatClick(cat_id, 'menuPortal_', 'true'); + } + + if( getObj('menuMX_0') ) + { + cat_id = getCookie('{COOKIE_NAME}_menuMX_cat_id'); + if( !menuCats['menuMX_'+cat_id] ) + { + cat_id = 0; + } + else + { + menuCats['menuMX_'+cat_id].status = 'none'; + } + } + + if( getObj('menuphpBB_0') ) + { + cat_id = getCookie('{COOKIE_NAME}_menuphpBB_cat_id'); + if( !menuCats['menuphpBB_'+cat_id] ) + { + cat_id = 0; + } + else + { + menuCats['menuphpBB_'+cat_id].status = 'none'; + } + } + + if( oldOnLoadMenuACP ) + { + oldOnLoadMenuACP(); + } + } + var oldOnLoadMenuACP = window.onload; + window.onload = doOnLoadMenuACP; + + // --> + </script> + <table width="100%" cellpadding="4" cellspacing="0" border="0" align="center"> <tr> *************** *** 36,46 **** <!-- BEGIN catrow --> <tr> ! <td class="catSides"><span class="cattitle">{module_portal.catrow.ADMIN_CATEGORY}</span></td> </tr> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><span class="genmed"><a href="{module_portal.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_portal.catrow.modulerow.ADMIN_MODULE}</a></span></td> </tr> - <!-- END modulerow --> <!-- END catrow --> </table> --- 258,276 ---- <!-- BEGIN catrow --> <tr> ! <td class="catSides" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module_portal.catrow.MENU_CAT_ID}','menuPortal_');"><img name="image_menuPortal_{module_portal.catrow.MENU_CAT_ID}" src="{IMG_URL_EXPAND}" border="0" align="absmiddle"> <span class="cattitle"><a>{module_portal.catrow.ADMIN_CATEGORY}</a></span></td> </tr> ! <tr> ! <td class="row1"> ! <div id="menuPortal_{module_portal.catrow.MENU_CAT_ID}" style="display:none;"> ! <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bodyline"> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><div id="menuPortal_{module_portal.catrow.MENU_CAT_ID}_{module_portal.catrow.modulerow.ROW_COUNT}" style="display:block;" class="genmed"><a href="{module_portal.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_portal.catrow.modulerow.ADMIN_MODULE}</a></div></td> ! </tr> ! <!-- END modulerow --> ! </table> ! </div> ! </td> </tr> <!-- END catrow --> </table> *************** *** 57,67 **** <!-- BEGIN catrow --> <tr> ! <td class="catSides"><span class="cattitle">{module_mx.catrow.ADMIN_CATEGORY}</span></td> </tr> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><span class="genmed"><a href="{module_mx.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_mx.catrow.modulerow.ADMIN_MODULE}</a></span></td> </tr> - <!-- END modulerow --> <!-- END catrow --> </table> --- 287,305 ---- <!-- BEGIN catrow --> <tr> ! <td class="catSides" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module_mx.catrow.MENU_CAT_ID}', 'menuMX_');"><img name="image_menuMX_{module_mx.catrow.MENU_CAT_ID}" src="{IMG_URL_EXPAND}" border="0" align="absmiddle"> <span class="cattitle">{module_mx.catrow.ADMIN_CATEGORY}</span></td> </tr> ! <tr> ! <td class="row1"> ! <div id="menuMX_{module_mx.catrow.MENU_CAT_ID}" style="display:none;"> ! <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bodyline"> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><div id="menuMX_{module_mx.catrow.MENU_CAT_ID}_{module_mx.catrow.modulerow.ROW_COUNT}" style="display:block;" class="genmed"><a href="{module_mx.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_mx.catrow.modulerow.ADMIN_MODULE}</a></div></td> ! </tr> ! <!-- END modulerow --> ! </table> ! </div> ! </td> </tr> <!-- END catrow --> </table> *************** *** 78,88 **** <!-- BEGIN catrow --> <tr> ! <td class="catSides"><span class="cattitle">{module_phpbb.catrow.ADMIN_CATEGORY}</span></td> </tr> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><span class="genmed"><a href="{module_phpbb.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_phpbb.catrow.modulerow.ADMIN_MODULE}</a></span></td> </tr> - <!-- END modulerow --> <!-- END catrow --> </table> --- 316,334 ---- <!-- BEGIN catrow --> <tr> ! <td class="catSides" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module_phpbb.catrow.MENU_CAT_ID}', 'menuphpBB_');"><img name="image_menuphpBB_{module_phpbb.catrow.MENU_CAT_ID}" src="{IMG_URL_EXPAND}" border="0" align="absmiddle"> <span class="cattitle">{module_phpbb.catrow.ADMIN_CATEGORY}</span></td> </tr> ! <tr> ! <td class="row1"> ! <div id="menuphpBB_{module_phpbb.catrow.MENU_CAT_ID}" style="display:none;"> ! <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bodyline"> ! <!-- BEGIN modulerow --> ! <tr> ! <td class="row1"><div id="menuphpBB_{module_phpbb.catrow.MENU_CAT_ID}_{module_phpbb.catrow.modulerow.ROW_COUNT}" style="display:block;" class="genmed"><a href="{module_phpbb.catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{module_phpbb.catrow.modulerow.ADMIN_MODULE}</a></div></td> ! </tr> ! <!-- END modulerow --> ! </table> ! </div> ! </td> </tr> <!-- END catrow --> </table> *************** *** 90,92 **** </td> </tr> ! </table> \ No newline at end of file --- 336,339 ---- </td> </tr> ! </table> ! --- mx_page_admin_edit.tpl DELETED --- --- mx_module_edit_body.tpl DELETED --- --- mx_block_edit_body.tpl DELETED --- --- mx_language_body.tpl DELETED --- --- mx_page_admin_body.tpl DELETED --- --- mx_page_admin_column.tpl DELETED --- --- mx_page_delete_body.tpl DELETED --- --- mx_block_admin_column.tpl DELETED --- Index: mx_module_admin_body.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/mx_module_admin_body.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_module_admin_body.tpl 9 Jan 2005 21:55:45 -0000 1.4 --- mx_module_admin_body.tpl 20 Aug 2005 18:19:12 -0000 1.5 *************** *** 1,53 **** ! <h1>{L_MODULE_TITLE}</h1> ! <P>{L_MODULE_TEXT}</p> ! <form method="post" action="{S_ACTION}"><table width="100%" cellspacing="1" cellpadding="4" border="0" align="center" class="forumline"> <tr> ! <th class="thCornerL">{L_CODE}</th> ! <th class="thTop">{L_MODULE_NAME}</th> ! <th class="thTop">{L_MODULE_DESC}</th> ! <th colspan="2" class="thCornerR">{L_ACTION}</th> </tr> <!-- BEGIN module --> ! <tr> ! <td class="{module.ROW_CLASS}">{module.CODE}</td> ! <td class="{module.ROW_CLASS}">{module.NAME}</td> ! <td class="{module.ROW_CLASS}">{module.DESC}</td> ! <td class="{module.ROW_CLASS}"><a href="{module.U_EDIT}">{L_EDIT}</a></td> ! <td class="{module.ROW_CLASS}"><a href="{module.U_DELETE}">{L_UNINSTALL}</a></td> ! </tr> <!-- END module --> ! <tr> ! <td class="catBottom" colspan="5" align="center">{S_HIDDEN_FIELDS_MODULE}<input class="mainoption" type="submit" name="import_pack" value="{L_IMPORT_PACK}"> <input class="mainoption" type="submit" name="upgrade_module" value="{L_UPGRADE_PACK}"> <input type="submit" name="add" value="{L_ADD}" class="liteoption" /> <input class="liteoption" type="submit" name="export_pack" value="{L_EXPORT_PACK}"></td> ! </tr> ! </table></form> - <br /> - <h1>{L_FUNCTION_TITLE}</h1> - <P>{L_FUNCTION_TEXT}</p> - <br /> - <form method="post" action="{S_ACTION}"><table width="100%" cellspacing="1" cellpadding="5" border="0" align="center" class="forumline"> - <tr> - <th class="thCornerL">{L_MODULE_NAME}</th> - <th class="thTop">{L_CODE}</th> - <th class="thTop">{L_FUNCTION_NAME}</th> - <th class="thTop">{L_FUNCTION_DESC}</th> - <th colspan="2" class="thCornerR">{L_ACTION}</th> - </tr> - <!-- BEGIN function --> - <tr> - <td class="{function.ROW_CLASS}">{function.MODULE}</td> - <td class="{function.ROW_CLASS}">{function.CODE}</td> - <td class="{function.ROW_CLASS}">{function.NAME}</td> - <td class="{function.ROW_CLASS}">{function.DESC}</td> - <td class="{function.ROW_CLASS}"><a href="{function.U_EDIT}">{L_EDIT}</a></td> - <td class="{function.ROW_CLASS}"><a href="{function.U_DELETE}">{L_DELETE}</a></td> - </tr> - <!-- END function --> - <tr> - <td class="catBottom" colspan="6" align="center">{S_HIDDEN_FIELDS_FUNCTION}<input type="submit" name="add" value="{L_ADD_FUNCTION}" class="mainoption" /></td> - </tr> - </table></form> --- 1,338 ---- + <script type="text/javascript"> ! function getCookie(name) ! { ! var cookies = document.cookie; ! var start = cookies.indexOf(name + '='); ! if( start < 0 ) return null; ! var len = start + name.length + 1; ! var end = cookies.indexOf(';', len); ! if( end < 0 ) end = cookies.length; ! return unescape(cookies.substring(len, end)); ! } ! function setCookie(name, value, expires, path, domain, secure) ! { ! document.cookie = name + '=' + escape (value) + ! ((expires) ? '; expires=' + ( (expires == 'never') ? 'Thu, 31-Dec-2099 23:59:59 GMT' : expires.toGMTString() ) : '') + ! ((path) ? '; path=' + path : '') + ! ((domain) ? '; domain=' + domain : '') + ! ((secure) ? '; secure' : ''); ! } ! function delCookie(name, path, domain) ! { ! if( getCookie(name) ) ! { ! document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT' + ! ((path) ? '; path=' + path : '') + ! ((domain) ? '; domain=' + domain : ''); ! } ! } ! function menuCat(id, mode, visible) ! { ! this.cat_id = id; ! this.menu_mode = mode; ! this.status = visible != '' ? visible : 'none'; ! } ! var menuCats = new Array(); ! <!-- BEGIN module --> ! menuCats['adminModule_{module.MODULE_ID}'] = new menuCat('{module.MODULE_ID}', 'adminModule_', '{module.VISIBLE}'); ! menuCats['adminModuleUpgrade_{module.MODULE_ID}'] = new menuCat('{module.MODULE_ID}', 'adminModuleUpgrade_', '{module.VISIBLE_UPGRADE}'); ! menuCats['adminModuleExport_{module.MODULE_ID}'] = new menuCat('{module.MODULE_ID}', 'adminModuleExport_', '{module.VISIBLE_EXPORT}'); ! menuCats['adminModuleDelete_{module.MODULE_ID}'] = new menuCat('{module.MODULE_ID}', 'adminModuleDelete_', '{module.VISIBLE_DELETE}'); ! <!-- END module --> ! ! ! function getObj(obj) ! { ! return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) ); ! } ! function displayObj(obj, status) ! { ! var x = getObj(obj); ! if( x && x.style ) x.style.display = status; ! } ! ! var queueInterval = 0; // milliseconds between queued steps. ! var execInterval = 0; ! var queuedSteps; ! var currentStep; ! ! function queueStep(o, s) ! { ! this.obj = o; ! this.status = s; ! } ! function execQueue() ! { ! if( currentStep < queuedSteps.length ) ! { ! var obj = queuedSteps[currentStep].obj; ! var status = queuedSteps[currentStep].status; ! displayObj(obj, status); ! if( menuCats[obj] ) menuCats[obj].status = status; ! currentStep++; ! setTimeout("execQueue();", execInterval); ! } ! else ! { ! execInterval = queueInterval; ! } ! } ! function onMenuCatClick(cat_id, type, init) ! { ! var currentCat, currentStatus; ! var imageSCR = type+'image_'+cat_id; ! var strSubmitContent = ''; ! ! parentCatMode = 'adminModule_'; ! parentCat = parentCatMode + cat_id; ! ! currentCat = type + cat_id; ! ! currentStatus = menuCats[currentCat].status; ! ! queuedSteps = new Array(); ! cookieArray = new Array(); ! ! currentStep = 0; ! ! for( var forCat in menuCats ) ! { ! if( (init == 'true' && (menuCats[forCat].status == 'block') && menuCats[forCat].menu_mode == parentCatMode) || ! (init != 'true' && ! ( (menuCats[forCat].status == 'block') ))) ! { ! queuedSteps[currentStep++] = new queueStep(forCat, 'none'); ! menuCats[forCat].status = 'none'; ! ! forCatimage = menuCats[forCat].menu_mode+'image_'+menuCats[forCat].cat_id; ! if( document.images && document.images[forCatimage] ) ! { ! document.images[forCatimage].src = '{IMG_URL_EXPAND}'; ! } ! } ! } ! ! if( currentStatus == 'none' ) ! { ! ! queuedSteps[currentStep++] = new queueStep(currentCat, 'block'); ! menuCats[currentCat].status = 'block'; ! ! if (currentCat == parentCat) ! { ! var expdate = new Date(); // 72 Hours from now ! expdate.setTime(expdate.getTime() + (72 * 60 * 60 * 1000)); ! setCookie('{COOKIE_NAME}_'+type+'module_id', cat_id, expdate, ! ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ! ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}', ! ('{COOKIE_SECURE}' == '0') ? false : true); ! } ! ! if( document.images && document.images[imageSCR] ) ! { ! document.images[imageSCR].src = '{IMG_URL_CONTRACT}'; ! } ! } ! else ! { ! delCookie('{COOKIE_NAME}_'+type+'module_id', ! ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ! ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}'); ! } ! ! for( var forCat in menuCats ) ! { ! if ( menuCats[forCat].status == 'block' ) ! { ! strSubmitContent += forCat + ','; ! } ! } ! ! // Remove trailing separator ! strSubmitContent = strSubmitContent.substr(0, strSubmitContent.length - 1); ! ! setCookie('{COOKIE_NAME}_admincp_blockstates', strSubmitContent, expdate, ! ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ! ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}', ! ('{COOKIE_SECURE}' == '0') ? false : true); ! ! currentStep = 0; ! setTimeout("execQueue();", execInterval); ! } ! ! function doOnLoadMenuACP() ! { ! var cat_id; ! ! if( getObj('adminModule_' + '{NAV_MODULE_ID}') ) ! { ! if ( '{NAV_MODULE_ID}' > 0 ) ! { ! cat_id = '{NAV_MODULE_ID}'; ! } ! else ! { ! cat_id = getCookie('{COOKIE_NAME}_adminModule_module_id'); ! } ! ! if( menuCats['adminModule_'+cat_id] ) ! { ! menuCats['adminModule_'+cat_id].status = 'none'; ! onMenuCatClick(cat_id, 'adminModule_', 'true'); ! } ! } ! ! if( oldOnLoadMenuACP ) ! { ! oldOnLoadMenuACP(); ! } ! } ! ! ! ! var oldOnLoadMenuACP = window.onload; ! window.onload = doOnLoadMenuACP; ! ! // --> ! </script> ! ! <h1>{L_TITLE}</h1> ! ! <p>{L_EXPLAIN}</p> ! ! <form method="post" name="jumpbox" action="{S_ACTION}"> ! <table cellspacing="0" cellpadding="0" border="0" width="100%"> ! <tr> ! <td nowrap="nowrap" align="right"><span class="gensmall">{L_QUICK_NAV} ! {MODULE_SELECT_BOX} ! <input type="submit" value="{S_SUBMIT}" class="liteoption" /></span> ! </td> ! </tr> ! </table> ! </form> ! ! <table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline" align="center"> <tr> ! <th class="thHead" colspan="5">{L_TITLE}</th> </tr> + <tr> + <td class="catBottom" colspan="5" align="center">{S_HIDDEN_FIELDS_MODULE}<input class="mainoption" type="submit" name="import_pack" value="{L_IMPORT_PACK}"></td> + </tr> <!-- BEGIN module --> ! <tr title="{L_TITLE}"> ! <td width="40%" class="catLeft" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModule_');"> <span class="cattitle"><img name="adminModule_image_{module.MODULE_ID}" src="{module.IMG_URL}" border="0" align="absmiddle"> <img src="{IMG_ICON_MODULE}" border="0" align="absmiddle"> {module.MODULE_TITLE}</span> <span class="gensmall">{module.MODULE_DESCRIPTION}</span><br /> <span class="gensmall"><i>{module.MODULE_VERSION}</i></span></td> ! <td width="15%" class="cat" align="center" valign="middle"> ! <!-- BEGIN settings --> ! <img src="{IMG_URL_EXPAND}" border="0" align="absmiddle"> <span class="cattitle"><a href="{module.U_MODULE}">{L_SETTING}</a></span> ! <!-- END settings --> ! </td> ! <td width="15%" class="cat" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleUpgrade_');"> ! <!-- BEGIN settings --> ! <img name="adminModuleUpgrade_image_{module.MODULE_ID}" src="{module.IMG_URL_UPGRADE}" border="0" align="absmiddle"> <span class="genmed">{L_UPGRADE_PACK}</span> ! <!-- END settings --> ! </td> ! <td width="15%" class="cat" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleExport_');"> ! <!-- BEGIN settings --> ! <img name="adminModuleExport_image_{module.MODULE_ID}" src="{module.IMG_URL_EXPORT}" border="0" align="absmiddle"> <span class="genmed">{L_EXPORT_PACK}</span> ! <!-- END settings --> ! </td> ! <td width="15%" class="catRight" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleDelete_');"> ! <!-- BEGIN settings --> ! <img name="adminModuleDelete_image_{module.MODULE_ID}" src="{module.IMG_URL_DELETE}" border="0" align="absmiddle"> <span class="genmed">{L_UNINSTALL}</span> ! <!-- END settings --> ! </td> ! </tr> ! ! <!-- Module Delete --> ! <tr> ! <td colspan="5" class="row1"> ! <div id="adminModuleDelete_{module.MODULE_ID}" style="display:{module.VISIBLE_DELETE};" class="genmed"> ! <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> ! <tr> ! <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleDelete_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{L_UNINSTALL}</span></td> ! </tr> ! <tr> ! <td width="50%" align="center" colspan="2">{module.MESSAGE_DELETE}</td> ! </tr> ! </table> ! </div> ! </td> ! </tr> ! <!-- Module Delete --> ! ! <!-- Module Upgrade --> ! <tr> ! <td colspan="5" class="row1"> ! <div id="adminModuleUpgrade_{module.MODULE_ID}" style="display:{module.VISIBLE_UPGRADE};" class="genmed"> ! <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> ! <tr> ! <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleUpgrade_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{L_UPGRADE_PACK}</span></td> ! </tr> ! <tr> ! <td width="50%" align="center" colspan="2">{module.MESSAGE_UPGRADE}</td> ! </tr> ! </table> ! </div> ! </td> ! </tr> ! <!-- Module Upgrade --> ! ! <!-- Module Export --> ! <tr> ! <td colspan="5" class="row1"> ! <div id="adminModuleExport_{module.MODULE_ID}" style="display:{module.VISIBLE_EXPORT};" class="genmed"> ! <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> ! <tr> ! <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModuleExport_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{L_EXPORT_PACK}</span></td> ! </tr> ! <tr> ! <td width="50%" align="center" colspan="2">{module.MESSAGE_EXPORT}</td> ! </tr> ! </table> ! </div> ! </td> ! </tr> ! <!-- Module Export --> ! ! <!-- Module Settings --> ! <tr> ! <td colspan="5" class="row1"> ! <div id="adminModule_{module.MODULE_ID}" style="display:{module.VISIBLE};" class="genmed"> ! <form action="{S_ACTION}" method="post"> ! <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> ! <tr> ! <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{module.MODULE_ID}','adminModule_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{module.L_TITLE}</span></td> ! </tr> ! <tr> ! <td width="50%" align="right" >{L_MODULE_NAME}</td> ! <td ><input type="text" size="50" name="module_name" value="{module.E_MODULE_NAME}" class="post" /></td> ! </tr> ! <tr> ! <td width="50%" align="right" >{L_MODULE_DESC}</td> ! <td ><input type="text" size="50" name="module_desc" value="{module.E_MODULE_DESC}" class="post" /></td> ! </tr> ! <tr> ! <td width="50%" align="right" >{L_MODULE_PATH}</td> ! <td ><input type="text" size="50" name="module_path" value="{module.E_MODULE_PATH}" class="post" /></td> ! </tr> ! <tr> ! <td width="50%" align="right" >{L_MODULE_INCLUDE_ADMIN}</td> ! <td ><input type="checkbox" size="45" name="module_include_admin" value="1" {module.E_MODULE_INCLUDE_CHECK_OPT}/></td> ! </tr> ! <tr> ! <td class="row2" colspan="2" align="center">{module.S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{module.S_SUBMIT}" class="liteoption" /></td> ! </tr> ! </table> ! </form> ! </div> ! </td> ! </tr> ! <!-- Module Settings --> ! <!-- END module --> ! </table> --- mx_page_auth_body.tpl DELETED --- --- mx_announcement_admin.tpl DELETED --- --- mx_page_admin_column_template.tpl DELETED --- --- mx_block_admin_body.tpl DELETED --- --- mx_parameter_edit_body.tpl DELETED --- --- mx_page_template_admin_body.tpl DELETED --- Index: index_frameset.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/index_frameset.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index_frameset.tpl 27 Apr 2005 21:53:48 -0000 1.4 --- index_frameset.tpl 20 Aug 2005 18:19:12 -0000 1.5 *************** *** 5,9 **** </head> ! <frameset cols="170,*" rows="*" border="1" framespacing="0" frameborder="yes"> <frame src="{S_FRAME_NAV}" name="nav" marginwidth="3" marginheight="3" scrolling="auto" /> <frame src="{S_FRAME_MAIN}" name="main" marginwidth="10" marginheight="10" scrolling="auto" /> --- 5,9 ---- </head> ! <frameset cols="190,*" rows="*" border="1" framespacing="0" frameborder="yes"> <frame src="{S_FRAME_NAV}" name="nav" marginwidth="3" marginheight="3" scrolling="auto" /> <frame src="{S_FRAME_MAIN}" name="main" marginwidth="10" marginheight="10" scrolling="auto" /> --- mx_page_edit_body.tpl DELETED --- |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:29
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_navmenu/templates/subSilver/admin Added Files: mx_module_parameters.tpl Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: mx_module_parameters.tpl --- <script type="text/javascript"> function getCookie(name) { var cookies = document.cookie; var start = cookies.indexOf(name + '='); if( start < 0 ) return null; var len = start + name.length + 1; var end = cookies.indexOf(';', len); if( end < 0 ) end = cookies.length; return unescape(cookies.substring(len, end)); } function setCookie(name, value, expires, path, domain, secure) { document.cookie = name + '=' + escape (value) + ((expires) ? '; expires=' + ( (expires == 'never') ? 'Thu, 31-Dec-2099 23:59:59 GMT' : expires.toGMTString() ) : '') + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : '') + ((secure) ? '; secure' : ''); } function delCookie(name, path, domain) { if( getCookie(name) ) { document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT' + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : ''); } } function handleError() { return true; } window.onerror = handleError; function menuCat(id, mode, visible, page_nav, block_nav, function_nav) { this.cat_id = id; this.block_nav = block_nav; this.page_nav = page_nav; this.function_nav = function_nav; this.menu_mode = mode; this.status = visible != '' ? visible : 'none'; } var menuCats = new Array(); <!-- BEGIN catrow --> menuCats['adminCat_{catrow.CAT_ID}'] = new menuCat('{catrow.CAT_ID}', 'adminCat_', '{catrow.VISIBLE}', '', '', ''); menuCats['adminCatEdit_{catrow.CAT_ID}'] = new menuCat('{catrow.CAT_ID}', 'adminCatEdit_', '{catrow.VISIBLE_EDIT}', '{catrow.PAGE_NAV}', '', ''); menuCats['adminCatDelete_{catrow.CAT_ID}'] = new menuCat('{catrow.CAT_ID}', 'adminCatDelete_', '{catrow.VISIBLE_DELETE}', '', '', ''); <!-- BEGIN menurow --> menuCats['adminMenuEdit_{catrow.menurow.MENU_ID}'] = new menuCat('{catrow.menurow.MENU_ID}', 'adminMenuEdit_', '{catrow.menurow.VISIBLE_EDIT}', '{catrow.menurow.PAGE_NAV}', '{catrow.menurow.BLOCK_NAV}', '{catrow.menurow.FUNCTION_NAV}'); menuCats['adminMenuDelete_{catrow.menurow.MENU_ID}'] = new menuCat('{catrow.menurow.MENU_ID}', 'adminMenuDelete_', '{catrow.menurow.VISIBLE_DELETE}', '', '', ''); <!-- END menurow --> <!-- END catrow --> function getObj(obj) { return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) ); } function displayObj(obj, status) { var x = getObj(obj); if( x && x.style ) x.style.display = status; } var queueInterval = 0; // milliseconds between queued steps. var execInterval = 0; var queuedSteps; var currentStep; function queueStep(o, s) { this.obj = o; this.status = s; } function execQueue() { if( currentStep < queuedSteps.length ) { var obj = queuedSteps[currentStep].obj; var status = queuedSteps[currentStep].status; displayObj(obj, status); if( menuCats[obj] ) menuCats[obj].status = status; currentStep++; setTimeout("execQueue();", execInterval); } else { execInterval = queueInterval; } } function onMenuCatClick(cat_id, type, init) { var currentCat, currentStatus; var imageSCR = type+'image_'+cat_id; var strSubmitContent = ''; parentCatMode = 'adminCat_'; parentCatEditMode = 'adminCatEdit_'; parentCatDeleteMode = 'adminCatDelete_'; parentMenuEditMode = 'adminMenuEdit_'; parentMenuDeleteMode = 'adminMenuDelete_'; parentCat = parentCatMode + cat_id; parentCatEdit = parentCatEditMode + cat_id; parentCatDelete = parentCatDeleteMode + cat_id; parentMenuEdit = parentMenuEditMode + cat_id; parentMenuDelete = parentMenuDeleteMode + cat_id; currentCat = type + cat_id; currentStatus = menuCats[currentCat].status; queuedSteps = new Array(); cookieArray = new Array(); currentStep = 0; for( var forCat in menuCats ) { if( (init == 'true' && (menuCats[forCat].status == 'block') && menuCats[forCat].menu_mode == parentCat) || (init != 'true' && ( (currentCat == parentCat && menuCats[forCat].status == 'block') || (currentCat == parentCatEdit && menuCats[forCat].menu_mode != parentCat && menuCats[forCat].status == 'block') || (currentCat == parentCatDelete && menuCats[forCat].menu_mode != parentCat && menuCats[forCat].status == 'block') || (currentCat == parentMenuEdit && menuCats[forCat].menu_mode != parentCatMode && menuCats[forCat].status == 'block') || (currentCat == parentMenuDelete && menuCats[forCat].menu_mode != parentCatMode && menuCats[forCat].status == 'block') ))) { queuedSteps[currentStep++] = new queueStep(forCat, 'none'); menuCats[forCat].status = 'none'; forCatimage = menuCats[forCat].menu_mode+'image_'+menuCats[forCat].cat_id; if( document.images && document.images[forCatimage] ) { document.images[forCatimage].src = '{IMG_URL_EXPAND}'; } } } if( currentStatus == 'none' ) { if (menuCats[parentCat]) { if (menuCats[parentCat].status == 'none') { queuedSteps[currentStep++] = new queueStep(parentCat, 'block'); menuCats[parentCat].status = 'block'; forCatimage = menuCats[parentCat].menu_mode+'image_'+menuCats[parentCat].cat_id; if( document.images && document.images[forCatimage] ) { document.images[forCatimage].src = '{IMG_URL_CONTRACT}'; } } } queuedSteps[currentStep++] = new queueStep(currentCat, 'block'); menuCats[currentCat].status = 'block'; if (currentCat == parentCat) { var expdate = new Date(); // 72 Hours from now expdate.setTime(expdate.getTime() + (72 * 60 * 60 * 1000)); setCookie('{COOKIE_NAME}_'+type+'xxx_id', cat_id, expdate, ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}', ('{COOKIE_SECURE}' == '0') ? false : true); } if( document.images && document.images[imageSCR] ) { document.images[imageSCR].src = '{IMG_URL_CONTRACT}'; } // Update Form Selects if (parentCatEditMode == type) { EditForm = 'form_' + parentCatEditMode + cat_id; duplicateForm(document.fromForm.pages, document.forms[EditForm].cat_url_sel, menuCats[currentCat].page_nav); } if (parentMenuEditMode == type) { EditForm = 'form_' + parentMenuEditMode + cat_id; duplicateForm(document.fromForm.blocks, document.forms[EditForm].block_nav, menuCats[currentCat].block_nav); duplicateForm(document.fromForm.pages, document.forms[EditForm].page_nav, menuCats[currentCat].page_nav); duplicateForm(document.fromForm.functions, document.forms[EditForm].function_id, menuCats[currentCat].function_nav); } } else { delCookie('{COOKIE_NAME}_'+type+'xxx_id', ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}'); } for( var forCat in menuCats ) { if ( menuCats[forCat].status == 'block' ) { strSubmitContent += forCat + ','; } } // Remove trailing separator strSubmitContent = strSubmitContent.substr(0, strSubmitContent.length - 1); setCookie('{COOKIE_NAME}_admincp_menustates', strSubmitContent, expdate, ('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}', ('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}', ('{COOKIE_SECURE}' == '0') ? false : true); currentStep = 0; setTimeout("execQueue();", execInterval); } function deleteOption(object,index) { object.options[index] = null; } function addOption(object,text,value, selectedValue) { var defaultSelected = false; var selected = false; if (value == selectedValue) { selected = true; } var optionName = new Option(text, value, defaultSelected, selected) object.options[object.length] = optionName; } function copySelected(fromObject,toObject) { for (var i=0, l=fromObject.options.length;i<l;i++) { if (fromObject.options[i].selected) addOption(toObject,fromObject.options[i].text,fromObject.options[i].value); } for (var i=fromObject.options.length-1;i>-1;i--) { if (fromObject.options[i].selected) deleteOption(fromObject,i); } } function copyAll(fromObject,toObject) { for (var i=0, l=fromObject.options.length;i<l;i++) { addOption(toObject,fromObject.options[i].text,fromObject.options[i].value); } for (var i=fromObject.options.length-1;i>-1;i--) { deleteOption(fromObject,i); } } function duplicateForm(fromObject,toObject, selectedValue) { toObject.options.length = null; toObject.options.length = null; for (var i=0, l=fromObject.options.length;i<l;i++) { addOption(toObject,fromObject.options[i].text,fromObject.options[i].value, selectedValue); } } // --> </script> <div style="display:none;"> <form name="fromForm"> {S_GEN_BLOCK_LIST} {S_GEN_FUNCTION_LIST} {S_GEN_PAGE_LIST} </form> </div> <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <tr> <th class="thHead">{L_MENU_TITLE}</th> </tr> <!-- BEGIN catrow --> <tr> <td class="row1"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="forumline"> <tr> <td width="50%" class="catLeft" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.CAT_ID}','adminCat_');"> <img name="adminCat_image_{catrow.CAT_ID}" src="{catrow.IMG_URL}" border="0" align="absmiddle"> <span class="cattitle"><b>{catrow.CAT_TITLE}</b></span><br /><span class="gensmall"><b>{catrow.CAT_DESC}</b></span> </td> <td width="15%" class="cat" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.CAT_ID}','adminCatEdit_');"> <img name="adminCatEdit_image_{catrow.CAT_ID}" src="{catrow.IMG_URL_EDIT}" border="0" align="absmiddle"> <span class="gen">{L_EDIT}</span> </td> <td width="15%" class="cat" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.CAT_ID}','adminCatDelete_');"><img name="adminCatDelete_image_{catrow.CAT_ID}" src="{catrow.IMG_URL_DELETE}" border="0" align="absmiddle"> <span class="gen">{L_DELETE}</span> </td> <td width="20%" class="cat" align="center" valign="middle" nowrap="nowrap"> <span class="gen"><a href="{catrow.U_CAT_MOVE_UP}">{L_MOVE_UP}</a> <a href="{catrow.U_CAT_MOVE_DOWN}">{L_MOVE_DOWN}</a></span> </td> </tr> <tr> <td colspan="4" class="row1"> <div id="adminCat_{catrow.CAT_ID}" style="display:{catrow.VISIBLE};" class="genmed"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <tr> <td bgcolor="#006699" width="10"></td> <td> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <!-- Cat Delete --> <tr> <td colspan="5" class="row1"> <div id="adminCatDelete_{catrow.CAT_ID}" style="display:{catrow.VISIBLE_DELETE};" class="genmed"> <form action="{S_MENU_ACTION}" method="post"> <table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <tr> <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.CAT_ID}','adminCatDelete_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{catrow.L_TITLE_DELETE}</span></td> </tr> <tr> <td class="row1">{L_MENU_NAME}</td> <td class="row1"><span class="row1">{NAME}</span></td> </tr> <tr> <td class="row1">{L_MOVE_CONTENTS}</td> <td class="row1">{S_SELECT_TO}</td> </tr> <tr> <td class="catBottom" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{S_SUBMIT_VALUE}" class="mainoption" /></td> </tr> </table> </form> </div> </td> </tr> <!-- Cat Delete --> <!-- Cat Edit --> <tr> <td class="row1" colspan="5"> <div id="adminCatEdit_{catrow.CAT_ID}" style="display:{catrow.VISIBLE_EDIT};" class="genmed"> <form name="form_adminCatEdit_{catrow.CAT_ID}" action="{S_ACTION}" method="post"> <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> <tr> <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.CAT_ID}','adminCatEdit_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{catrow.L_TITLE_EDIT}</span></td> </tr> <tr> <td class="row1"><b>{catrow.L_CAT_TITLE}</b></td> <td class="row2" colspan="2"><input type="text" size="25" name="cat_title" value="{catrow.E_CAT_TITLE}" /></td> </tr> <tr> <td class="row1"><b>{catrow.L_CAT_DESC}</b></td> <td class="row2" colspan="2"><textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post">{catrow.E_CAT_DESC}</textarea></td> </tr> <tr> <td class="row1">{catrow.L_CAT_SHOW_CAT}</td> <td class="row2">{catrow.S_CAT_SHOW_CAT}</td> </tr> <!-- <tr> <td class="row1">{catrow.L_CAT_MENU_PAGE}</td> <td class="row2">{catrow.S_CAT_PAGE_LIST}</td> </tr> --> <tr> <td class="row1">{catrow.L_CAT_MENU_PAGE}</td> <td class="row2"><select name="cat_url_sel" ></select></td> </tr> <tr> <td class="row1">{L_CAT_LINK_TARGET}</td> <td class="row2">{catrow.S_CAT_LINK_TARGET_LIST}</td> </tr> <tr> <td class="row2" colspan="2" align="center">{catrow.S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{catrow.S_SUBMIT}" class="liteoption" /></td> </tr> </table> </form> </div> </td> </tr> <!-- Cat Edit --> <!-- BEGIN menurow --> <tr> <td class="row1" colspan="5"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <tr> <td class="row2" width="5"> </td> <td> <table width="100%" cellpadding="4" cellspacing="0" border="0" align="center"> <tr> <td width="50%" class="row2" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.menurow.MENU_ID}','adminMenuEdit_');"><img name="adminMenuEdit_image_{catrow.menurow.MENU_ID}" src="{catrow.menurow.IMG_URL_EDIT}" border="0" align="absmiddle"> <img src="{IMG_ICON_BLOCK}" border="0" align="absmiddle"> <span class="gen">{catrow.menurow.MENU_TITLE}</span><br /><span class="gensmall">{catrow.menurow.MENU_DESC}</span> </td> <td width="10%" class="row2" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.menurow.MENU_ID}','adminMenuEdit_');"> <span class="gen">{L_EDIT}</span> </td> <td width="10%" class="row2" align="center" valign="middle" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.menurow.MENU_ID}','adminMenuDelete_');" ><img name="adminMenuDelete_image_{catrow.menurow.MENU_ID}" src="{catrow.menurow.IMG_URL_DELETE}" border="0" align="absmiddle"> <span class="gen">{L_DELETE}</span> </td> <td width="20%" class="row2" align="center" valign="middle"> <span class="gen"><a href="{catrow.menurow.U_MENU_MOVE_UP}">{L_MOVE_UP}</a> <a href="{catrow.menurow.U_MENU_MOVE_DOWN}">{L_MOVE_DOWN}</a></span> </td> <td width="10%" class="row2" align="center" valign="middle"> <span class="gen"><a href="{catrow.menurow.U_MENU_RESYNC}">{L_RESYNC}</a></span> </td> </tr> <!-- Menu Delete --> <tr> <td colspan="5" class="row1"> <div id="adminMenuDelete_{catrow.menurow.MENU_ID}" style="display:{catrow.menurow.VISIBLE_DELETE};" class="genmed"> <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> <tr> <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.menurow.MENU_ID}','adminMenuDelete_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{catrow.menurow.L_TITLE_DELETE}</span></td> </tr> <tr> <td width="50%" align="center" colspan="2"> {catrow.menurow.MESSAGE_DELETE}asdasdasd </td> </tr> </table> </div> </td> </tr> <!-- Menu Delete --> <!-- Menu Edit --> <tr> <td class="row1" colspan="5"> <div id="adminMenuEdit_{catrow.menurow.MENU_ID}" style="display:{catrow.menurow.VISIBLE_EDIT};" class="genmed"> <form name="form_adminMenuEdit_{catrow.menurow.MENU_ID}" action="{S_ACTION}" method="post"> <table width="100%" cellpadding="1" cellspacing="2" border="0" align="center"> <tr> <td class="row2" colspan="2" align="center" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.menurow.MENU_ID}','adminMenuEdit_');"><img src="{IMG_URL_CONTRACT}" border="0" align="absmiddle"> <span class="topictitle">{catrow.menurow.L_TITLE_EDIT}</span></td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_TITLE}</td> <td class="row2"><input type="text" size="45" name="menuname" value="{catrow.menurow.E_MENU_TITLE}" class="post" /></td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_DESC}</td> <td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="message" class="post">{catrow.menurow.E_MENU_DESC}</textarea></td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_ICON}</td> <td class="row2">{catrow.menurow.S_POSTICONS}</td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_LINK_TARGET}</td> <td class="row2">{catrow.menurow.S_LINK_TARGET_LIST}</td> </tr> <tr> <td class="row1" colspan="2">{catrow.menurow.L_MENU_ACTION_TITLE}</td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_PAGE}</td> <td class="row2"><select name="page_nav" ></select></td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_LINKS}</td> <td class="row2"><input type="text" size="65" name="menulinks" value="{LINKS}" class="post" /></td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_BLOCK}</td> <td class="row2"><select name="block_nav" ></select></td> </tr> <tr> <td class="row1" colspan="2">{catrow.menurow.L_MENU_ACTION_ADV}</td> </tr> <tr> <td class="row1">{catrow.menurow.L_MENU_FUNCTION}</td> <td class="row2"><select name="function_id" ></select></td> </tr> <tr> <td class="row1" colspan="2">{catrow.menurow.L_MENU_PERMISSIONS_TITLE}</td> </tr> <tr> <td class="row1">{catrow.menurow.L_AUTH_TITLE}</td> <td class="row2"> <table cellspacing="1" cellpadding="4" border="0" class="portalline"> <tr> <!-- BEGIN module_auth_titles --> <th class="thTop">{catrow.menurow.module_auth_titles.CELL_TITLE}</th> <!-- END module_auth_titles --> </tr> <!-- BEGIN module_auth_data --> <tr> <td class="row1" align="center">{catrow.menurow.module_auth_data.S_AUTH_LEVELS_SELECT}</td> </tr> <tr> <th class="thTop">{catrow.menurow.module_auth_data.L_AUTH_GROUP_LEVELS_SELECT}</th> </tr> <tr> <td class="row1" align="center">{catrow.menurow.module_auth_data.S_AUTH_GROUP_LEVELS_SELECT}</td> </tr> <!-- END module_auth_data --> </table> </td> </tr> <tr> <td class="row2" colspan="2" align="center">{catrow.menurow.S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{catrow.menurow.S_SUBMIT}" class="liteoption" /></td> </tr> </table> </form> </div> </td> </tr> <!-- Menu Edit --> </table> </td> </tr> </table> </td> </tr> <!-- END menurow --> </table> </td> </tr> <tr> <td class="row2" colspan="2"><input type="text" name="{catrow.S_ADD_MENU_NAME}" /> <input type="submit" class="liteoption" name="{catrow.S_ADD_MENU_SUBMIT}" value="{L_CREATE_MENU}" /></td> </tr> </table> </div> </td> </tr> </table> </td> </tr> <!-- END catrow --> <tr> <td class="catBottom">{L_SHOW_CAT}<input type="text" name="categoryname" /> {S_SHOW_CAT} <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td> </tr> </table> |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:28
|
Update of /cvsroot/mxbb/core/modules/mx_textblocks/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_textblocks/admin Added Files: mx_module_defs.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: mx_module_defs.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_module_defs.php,v 1.1 2005/08/20 18:19:13 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ /********************************************************************************\ | Class: mx_blockcp_parameter | The mx_blockcp_parameter object provides extra module block parameters, added to the standard core parameters. | | Usage examples: | \********************************************************************************/ // // The following flags are class specific options // //define('MX_ALL_DATA' , -1); // Flag - write all data class mx_blockcp_parameter { // ------------------------------ // Private Methods // // // =================================================== // define module specific block parameters // =================================================== function get_parameters($type_row = '') { global $lang; if (empty($type_row)) { $type_row = array(); } $type_row['phpBBTextBlock'] = !empty($lang['ParType_phpBBTextBlock']) ? $lang['ParType_phpBBTextBlock'] : "phpBB TextBlock"; $type_row['CustomizedTextBlock'] = !empty($lang['ParType_CustomizedTextBlock']) ? $lang['ParType_CustomizedTextBlock'] : "Customized TextBlock"; $type_row['WysiwygTextBlock'] = !empty($lang['ParType_WysiwygTextBlock']) ? $lang['ParType_WysiwygTextBlock'] : "Wysiwyg TextBlock"; return $type_row; } // =================================================== // Submit custom parameter field and data // =================================================== function submit_custom_pars( $parameter_data, $block_id ) { global $HTTP_POST_VARS, $db, $board_config, $html_entities_match, $html_entities_replace; $parameter_value = $HTTP_POST_VARS[$parameter_data['parameter_name']]; $parameter_opt = ''; switch ( $parameter_data['parameter_type'] ) { case 'phpBBTextBlock': $bbcode_on = $board_config['allow_bbcode'] ? true : false; $html_on = $board_config['allow_html'] ? true : false; $smilies_on = $board_config['allow_smilies'] ? true : false; if( $bbcode_on ) { $bbcode_uid = make_bbcode_uid(); } break; case 'CustomizedTextBlock': $bbcode_on = $parameter_opt['allow_bbcode'] ? true : false; $html_on = $parameter_opt['allow_html'] ? true : false; $smilies_on = $parameter_opt['allow_smilies'] ? true : false; $board_config['allow_html_tags'] = $parameter_opt['allow_html_tags']; if( $bbcode_on ) { $bbcode_uid = make_bbcode_uid(); } break; case 'WysiwygTextBlock': $bbcode_on = false; $html_on = true; $smilies_on = false; $html_entities_match = array(); $html_entities_replace = array(); $bbcode_uid = 0; break; } $parameter_value = prepare_message(trim($parameter_value), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); $parameter_opt = $bbcode_uid; return array('parameter_value' => $parameter_value, 'parameter_opt' => $parameter_opt); } // =================================================== // Display cuztom parameter field and data in the Block Control Panel // =================================================== function display_custom_edit( $parameter_data, $block_id ) { global $template, $mx_blockcp, $mx_root_path, $theme, $lang; switch ( $parameter_data['parameter_type'] ) { case 'phpBBTextBlock': $this->display_edit_phpBBTextBlock( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; case 'CustomizedTextBlock': $this->display_edit_CustomizedTextBlock( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; case 'WysiwygTextBlock': $this->display_edit_WysiwygTextBlock( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; } } function display_edit_phpBBTextBlock( $block_id, $parameter_id, $parameter_data ) { global $template, $board_config, $db, $theme, $lang, $images, $mx_blockcp, $mx_root_path, $HTTP_POST_VARS; $parameter_value = isset($HTTP_POST_VARS['preview']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[$parameter_data['parameter_name']]))) : $parameter_data['parameter_value']; $bbcode_on = $board_config['allow_bbcode'] ? true : false; $html_on = $board_config['allow_html'] ? true : false; $smilies_on = $board_config['allow_smilies'] ? true : false; $bbcode_uid = $parameter_data['parameter_opt']; if ( isset($HTTP_POST_VARS['preview']) ) { $this->preview($parameter_value, $html_on, $bbcode_on, $smilies_on); $template->assign_block_vars('preview', array()); } else { $parameter_value = $this->decode($parameter_value, $bbcode_uid); } // // HTML, BBCode & Smilies toggle selection // $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; $template->set_filenames(array( 'parameter' => $mx_root_path . $mx_blockcp->module_root_path . 'templates/'. $theme['template_name'] . '/admin/mx_blockcp_parameter.tpl') ); if( $bbcode_on) { $template->assign_block_vars('switch_bbcodes', array()); } if( $smilies_on) { mx_generate_smilies('inline', PAGE_INDEX); $template->assign_block_vars('switch_smilies', array()); } $template->assign_vars(array( // BBcodes 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], 'L_EMPTY_MESSAGE' => $lang['Empty_message'], 'L_FONT_COLOR' => $lang['Font_color'], 'L_COLOR_DEFAULT' => $lang['color_default'], 'L_COLOR_DARK_RED' => $lang['color_dark_red'], 'L_COLOR_RED' => $lang['color_red'], 'L_COLOR_ORANGE' => $lang['color_orange'], 'L_COLOR_BROWN' => $lang['color_brown'], 'L_COLOR_YELLOW' => $lang['color_yellow'], 'L_COLOR_GREEN' => $lang['color_green'], 'L_COLOR_OLIVE' => $lang['color_olive'], 'L_COLOR_CYAN' => $lang['color_cyan'], 'L_COLOR_BLUE' => $lang['color_blue'], 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], 'L_COLOR_INDIGO' => $lang['color_indigo'], 'L_COLOR_VIOLET' => $lang['color_violet'], 'L_COLOR_WHITE' => $lang['color_white'], 'L_COLOR_BLACK' => $lang['color_black'], 'L_FONT_SIZE' => $lang['Font_size'], 'L_FONT_TINY' => $lang['font_tiny'], 'L_FONT_SMALL' => $lang['font_small'], 'L_FONT_NORMAL' => $lang['font_normal'], 'L_FONT_LARGE' => $lang['font_large'], 'L_FONT_HUGE' => $lang['font_huge'], 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'], 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => $bbcode_status, 'SMILIES_STATUS' => $smilies_status, 'L_PREVIEW' => $lang['Preview'], // To sync script and textarea select field 'SELECT_NAME' => $parameter_data['parameter_name'], )); $template->assign_block_vars('textblock', array( 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', 'TEXT' => $parameter_value )); $template->pparse('parameter'); } function display_edit_CustomizedTextBlock( $block_id, $parameter_id, $parameter_data ) { global $template, $board_config, $db, $theme, $lang, $images, $mx_blockcp, $mx_root_path, $HTTP_POST_VARS; $parameter_value = isset($HTTP_POST_VARS['preview']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[$parameter_data['parameter_name']]))) : $parameter_data['parameter_value']; // Extract customized textblock settings $bbcode_on = true? true : false; $html_on = true? true : false; $smilies_on = true? true : false; $board_config['allow_html_tags'] = ''; $bbcode_uid = $parameter_data['parameter_opt']; if ( isset($HTTP_POST_VARS['preview']) ) { $this->preview($parameter_value, $html_on, $bbcode_on, $smilies_on); $template->assign_block_vars('preview', array()); } else { $parameter_value = $this->decode($parameter_value, $bbcode_uid); } // // HTML, BBCode & Smilies toggle selection // $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; $template->set_filenames(array( 'parameter' => $mx_root_path . $mx_blockcp->module_root_path . 'templates/'. $theme['template_name'] . '/admin/mx_blockcp_parameter.tpl') ); if( $bbcode_on) { $template->assign_block_vars('switch_bbcodes', array()); } if( $smilies_on) { mx_generate_smilies('inline', PAGE_INDEX); $template->assign_block_vars('switch_smilies', array()); } $template->assign_vars(array( // BBcodes 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], 'L_EMPTY_MESSAGE' => $lang['Empty_message'], 'L_FONT_COLOR' => $lang['Font_color'], 'L_COLOR_DEFAULT' => $lang['color_default'], 'L_COLOR_DARK_RED' => $lang['color_dark_red'], 'L_COLOR_RED' => $lang['color_red'], 'L_COLOR_ORANGE' => $lang['color_orange'], 'L_COLOR_BROWN' => $lang['color_brown'], 'L_COLOR_YELLOW' => $lang['color_yellow'], 'L_COLOR_GREEN' => $lang['color_green'], 'L_COLOR_OLIVE' => $lang['color_olive'], 'L_COLOR_CYAN' => $lang['color_cyan'], 'L_COLOR_BLUE' => $lang['color_blue'], 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], 'L_COLOR_INDIGO' => $lang['color_indigo'], 'L_COLOR_VIOLET' => $lang['color_violet'], 'L_COLOR_WHITE' => $lang['color_white'], 'L_COLOR_BLACK' => $lang['color_black'], 'L_FONT_SIZE' => $lang['Font_size'], 'L_FONT_TINY' => $lang['font_tiny'], 'L_FONT_SMALL' => $lang['font_small'], 'L_FONT_NORMAL' => $lang['font_normal'], 'L_FONT_LARGE' => $lang['font_large'], 'L_FONT_HUGE' => $lang['font_huge'], 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'], 'L_PREVIEW' => $lang['Preview'], 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => $bbcode_status, 'SMILIES_STATUS' => $smilies_status, // To sync script and textarea select field 'SELECT_NAME' => $parameter_data['parameter_name'], )); $template->assign_block_vars('textblock', array( 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', 'TEXT' => $parameter_value )); $template->pparse('parameter'); } function display_edit_WysiwygTextBlock( $block_id, $parameter_id, $parameter_data ) { global $template, $board_config, $db, $theme, $mx_root_path, $lang, $mx_blockcp, $mx_root_path, $HTTP_POST_VARS; $parameter_value = $parameter_data['parameter_value']; // // HTML, BBCode & Smilies toggle selection // $html_status = ( true ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $bbcode_status = ( false ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; $smilies_status = ( false ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; $template->set_filenames(array( 'parameter' => $mx_root_path . $mx_blockcp->module_root_path . 'templates/'. $theme['template_name'] . '/admin/mx_blockcp_parameter.tpl') ); // // This switch is for enabling the wysiwyg html editor addon "tiny mce". to disable this feature // either remove this section or delete the modules/tinymce folder // if ( file_exists( $mx_root_path . 'modules/tinymce/jscripts/tiny_mce/blank.htm' ) ) { $template->assign_block_vars( "tinyMCE", array( 'PATH' => $mx_root_path )); } $parameter_field = '<textarea rows="30" cols="150" wrap="virtual" name="' . $parameter_id . '" class="post">' . $parameter_value . '</textarea>'; $template->assign_vars(array( 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => $bbcode_status, 'SMILIES_STATUS' => $smilies_status, 'L_PREVIEW' => $lang['Preview'], // To sync script and textarea select field 'SELECT_NAME' => $parameter_data['parameter_name'], )); $template->assign_block_vars('textblock', array( 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', 'TEXT' => $parameter_data['parameter_value'] )); $template->pparse('parameter'); } function decode($text = '', $bbcode_uid = '') { if( $bbcode_uid != '' ) { $text = preg_replace('/\:(([a-z0-9]:)?)' . $bbcode_uid . '/s', '', $text); } $text = str_replace('<', '<', $text); $text = str_replace('>', '>', $text); $text = str_replace('<br />', "\n", $text); return $text; } // =================================================== // Preview Textblock // =================================================== function preview($text, $html_on, $bbcode_on, $smilies_on) { global $board_config, $template, $lang; $preview_text = $text; $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; $preview_text = stripslashes(prepare_message(addslashes(unprepare_message($preview_text)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); if( $bbcode_on ) { $preview_text = bbencode_second_pass($preview_text, $bbcode_uid); } if( count($orig_word) ) { $preview_text = preg_replace($orig_word, $replacement_word, $preview_text); } if( $smilies_on ) { $preview_text = mx_smilies_pass($preview_text); } $preview_text = make_clickable($preview_text); $preview_text = str_replace("\n", '<br />', $preview_text); $template->assign_vars(array( 'TEXT' => $preview_text )); return $preview_text; } } ?> |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:26
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_navmenu/admin Added Files: mx_module_defs.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: mx_module_defs.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_module_defs.php,v 1.1 2005/08/20 18:19:12 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1179 lines suppressed...] } $i = 10; $inc = 10; while( $row = $db->sql_fetchrow($result) ) { $sql = "UPDATE $table SET $orderfield = $i WHERE $idfield = " . $row[$idfield]; if( !($db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); } $i += 10; } } } ?> |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:26
|
Update of /cvsroot/mxbb/core/modules/mx_textblocks/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_textblocks/templates/subSilver/admin Added Files: mx_module_parameters.tpl Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: mx_module_parameters.tpl --- <!-- BEGIN switch_bbcodes --> <script language="JavaScript" type="text/javascript"> <!-- // bbCode control by // subBlue design // www.subBlue.com // Startup variables var imageTag = false; var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); var is_moz = 0; var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); var is_mac = (clientPC.indexOf("mac")!=-1); // Helpline messages b_help = "{L_BBCODE_B_HELP}"; i_help = "{L_BBCODE_I_HELP}"; u_help = "{L_BBCODE_U_HELP}"; q_help = "{L_BBCODE_Q_HELP}"; c_help = "{L_BBCODE_C_HELP}"; l_help = "{L_BBCODE_L_HELP}"; o_help = "{L_BBCODE_O_HELP}"; p_help = "{L_BBCODE_P_HELP}"; w_help = "{L_BBCODE_W_HELP}"; a_help = "{L_BBCODE_A_HELP}"; s_help = "{L_BBCODE_S_HELP}"; f_help = "{L_BBCODE_F_HELP}"; // Define the bbCode tags bbcode = new Array(); bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); imageTag = false; // Shows the help messages in the helpline window function helpline(help) { document.post.helpbox.value = eval(help + "_help"); } // Replacement for arrayname.length property function getarraysize(thearray) { for (i = 0; i < thearray.length; i++) { if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) return i; } return thearray.length; } // Replacement for arrayname.push(value) not implemented in IE until version 5.5 // Appends element to the array function arraypush(thearray,value) { thearray[ getarraysize(thearray) ] = value; } // Replacement for arrayname.pop() not implemented in IE until version 5.5 // Removes and returns the last element of an array function arraypop(thearray) { thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; delete thearray[thearraysize - 1]; return retval; } function checkForm() { formErrors = false; if (document.post.{SELECT_NAME}.value.length < 2) { formErrors = "{L_EMPTY_MESSAGE}"; } if (formErrors) { alert(formErrors); return false; } else { bbstyle(-1); //formObj.preview.disabled = true; //formObj.submit.disabled = true; return true; } } function emoticon(text) { var txtarea = document.post.{SELECT_NAME}; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function bbfontstyle(bbopen, bbclose) { var txtarea = document.post.{SELECT_NAME}; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (!theSelection) { txtarea.value += bbopen + bbclose; txtarea.focus(); return; } document.selection.createRange().text = bbopen + theSelection + bbclose; txtarea.focus(); return; } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbopen, bbclose); return; } else { txtarea.value += bbopen + bbclose; txtarea.focus(); } storeCaret(txtarea); } function bbstyle(bbnumber) { var txtarea = document.post.{SELECT_NAME}; txtarea.focus(); donotinsert = false; theSelection = false; bblast = 0; if (bbnumber == -1) { // Close all open tags & default button names while (bbcode[0]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } imageTag = false; // All tags are closed including image tags :D txtarea.focus(); return; } if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; // Get text selection if (theSelection) { // Add tags around selection document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; txtarea.focus(); theSelection = ''; return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]); return; } // Find last occurance of an open tag the same as the one just clicked for (i = 0; i < bbcode.length; i++) { if (bbcode[i] == bbnumber+1) { bblast = i; donotinsert = true; } } if (donotinsert) { // Close all open tags up to the one just clicked & default button names while (bbcode[bblast]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); imageTag = false; } txtarea.focus(); return; } else { // Open tags if (imageTag && (bbnumber != 14)) { // Close image tag before adding another txtarea.value += bbtags[15]; lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list document.post.addbbcode14.value = "Img"; // Return button back to normal state imageTag = false; } // Open tag txtarea.value += bbtags[bbnumber]; if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag arraypush(bbcode,bbnumber+1); eval('document.post.addbbcode'+bbnumber+'.value += "*"'); txtarea.focus(); return; } storeCaret(txtarea); } // From http://www.massless.org/mozedit/ function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; if (selEnd == 1 || selEnd == 2) selEnd = selLength; var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; return; } // Insert at Claret position. Code from // http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } //--> </script> <!-- END switch_bbcodes --> <!-- BEGIN tinyMCE --> <script language="javascript" type="text/javascript" src="{tinyMCE.PATH}modules/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", theme_advanced_toolbar_location : "top", plugins : "table", theme_advanced_buttons3_add_before : "tablecontrols, separator" }); </script> <!-- END tinyMCE --> <!-- Module Block Parameter --> <!-- BEGIN preview --> <tr> <td class="row1" valign="top" width="25%" align="center" colspan="2"> <table width="70%" border="0" cellspacing="0" cellpadding="1" class="forumline"> <tr> <th class="cat" align="center" > {L_PREVIEW} </th> </tr> <tr> <td align="left" ><span class="genmed">{TEXT}</span></td> </tr> </table> </td> </tr> <!-- END tinyMCE --> <tr> <td class="row1" valign="top" width="25%"> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td><span class="gen"><b>{L_BLOCK_INFO}</b></span> </td> </tr> <tr> <td valign="middle" align="center"> <br /> <table width="100" border="0" cellspacing="0" cellpadding="5"> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"> <!-- BEGIN switch_smilies --> <b>{L_EMOTICONS}</b> <!-- END switch_smilies --> </td> </tr> <!-- BEGIN smilies_row --> <tr align="center" valign="middle"> <!-- BEGIN smilies_col --> <td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td> <!-- END smilies_col --> </tr> <!-- END smilies_row --> <!-- BEGIN switch_smilies_extra --> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td> </tr> <!-- END switch_smilies_extra --> </table> </td> </tr> <tr> <td class="row1" valign="top" align="center"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td> </tr> <tr> <td class="row1" valign="top" align="center"><span class="gen"><input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" /></span></td> </tr> </table> </td> <td class="row2" valign="top"><span class="gen"> <table width="450" border="0" cellspacing="0" cellpadding="2"> <!-- BEGIN switch_bbcodes --> <tr align="center" valign="middle"> <td><span class="genmed"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> </tr> <tr> <td colspan="9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><span class="genmed"> {L_FONT_COLOR}: <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option> <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option> <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option> <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option> <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option> <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option> <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option> <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option> <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option> <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option> <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option> <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option> <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option> <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> <option value="7" class="genmed">{L_FONT_TINY}</option> <option value="9" class="genmed">{L_FONT_SMALL}</option> <option value="12" selected class="genmed">{L_FONT_NORMAL}</option> <option value="18" class="genmed">{L_FONT_LARGE}</option> <option value="24" class="genmed">{L_FONT_HUGE}</option> </select> </span> </td> <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> </tr> </table> </td> </tr> <tr> <td colspan="9"> <span class="gensmall"> <input type="text" name="helpbox" size="45" maxlength="100" style="width:550px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> </span> </td> </tr> <!-- END switch_bbcodes --> <!-- BEGIN textblock --> <tr> <td colspan="9" align="left"> <span class="cattitle"> {textblock.PARAMETER_TITLE}<hr> </span> <span class="genmed"> {textblock.PARAMETER_TYPE} </span> <span class="gensmall"> {textblock.PARAMETER_TYPE_EXPLAIN} </span> </td> </tr> <tr> <td colspan="9" align="left"> <span class="gen"> <textarea name="{SELECT_NAME}" rows="40" cols="35" wrap="virtual" style="width:550px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{textblock.TEXT}</textarea> </span> </td> </tr> <!-- END textblock --> </table> </td> </tr> |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:25
|
Update of /cvsroot/mxbb/core/modules/mx_ajax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_ajax Added Files: DynamicOptionList.js dynamic.js mxajax.js prototype.js rico.js Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- NEW FILE: prototype.js --- /* Prototype: an object-oriented Javascript library, version 1.2.1 * (c) 2005 Sam Stephenson <sa...@co...> * * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff * against the source tree, available from the Prototype darcs repository. * * Prototype is freely distributable under the terms of an MIT-style license. * * For details, see the Prototype web site: http://prototype.conio.net/ * /*--------------------------------------------------------------------------*/ var Prototype = { Version: '1.2.1' } var Class = { create: function() { return function() { this.initialize.apply(this, arguments); } } } var Abstract = new Object(); Object.prototype.extend = function(object) { for (property in object) { this[property] = object[property]; } return this; } Function.prototype.bind = function(object) { var method = this; return function() { method.apply(object, arguments); } } Function.prototype.bindAsEventListener = function(object) { var method = this; return function(event) { method.call(object, event || window.event); } } Number.prototype.toColorPart = function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; } var Try = { these: function() { var returnValue; for (var i = 0; i < arguments.length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) {} } return returnValue; } } /*--------------------------------------------------------------------------*/ var PeriodicalExecuter = Class.create(); PeriodicalExecuter.prototype = { initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000); }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.callback(); } finally { this.currentlyExecuting = false; } } this.registerCallback(); } } /*--------------------------------------------------------------------------*/ function $() { var elements = new Array(); for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } /*--------------------------------------------------------------------------*/ if (!Array.prototype.push) { Array.prototype.push = function() { var startLength = this.length; for (var i = 0; i < arguments.length; i++) this[startLength + i] = arguments[i]; return this.length; } } if (!Function.prototype.apply) { // Based on code from http://www.youngpup.net/ Function.prototype.apply = function(object, parameters) { var parameterStrings = new Array(); if (!object) object = window; if (!parameters) parameters = new Array(); for (var i = 0; i < parameters.length; i++) parameterStrings[i] = 'x[' + i + ']'; object.__apply__ = this; var result = eval('obj.__apply__(' + parameterStrings[i].join(', ') + ')'); object.__apply__ = null; return result; } } /*--------------------------------------------------------------------------*/ var Ajax = { getTransport: function() { return Try.these( function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')}, function() {return new XMLHttpRequest()} ) || false; }, emptyFunction: function() {} } Ajax.Base = function() {}; Ajax.Base.prototype = { setOptions: function(options) { this.options = { method: 'post', asynchronous: true, parameters: '' }.extend(options || {}); } } Ajax.Request = Class.create(); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Request.prototype = (new Ajax.Base()).extend({ initialize: function(url, options) { this.transport = Ajax.getTransport(); this.setOptions(options); try { if (this.options.method == 'get') url += '?' + this.options.parameters + '&_='; this.transport.open(this.options.method, url, this.options.asynchronous); if (this.options.asynchronous) { this.transport.onreadystatechange = this.onStateChange.bind(this); setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); } this.transport.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); this.transport.setRequestHeader('X-Prototype-Version', Prototype.Version); if (this.options.method == 'post') { this.transport.setRequestHeader('Connection', 'close'); this.transport.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); } if (this.options.requestHeaders) { for (var i=0; i< (this.options.requestHeaders.length-1);i+=2) this.transport.setRequestHeader(this.options.requestHeaders[i], this.options.requestHeaders[i+1]); } var sendData = this.options.postBody ? this.options.postBody : this.options.parameters ? this.options.parameters + '&_' : null; this.transport.send(this.options.method == 'post' ? sendData : null ); } catch (e) { } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState != 1) this.respondToReadyState(this.transport.readyState); }, respondToReadyState: function(readyState) { var event = Ajax.Request.Events[readyState]; (this.options['on' + event] || Ajax.emptyFunction)(this.transport); } }); Ajax.Updater = Class.create(); Ajax.Updater.prototype = (new Ajax.Base()).extend({ initialize: function(container, url, options) { this.container = $(container); this.setOptions(options); if (this.options.asynchronous) { this.onComplete = this.options.onComplete; this.options.onComplete = this.updateContent.bind(this); } this.request = new Ajax.Request(url, this.options); if (!this.options.asynchronous) this.updateContent(); }, updateContent: function() { if (this.request.transport.status == 200) { if (this.options.insertion) { new this.options.insertion(this.container, this.request.transport.responseText); } else { this.container.innerHTML = this.request.transport.responseText; } } if (this.onComplete) { setTimeout((function() {this.onComplete( this.request.transport)}).bind(this), 10); } } }); /*--------------------------------------------------------------------------*/ var Field = { clear: function() { for (var i = 0; i < arguments.length; i++) $(arguments[i]).value = ''; }, focus: function(element) { $(element).focus(); }, present: function() { for (var i = 0; i < arguments.length; i++) if ($(arguments[i]).value == '') return false; return true; }, select: function(element) { $(element).select(); }, activate: function(element) { $(element).focus(); $(element).select(); } } /*--------------------------------------------------------------------------*/ var Form = { serialize: function(form) { var elements = Form.getElements($(form)); var queryComponents = new Array(); for (var i = 0; i < elements.length; i++) { var queryComponent = Form.Element.serialize(elements[i]); if (queryComponent) queryComponents.push(queryComponent); } return queryComponents.join('&'); }, getElements: function(form) { form = $(form); var elements = new Array(); for (tagName in Form.Element.Serializers) { var tagElements = form.getElementsByTagName(tagName); for (var j = 0; j < tagElements.length; j++) elements.push(tagElements[j]); } return elements; }, disable: function(form) { var elements = Form.getElements(form); for (var i = 0; i < elements.length; i++) { var element = elements[i]; element.blur(); element.disable = 'true'; } }, focusFirstElement: function(form) { form = $(form); var elements = Form.getElements(form); for (var i = 0; i < elements.length; i++) { var element = elements[i]; if (element.type != 'hidden' && !element.disabled) { Field.activate(element); break; } } }, reset: function(form) { $(form).reset(); } } Form.Element = { serialize: function(element) { element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) return encodeURIComponent(parameter[0]) + '=' + encodeURIComponent(parameter[1]); }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) return parameter[1]; } } Form.Element.Serializers = { input: function(element) { switch (element.type.toLowerCase()) { case 'hidden': case 'password': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } return false; }, inputSelector: function(element) { if (element.checked) return [element.name, element.value]; }, textarea: function(element) { return [element.name, element.value]; }, select: function(element) { var index = element.selectedIndex; var value = element.options[index].value || element.options[index].text; return [element.name, (index >= 0) ? value : '']; } } /*--------------------------------------------------------------------------*/ var $F = Form.Element.getValue; /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = function() {} Abstract.TimedObserver.prototype = { initialize: function(element, frequency, callback) { this.frequency = frequency; this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); this.registerCallback(); }, registerCallback: function() { setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000); }, onTimerEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } this.registerCallback(); } } Form.Element.Observer = Class.create(); Form.Element.Observer.prototype = (new Abstract.TimedObserver()).extend({ getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(); Form.Observer.prototype = (new Abstract.TimedObserver()).extend({ getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ document.getElementsByClassName = function(className) { var children = document.getElementsByTagName('*') || document.all; var elements = new Array(); for (var i = 0; i < children.length; i++) { var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) { if (classNames[j] == className) { elements.push(child); break; } } } return elements; } /*--------------------------------------------------------------------------*/ var Element = { toggle: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = (element.style.display == 'none' ? '' : 'none'); } }, hide: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = 'none'; } }, show: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = ''; } }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); }, getHeight: function(element) { element = $(element); return element.offsetHeight; } } var Toggle = new Object(); Toggle.display = Element.toggle; /*--------------------------------------------------------------------------*/ Abstract.Insertion = function(adjacency) { this.adjacency = adjacency; } Abstract.Insertion.prototype = { initialize: function(element, content) { this.element = $(element); this.content = content; if (this.adjacency && this.element.insertAdjacentHTML) { this.element.insertAdjacentHTML(this.adjacency, this.content); } else { this.range = this.element.ownerDocument.createRange(); if (this.initializeRange) this.initializeRange(); this.fragment = this.range.createContextualFragment(this.content); this.insertContent(); } } } var Insertion = new Object(); Insertion.Before = Class.create(); Insertion.Before.prototype = (new Abstract.Insertion('beforeBegin')).extend({ initializeRange: function() { this.range.setStartBefore(this.element); }, insertContent: function() { this.element.parentNode.insertBefore(this.fragment, this.element); } }); Insertion.Top = Class.create(); Insertion.Top.prototype = (new Abstract.Insertion('afterBegin')).extend({ initializeRange: function() { this.range.selectNodeContents(this.element); this.range.collapse(true); }, insertContent: function() { this.element.insertBefore(this.fragment, this.element.firstChild); } }); Insertion.Bottom = Class.create(); Insertion.Bottom.prototype = (new Abstract.Insertion('beforeEnd')).extend({ initializeRange: function() { this.range.selectNodeContents(this.element); this.range.collapse(this.element); }, insertContent: function() { this.element.appendChild(this.fragment); } }); Insertion.After = Class.create(); Insertion.After.prototype = (new Abstract.Insertion('afterEnd')).extend({ initializeRange: function() { this.range.setStartAfter(this.element); }, insertContent: function() { this.element.parentNode.insertBefore(this.fragment, this.element.nextSibling); } }); /*--------------------------------------------------------------------------*/ var Effect = new Object(); Effect.Highlight = Class.create(); Effect.Highlight.prototype = { initialize: function(element) { this.element = $(element); this.start = 153; this.finish = 255; this.current = this.start; this.fade(); }, fade: function() { if (this.isFinished()) return; if (this.timer) clearTimeout(this.timer); this.highlight(this.element, this.current); this.current += 17; this.timer = setTimeout(this.fade.bind(this), 250); }, isFinished: function() { return this.current > this.finish; }, highlight: function(element, current) { element.style.backgroundColor = "#ffff" + current.toColorPart(); } } Effect.Fade = Class.create(); Effect.Fade.prototype = { initialize: function(element) { this.element = $(element); this.start = 100; this.finish = 0; this.current = this.start; this.fade(); }, fade: function() { if (this.isFinished()) { this.element.style.display = 'none'; return; } if (this.timer) clearTimeout(this.timer); this.setOpacity(this.element, this.current); this.current -= 10; this.timer = setTimeout(this.fade.bind(this), 50); }, isFinished: function() { return this.current <= this.finish; }, setOpacity: function(element, opacity) { opacity = (opacity == 100) ? 99.999 : opacity; element.style.filter = "alpha(opacity:"+opacity+")"; element.style.opacity = opacity/100 /*//*/; } } Effect.Scale = Class.create(); Effect.Scale.prototype = { initialize: function(element, percent) { this.element = $(element); this.startScale = 1.0; this.startHeight = this.element.offsetHeight; this.startWidth = this.element.offsetWidth; this.currentHeight = this.startHeight; this.currentWidth = this.startWidth; this.finishScale = (percent/100) /*//*/; if (this.element.style.fontSize=="") this.sizeEm = 1.0; if (this.element.style.fontSize.indexOf("em")>0) this.sizeEm = parseFloat(this.element.style.fontSize); if(this.element.effect_scale) { clearTimeout(this.element.effect_scale.timer); this.startScale = this.element.effect_scale.currentScale; this.startHeight = this.element.effect_scale.startHeight; this.startWidth = this.element.effect_scale.startWidth; if(this.element.effect_scale.sizeEm) this.sizeEm = this.element.effect_scale.sizeEm; } this.element.effect_scale = this; this.currentScale = this.startScale; this.factor = this.finishScale - this.startScale; this.options = arguments[2] || {}; this.scale(); }, scale: function() { if (this.isFinished()) { this.setDimensions(this.element, this.startWidth*this.finishScale, this.startHeight*this.finishScale); if(this.sizeEm) this.element.style.fontSize = this.sizeEm*this.finishScale + "em"; if(this.options.complete) this.options.complete(this); return; } if (this.timer) clearTimeout(this.timer); if (this.options.step) this.options.step(this); this.setDimensions(this.element, this.currentWidth, this.currentHeight); if(this.sizeEm) this.element.style.fontSize = this.sizeEm*this.currentScale + "em"; this.currentScale += (this.factor/10) /*//*/; this.currentWidth = this.startWidth * this.currentScale; this.currentHeight = this.startHeight * this.currentScale; this.timer = setTimeout(this.scale.bind(this), 50); }, isFinished: function() { return (this.factor < 0) ? this.currentScale <= this.finishScale : this.currentScale >= this.finishScale; }, setDimensions: function(element, width, height) { element.style.width = width + 'px'; element.style.height = height + 'px'; } } Effect.Squish = Class.create(); Effect.Squish.prototype = { initialize: function(element) { this.element = $(element); new Effect.Scale(this.element, 1, { complete: this.hide.bind(this) } ); }, hide: function() { this.element.style.display = 'none'; } } Effect.Puff = Class.create(); Effect.Puff.prototype = { initialize: function(element) { this.element = $(element); this.opacity = 100; this.startTop = this.element.top || this.element.offsetTop; this.startLeft = this.element.left || this.element.offsetLeft; new Effect.Scale(this.element, 200, { step: this.fade.bind(this), complete: this.hide.bind(this) } ); }, fade: function(effect) { topd = (((effect.currentScale)*effect.startHeight) - effect.startHeight)/2; leftd = (((effect.currentScale)*effect.startWidth) - effect.startWidth)/2; this.element.style.position='absolute'; this.element.style.top = this.startTop-topd + "px"; this.element.style.left = this.startLeft-leftd + "px"; this.opacity -= 10; this.setOpacity(this.element, this.opacity); if(navigator.appVersion.indexOf('AppleWebKit')>0) this.element.innerHTML += ''; //force redraw on safari }, hide: function() { this.element.style.display = 'none'; }, setOpacity: function(element, opacity) { opacity = (opacity == 100) ? 99.999 : opacity; element.style.filter = "alpha(opacity:"+opacity+")"; element.style.opacity = opacity/100 /*//*/; } } Effect.Appear = Class.create(); Effect.Appear.prototype = { initialize: function(element) { this.element = $(element); this.start = 0; this.finish = 100; this.current = this.start; this.fade(); }, fade: function() { if (this.isFinished()) return; if (this.timer) clearTimeout(this.timer); this.setOpacity(this.element, this.current); this.current += 10; this.timer = setTimeout(this.fade.bind(this), 50); }, isFinished: function() { return this.current > this.finish; }, setOpacity: function(element, opacity) { opacity = (opacity == 100) ? 99.999 : opacity; element.style.filter = "alpha(opacity:"+opacity+")"; element.style.opacity = opacity/100 /*//*/; element.style.display = ''; } } Effect.ContentZoom = Class.create(); Effect.ContentZoom.prototype = { initialize: function(element, percent) { this.element = $(element); if (this.element.style.fontSize=="") this.sizeEm = 1.0; if (this.element.style.fontSize.indexOf("em")>0) this.sizeEm = parseFloat(this.element.style.fontSize); if(this.element.effect_contentzoom) { this.sizeEm = this.element.effect_contentzoom.sizeEm; } this.element.effect_contentzoom = this; this.element.style.fontSize = this.sizeEm*(percent/100) + "em" /*//*/; if(navigator.appVersion.indexOf('AppleWebKit')>0) { this.element.scrollTop -= 1; }; } } --- NEW FILE: DynamicOptionList.js --- // =================================================================== // Author: Matt Kruse <ma...@ma...> // WWW: http://www.mattkruse.com/ // // NOTICE: You may use this code for any purpose, commercial or // private, without any further permission from the author. You may // remove this notice from your final code if you wish, however it is // appreciated by the author if at least my web site address is kept. // // You may *NOT* re-distribute this code in any way except through its // use. That means, you can include it in your product, or your web // site, or any other form where the code is actually being used. You // may not put the plain javascript up on your site for download or // include it in your javascript libraries for download. // If you wish to share this code with others, please just point them // to the URL instead. // Please DO NOT link directly to my .js files from your site. Copy // the files to your server and use them there. Thank you. // =================================================================== var dynamicOptionListCount=0;var dynamicOptionListObjects = new Array(); function initDynamicOptionLists(){for(var i=0;i<dynamicOptionListObjects.length;i++){var dol = dynamicOptionListObjects[i];if(dol.formName!=null){dol.form = document.forms[dol.formName];}else if(dol.formIndex!=null){dol.form = document.forms[dol.formIndex];}else{var name = dol.fieldNames[0][0];for(var f=0;f<document.forms.length;f++){if(typeof(document.forms[f][name])!="undefined"){dol.form = document.forms[f];break;}}if(dol.form==null){alert("ERROR: Couldn't find form element "+name+" in any form on the page! Init aborted");return;}}for(var j=0;j<dol.fieldNames.length;j++){for(var k=0;k<dol.fieldNames[j].length-1;k++){var selObj = dol.form[dol.fieldNames[j][k]];if(typeof(selObj)=="undefined"){alert("Select box named "+dol.fieldNames[j][k]+" could not be found in the form. Init aborted");return;}if(k==0){if(selObj.options!=null){for(l=0;l<selObj.options.length;l++){var sopt = selObj.options[l];var m = dol.findMatchingOptionInArray(dol.options,sopt.text,sopt.value,false);if(m!=null){var reselectForNN6 = sopt.selected;var m2 = new Option(sopt.text, sopt.value, sopt.defaultSelected, sopt.selected);m2.selected = sopt.selected;m2.defaultSelected = sopt.defaultSelected;m2.DOLOption = m;selObj.options[l] = m2;selObj.options[l].selected = reselectForNN6;}}}}if(selObj.onchange==null){selObj.onchange = new Function("dynamicOptionListObjects["+dol.index+"].change(this)");}}}}resetDynamicOptionLists();} function resetDynamicOptionLists(theform){for(var i=0;i<dynamicOptionListObjects.length;i++){var dol = dynamicOptionListObjects[i];if(typeof(theform)=="undefined" || theform==null || theform==dol.form){for(var j=0;j<dol.fieldNames.length;j++){dol.change(dol.form[dol.fieldNames[j][0]],true);}}}} function DOLOption(text,value,defaultSelected,selected){this.text = text;this.value = value;this.defaultSelected = defaultSelected;this.selected = selected;this.options = new Array();return this;} function DynamicOptionList(){this.form = null;this.options = new Array();this.longestString = new Array();this.numberOfOptions = new Array();this.currentNode = null;this.currentField = null;this.currentNodeDepth = 0;this.fieldNames = new Array();this.formIndex = null;this.formName = null;this.fieldListIndexes = new Object();this.fieldIndexes = new Object();this.selectFirstOption = true;this.numberOfOptions = new Array();this.longestString = new Array();this.values = new Object();this.forValue = DOL_forValue;this.forText = DOL_forText;this.forField = DOL_forField;this.forX = DOL_forX;this.addOptions = DOL_addOptions;this.addOptionsTextValue = DOL_addOptionsTextValue;this.setDefaultOptions = DOL_setDefaultOptions;this.setValues = DOL_setValues;this.setValue = DOL_setValues;this.setFormIndex = DOL_setFormIndex;this.setFormName = DOL_setFormName;this.printOptions = DOL_printOptions;this.addDependentFields = DOL_addDependentFields;this.change = DOL_change;this.child = DOL_child;this.selectChildOptions = DOL_selectChildOptions;this.populateChild = DOL_populateChild;this.change = DOL_change;this.addNewOptionToList = DOL_addNewOptionToList;this.findMatchingOptionInArray = DOL_findMatchingOptionInArray;if(arguments.length > 0){for(var i=0;i<arguments.length;i++){this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length;this.fieldIndexes[arguments[i].toString()] = i;}this.fieldNames[this.fieldNames.length] = arguments;}this.index = window.dynamicOptionListCount++;window["dynamicOptionListObjects"][this.index] = this;} function DOL_findMatchingOptionInArray(a,text,value,exactMatchRequired){if(a==null || typeof(a)=="undefined"){return null;}var value_match = null;var text_match = null;for(var i=0;i<a.length;i++){var opt = a[i];if(opt.value==value && opt.text==text){return opt;}if(!exactMatchRequired){if(value_match==null && value!=null && opt.value==value){value_match = opt;}if(text_match==null && text!=null && opt.text==text){text_match = opt;}}}return(value_match!=null)?value_match:text_match;} function DOL_forX(s,type){if(this.currentNode==null){this.currentNodeDepth=0;}var useNode =(this.currentNode==null)?this:this.currentNode;var o = this.findMatchingOptionInArray(useNode["options"],(type=="text")?s:null,(type=="value")?s:null,false);if(o==null){o = new DOLOption(null,null,false,false);o[type] = s;useNode.options[useNode.options.length] = o;}this.currentNode = o;this.currentNodeDepth++;return this;} function DOL_forValue(s){return this.forX(s,"value");} function DOL_forText(s){return this.forX(s,"text");} function DOL_forField(f){this.currentField = f;return this;} function DOL_addNewOptionToList(a, text, value, defaultSelected){var o = new DOLOption(text,value,defaultSelected,false);if(a==null){a = new Array();}for(var i=0;i<a.length;i++){if(a[i].text==o.text && a[i].value==o.value){if(o.selected){a[i].selected=true;}if(o.defaultSelected){a[i].defaultSelected = true;}return a;}}a[a.length] = o;} function DOL_addOptions(){if(this.currentNode==null){this.currentNode = this;}if(this.currentNode["options"] == null){this.currentNode["options"] = new Array();}for(var i=0;i<arguments.length;i++){var text = arguments[i];this.addNewOptionToList(this.currentNode.options,text,text,false);if(typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined"){this.numberOfOptions[this.currentNodeDepth]=0;}if(this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]){this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length;}if(typeof(this.longestString[this.currentNodeDepth])=="undefined" ||(text.length > this.longestString[this.currentNodeDepth].length)){this.longestString[this.currentNodeDepth] = text;}}this.currentNode = null;this.currentNodeDepth = 0;} function DOL_addOptionsTextValue(){if(this.currentNode==null){this.currentNode = this;}if(this.currentNode["options"] == null){this.currentNode["options"] = new Array();}for(var i=0;i<arguments.length;i++){var text = arguments[i++];var value = arguments[i];this.addNewOptionToList(this.currentNode.options,text,value,false);if(typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined"){this.numberOfOptions[this.currentNodeDepth]=0;}if(this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]){this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length;}if(typeof(this.longestString[this.currentNodeDepth])=="undefined" ||(text.length > this.longestString[this.currentNodeDepth].length)){this.longestString[this.currentNodeDepth] = text;}}this.currentNode = null;this.currentNodeDepth = 0;} function DOL_child(obj){var listIndex = this.fieldListIndexes[obj.name];var index = this.fieldIndexes[obj.name];if(index <(this.fieldNames[listIndex].length-1)){return this.form[this.fieldNames[listIndex][index+1]];}return null;} function DOL_setDefaultOptions(){if(this.currentNode==null){this.currentNode = this;}for(var i=0;i<arguments.length;i++){var o = this.findMatchingOptionInArray(this.currentNode.options,null,arguments[i],false);if(o!=null){o.defaultSelected = true;}}this.currentNode = null;} function DOL_setValues(){if(this.currentField==null){alert("Can't call setValues() without using forField() first!");return;}if(typeof(this.values[this.currentField])=="undefined"){this.values[this.currentField] = new Object();}for(var i=0;i<arguments.length;i++){this.values[this.currentField][arguments[i]] = true;}this.currentField = null;} function DOL_setFormIndex(i){this.formIndex = i;} function DOL_setFormName(n){this.formName = n;} function DOL_printOptions(name){if((navigator.appName == 'Netscape') &&(parseInt(navigator.appVersion) <= 4)){var index = this.fieldIndexes[name];var ret = "";if(typeof(this.numberOfOptions[index])!="undefined"){for(var i=0;i<this.numberOfOptions[index];i++){ret += "<OPTION>";}}ret += "<OPTION>";if(typeof(this.longestString[index])!="undefined"){for(var i=0;i<this.longestString[index].length;i++){ret += "_";}}document.writeln(ret);}} function DOL_addDependentFields(){for(var i=0;i<arguments.length;i++){this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length;this.fieldIndexes[arguments[i].toString()] = i;}this.fieldNames[this.fieldNames.length] = arguments;} function DOL_change(obj, usePreselected){if(usePreselected==null || typeof(usePreselected)=="undefined"){usePreselected = false;}var changedListIndex = this.fieldListIndexes[obj.name];var changedIndex = this.fieldIndexes[obj.name];var child = this.child(obj);if(child == null){return;}if(obj.type == "select-one"){if(child.options!=null){child.options.length=0;}if(obj.options!=null && obj.options.length>0 && obj.selectedIndex>=0){var o = obj.options[obj.selectedIndex];this.populateChild(o.DOLOption,child,usePreselected);this.selectChildOptions(child,usePreselected);}}else if(obj.type == "select-multiple"){var currentlySelectedOptions = new Array();if(!usePreselected){for(var i=0;i<child.options.length;i++){var co = child.options[i];if(co.selected){this.addNewOptionToList(currentlySelectedOptions, co.text, co.value, co.defaultSelected);}}}child.options.length=0;if(obj.options!=null){var obj_o = obj.options;for(var i=0;i<obj_o.length;i++){if(obj_o[i].selected){this.populateChild(obj_o[i].DOLOption,child,usePreselected);}}var atLeastOneSelected = false;if(!usePreselected){for(var i=0;i<child.options.length;i++){var m = this.findMatchingOptionInArray(currentlySelectedOptions,child.options[i].text,child.options[i].value,true);if(m!=null){child.options[i].selected = true;atLeastOneSelected = true;}}}if(!atLeastOneSelected){this.selectChildOptions(child,usePreselected);}}}this.change(child,usePreselected);} function DOL_populateChild(dolOption,childSelectObj,usePreselected){if(dolOption!=null && dolOption.options!=null){for(var j=0;j<dolOption.options.length;j++){var srcOpt = dolOption.options[j];if(childSelectObj.options==null){childSelectObj.options = new Array();}var duplicate = false;var preSelectedExists = false;for(var k=0;k<childSelectObj.options.length;k++){var csi = childSelectObj.options[k];if(csi.text==srcOpt.text && csi.value==srcOpt.value){duplicate = true;break;}}if(!duplicate){var newopt = new Option(srcOpt.text, srcOpt.value, false, false);newopt.selected = false;newopt.defaultSelected = false;newopt.DOLOption = srcOpt;childSelectObj.options[childSelectObj.options.length] = newopt;}}}} function DOL_selectChildOptions(obj,usePreselected){var values = this.values[obj.name];var preselectedExists = false;if(usePreselected && values!=null && typeof(values)!="undefined"){for(var i=0;i<obj.options.length;i++){var v = obj.options[i].value;if(v!=null && values[v]!=null && typeof(values[v])!="undefined"){preselectedExists = true;break;}}}var atLeastOneSelected = false;for(var i=0;i<obj.options.length;i++){var o = obj.options[i];if(preselectedExists && o.value!=null && values[o.value]!=null && typeof(values[o.value])!="undefined"){o.selected = true;atLeastOneSelected = true;}else if(!preselectedExists && o.DOLOption!=null && o.DOLOption.defaultSelected){o.selected = true;atLeastOneSelected = true;}else{o.selected = false;}}if(this.selectFirstOption && !atLeastOneSelected && obj.options.length>0){obj.options[0].selected = true;}else if(!atLeastOneSelected && obj.type=="select-one"){obj.selectedIndex = -1;}} --- NEW FILE: dynamic.js --- // Global objects to keep track of DynamicOptionList objects created on the page var dynamicOptionListCount=0; var dynamicOptionListObjects = new Array(); // Init call to setup lists after page load. One call to this function sets up all lists. function initDynamicOptionLists() { // init each DynamicOptionList object for (var i=0; i<dynamicOptionListObjects.length; i++) { var dol = dynamicOptionListObjects[i]; // Find the form associated with this list if (dol.formName!=null) { dol.form = document.forms[dol.formName]; } else if (dol.formIndex!=null) { dol.form = document.forms[dol.formIndex]; } else { // Form wasn't set manually, so go find it! // Search for the first form element name in the lists var name = dol.fieldNames[0][0]; for (var f=0; f<document.forms.length; f++) { if (typeof(document.forms[f][name])!="undefined") { dol.form = document.forms[f]; break; } } if (dol.form==null) { alert("ERROR: Couldn't find form element "+name+" in any form on the page! Init aborted"); return; } } // Form is found, now set the onchange attributes of each dependent select box for (var j=0; j<dol.fieldNames.length; j++) { // For each set of field names... for (var k=0; k<dol.fieldNames[j].length-1; k++) { // For each field in the set... var selObj = dol.form[dol.fieldNames[j][k]]; if (typeof(selObj)=="undefined") { alert("Select box named "+dol.fieldNames[j][k]+" could not be found in the form. Init aborted"); return; } // Map the HTML options in the first select into the options we created if (k==0) { if (selObj.options!=null) { for (l=0; l<selObj.options.length; l++) { var sopt = selObj.options[l]; var m = dol.findMatchingOptionInArray(dol.options,sopt.text,sopt.value,false); if (m!=null) { var reselectForNN6 = sopt.selected; var m2 = new Option(sopt.text, sopt.value, sopt.defaultSelected, sopt.selected); m2.selected = sopt.selected; // For some reason I need to do this to make NN4 happy m2.defaultSelected = sopt.defaultSelected; m2.DOLOption = m; selObj.options[l] = m2; selObj.options[l].selected = reselectForNN6; // Reselect this option for NN6 to be happy. Yuck. } } } } if (selObj.onchange==null) { // We only modify the onChange attribute if it's empty! Otherwise do it yourself in your source! selObj.onchange = new Function("dynamicOptionListObjects["+dol.index+"].change(this)"); } } } } // Set the preselectd options on page load resetDynamicOptionLists(); } // This function populates lists with the preselected values. // It's pulled out into a separate function so it can be hooked into a 'reset' button on a form // Optionally passed a form object which should be the only form reset function resetDynamicOptionLists(theform) { // reset each DynamicOptionList object for (var i=0; i<dynamicOptionListObjects.length; i++) { var dol = dynamicOptionListObjects[i]; if (typeof(theform)=="undefined" || theform==null || theform==dol.form) { for (var j=0; j<dol.fieldNames.length; j++) { dol.change(dol.form[dol.fieldNames[j][0]],true); // Second argument says to use preselected values rather than default values } } } } // An object to represent an Option() but just for data-holding function DOLOption(text,value,defaultSelected,selected) { this.text = text; this.value = value; this.defaultSelected = defaultSelected; this.selected = selected; this.options = new Array(); // To hold sub-options return this; } // DynamicOptionList CONSTRUCTOR function DynamicOptionList() { this.form = null;// The form this list belongs to this.options = new Array();// Holds the options of dependent lists this.longestString = new Array();// Longest string that is currently a potential option (for Netscape) this.numberOfOptions = new Array();// The total number of options that might be displayed, to build dummy options (for Netscape) this.currentNode = null;// The current node that has been selected with forValue() or forText() this.currentField = null;// The current field that is selected to be used for setValue() this.currentNodeDepth = 0;// How far down the tree the currentNode is this.fieldNames = new Array();// Lists of dependent fields which use this object this.formIndex = null;// The index of the form to associate with this list this.formName = null;// The name of the form to associate with this list this.fieldListIndexes = new Object();// Hold the field lists index where fields exist this.fieldIndexes = new Object();// Hold the index within the list where fields exist this.selectFirstOption = true;// Whether or not to select the first option by default if no options are default or preselected, otherwise set the selectedIndex = -1 this.numberOfOptions = new Array();// Store the max number of options for a given option list this.longestString = new Array();// Store the longest possible string this.values = new Object(); // Will hold the preselected values for fields, by field name // Method mappings this.forValue = DOL_forValue; this.forText = DOL_forText; this.forField = DOL_forField; this.forX = DOL_forX; this.addOptions = DOL_addOptions; this.addOptionsTextValue = DOL_addOptionsTextValue; this.setDefaultOptions = DOL_setDefaultOptions; this.setValues = DOL_setValues; this.setValue = DOL_setValues; this.setFormIndex = DOL_setFormIndex; this.setFormName = DOL_setFormName; this.printOptions = DOL_printOptions; this.addDependentFields = DOL_addDependentFields; this.change = DOL_change; this.child = DOL_child; this.selectChildOptions = DOL_selectChildOptions; this.populateChild = DOL_populateChild; this.change = DOL_change; this.addNewOptionToList = DOL_addNewOptionToList; this.findMatchingOptionInArray = DOL_findMatchingOptionInArray; // Optionally pass in the dependent field names if (arguments.length > 0) { // Process arguments and add dependency groups for (var i=0; i<arguments.length; i++) { this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length; this.fieldIndexes[arguments[i].toString()] = i; } this.fieldNames[this.fieldNames.length] = arguments; } // Add this object to the global array of dynamicoptionlist objects this.index = window.dynamicOptionListCount++; window["dynamicOptionListObjects"][this.index] = this; } // Given an array of Option objects, search for an existing option that matches value, text, or both function DOL_findMatchingOptionInArray(a,text,value,exactMatchRequired) { if (a==null || typeof(a)=="undefined") { return null; } var value_match = null; // Whether or not a value has been matched var text_match = null; // Whether or not a text has been matched for (var i=0; i<a.length; i++) { var opt = a[i]; // If both value and text match, return it right away if (opt.value==value && opt.text==text) { return opt; } if (!exactMatchRequired) { // If value matches, store it until we complete scanning the list if (value_match==null && value!=null && opt.value==value) { value_match = opt; } // If text matches, store it for later if (text_match==null && text!=null && opt.text==text) { text_match = opt; } } } return (value_match!=null)?value_match:text_match; } // Util function used by forValue and forText function DOL_forX(s,type) { if (this.currentNode==null) { this.currentNodeDepth=0; } var useNode = (this.currentNode==null)?this:this.currentNode; var o = this.findMatchingOptionInArray(useNode["options"],(type=="text")?s:null,(type=="value")?s:null,false); if (o==null) { o = new DOLOption(null,null,false,false); o[type] = s; useNode.options[useNode.options.length] = o; } this.currentNode = o; this.currentNodeDepth++; return this; } // Set the portion of the list structure that is to be used by a later operation like addOptions function DOL_forValue(s) { return this.forX(s,"value"); } // Set the portion of the list structure that is to be used by a later operation like addOptions function DOL_forText(s) { return this.forX(s,"text"); } // Set the field to be used for setValue() calls function DOL_forField(f) { this.currentField = f; return this; } // Create and add an option to a list, avoiding duplicates function DOL_addNewOptionToList(a, text, value, defaultSelected) { var o = new DOLOption(text,value,defaultSelected,false); // Add the option to the array if (a==null) { a = new Array(); } for (var i=0; i<a.length; i++) { if (a[i].text==o.text && a[i].value==o.value) { if (o.selected) { a[i].selected=true; } if (o.defaultSelected) { a[i].defaultSelected = true; } return a; } } a[a.length] = o; } // Add sub-options to the currently-selected node, with the same text and value for each option function DOL_addOptions() { if (this.currentNode==null) { this.currentNode = this; } if (this.currentNode["options"] == null) { this.currentNode["options"] = new Array(); } for (var i=0; i<arguments.length; i++) { var text = arguments[i]; this.addNewOptionToList(this.currentNode.options,text,text,false); if (typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined") { this.numberOfOptions[this.currentNodeDepth]=0; } if (this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]) { this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length; } if (typeof(this.longestString[this.currentNodeDepth])=="undefined" || (text.length > this.longestString[this.currentNodeDepth].length)) { this.longestString[this.currentNodeDepth] = text; } } this.currentNode = null; this.currentNodeDepth = 0; } // Add sub-options to the currently-selected node, specifying separate text and values for each option function DOL_addOptionsTextValue() { if (this.currentNode==null) { this.currentNode = this; } if (this.currentNode["options"] == null) { this.currentNode["options"] = new Array(); } for (var i=0; i<arguments.length; i++) { var text = arguments[i++]; var value = arguments[i]; this.addNewOptionToList(this.currentNode.options,text,value,false); if (typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined") { this.numberOfOptions[this.currentNodeDepth]=0; } if (this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]) { this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length; } if (typeof(this.longestString[this.currentNodeDepth])=="undefined" || (text.length > this.longestString[this.currentNodeDepth].length)) { this.longestString[this.currentNodeDepth] = text; } } this.currentNode = null; this.currentNodeDepth = 0; } // Find the first dependent list of a select box // If it's the last list in a chain, return null because there are no children function DOL_child(obj) { var listIndex = this.fieldListIndexes[obj.name]; var index = this.fieldIndexes[obj.name]; if (index < (this.fieldNames[listIndex].length-1)) { return this.form[this.fieldNames[listIndex][index+1]]; } return null; } // Set the options which should be selected by default for a certain value in the parent function DOL_setDefaultOptions() { if (this.currentNode==null) { this.currentNode = this; } for (var i=0; i<arguments.length; i++) { var o = this.findMatchingOptionInArray(this.currentNode.options,null,arguments[i],false); if (o!=null) { o.defaultSelected = true; } } this.currentNode = null; } // Set the options which should be selected when the page loads. This is different than the default value and ONLY applies when the page LOADS function DOL_setValues() { if (this.currentField==null) { alert("Can't call setValues() without using forField() first!"); return; } if (typeof(this.values[this.currentField])=="undefined") { this.values[this.currentField] = new Object(); } for (var i=0; i<arguments.length; i++) { this.values[this.currentField][arguments[i]] = true; } this.currentField = null; } // Manually set the form for the object using an index function DOL_setFormIndex(i) { this.formIndex = i; } // Manually set the form for the object using a form name function DOL_setFormName(n) { this.formName = n; } // Print blank <option> objects for Netscape4, since it refuses to grow or shrink select boxes for new options function DOL_printOptions(name) { // Only need to write out "dummy" options for Netscape4 if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) <= 4)){ var index = this.fieldIndexes[name]; var ret = ""; if (typeof(this.numberOfOptions[index])!="undefined") { for (var i=0; i<this.numberOfOptions[index]; i++) { ret += "<OPTION>"; } } ret += "<OPTION>"; if (typeof(this.longestString[index])!="undefined") { for (var i=0; i<this.longestString[index].length; i++) { ret += "_"; } } document.writeln(ret); } } // Add a list of field names which use this option-mapping object. // A single mapping object may be used by multiple sets of fields function DOL_addDependentFields() { for (var i=0; i<arguments.length; i++) { this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length; this.fieldIndexes[arguments[i].toString()] = i; } this.fieldNames[this.fieldNames.length] = arguments; } // Called when a parent select box is changed. It populates its direct child, then calls change on the child object to continue the population. function DOL_change(obj, usePreselected) { if (usePreselected==null || typeof(usePreselected)=="undefined") { usePreselected = false; } var changedListIndex = this.fieldListIndexes[obj.name]; var changedIndex = this.fieldIndexes[obj.name]; var child = this.child(obj); if (child == null) { return; } // No child, no need to continue if (obj.type == "select-one") { // Treat single-select differently so we don't have to scan the entire select list, which could potentially speed things up if (child.options!=null) { child.options.length=0; // Erase all the options from the child so we can re-populate } if (obj.options!=null && obj.options.length>0 && obj.selectedIndex>=0) { var o = obj.options[obj.selectedIndex]; this.populateChild(o.DOLOption,child,usePreselected); this.selectChildOptions(child,usePreselected); } } else if (obj.type == "select-multiple") { // For each selected value in the parent, find the options to fill in for this list // Loop through the child list and keep track of options that are currently selected var currentlySelectedOptions = new Array(); if (!usePreselected) { for (var i=0; i<child.options.length; i++) { var co = child.options[i]; if (co.selected) { this.addNewOptionToList(currentlySelectedOptions, co.text, co.value, co.defaultSelected); } } } child.options.length=0; if (obj.options!=null) { var obj_o = obj.options; // For each selected option in the parent... for (var i=0; i<obj_o.length; i++) { if (obj_o[i].selected) { // if option is selected, add its children to the list this.populateChild(obj_o[i].DOLOption,child,usePreselected); } } // Now go through and re-select any options which were selected before var atLeastOneSelected = false; if (!usePreselected) { for (var i=0; i<child.options.length; i++) { var m = this.findMatchingOptionInArray(currentlySelectedOptions,child.options[i].text,child.options[i].value,true); if (m!=null) { child.options[i].selected = true; atLeastOneSelected = true; } } } if (!atLeastOneSelected) { this.selectChildOptions(child,usePreselected); } } } // Change all the way down the chain this.change(child,usePreselected); } function DOL_populateChild(dolOption,childSelectObj,usePreselected) { // If this opton has sub-options, populate the child list with them if (dolOption!=null && dolOption.options!=null) { for (var j=0; j<dolOption.options.length; j++) { var srcOpt = dolOption.options[j]; if (childSelectObj.options==null) { childSelectObj.options = new Array(); } // Put option into select list var duplicate = false; var preSelectedExists = false; for (var k=0; k<childSelectObj.options.length; k++) { var csi = childSelectObj.options[k]; if (csi.text==srcOpt.text && csi.value==srcOpt.value) { duplicate = true; break; } } if (!duplicate) { var newopt = new Option(srcOpt.text, srcOpt.value, false, false); newopt.selected = false; // Again, we have to do these two statements for NN4 to work newopt.defaultSelected = false; newopt.DOLOption = srcOpt; childSelectObj.options[childSelectObj.options.length] = newopt; } } } } // Once a child select is populated, go back over it to select options which should be selected function DOL_selectChildOptions(obj,usePreselected) { // Look to see if any options are preselected=true. If so, then set then selected if usePreselected=true, otherwise set defaults var values = this.values[obj.name]; var preselectedExists = false; if (usePreselected && values!=null && typeof(values)!="undefined") { for (var i=0; i<obj.options.length; i++) { var v = obj.options[i].value; if (v!=null && values[v]!=null && typeof(values[v])!="undefined") { preselectedExists = true; break; } } } // Go back over all the options to do the selection var atLeastOneSelected = false; for (var i=0; i<obj.options.length; i++) { var o = obj.options[i]; if (preselectedExists && o.value!=null && values[o.value]!=null && typeof(values[o.value])!="undefined") { o.selected = true; atLeastOneSelected = true; } else if (!preselectedExists && o.DOLOption!=null && o.DOLOption.defaultSelected) { o.selected = true; atLeastOneSelected = true; } else { o.selected = false; } } // If nothing else was selected, select the first one by default if (this.selectFirstOption && !atLeastOneSelected && obj.options.length>0) { obj.options[0].selected = true; } else if (!atLeastOneSelected && obj.type=="select-one") { obj.selectedIndex = -1; } } --- NEW FILE: mxajax.js --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rico.js --- /** * * Copyright 2005 Sabre Airline Solutions * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions * and limitations under the License. **/ /* openrico.org rico.js */ // rico.js -------------------- [...1856 lines suppressed...] else if ( document.documentElement && document.documentElement.scrollLeft ) return document.documentElement.scrollLeft; else if ( document.body ) return document.body.scrollLeft; else return 0; }, docScrollTop: function() { if ( window.pageYOffset ) return window.pageYOffset; else if ( document.documentElement && document.documentElement.scrollTop ) return document.documentElement.scrollTop; else if ( document.body ) return document.body.scrollTop; else return 0; } }; |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:25
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/install Modified Files: mx_install.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** mx_install.php 17 Apr 2005 18:28:35 -0000 1.45 --- mx_install.php 20 Aug 2005 18:19:11 -0000 1.46 *************** *** 578,582 **** if( @file_exists($mx_root_path . 'cache/block_config.xml') ) { ! include($mx_root_path . "cache/mx_cache.$phpEx"); write_cache_config(); $process_msgs[] = $lang['Cache_generate']; --- 578,582 ---- if( @file_exists($mx_root_path . 'cache/block_config.xml') ) { ! include($mx_root_path . "cache/mx_functions_core$phpEx"); write_cache_config(); $process_msgs[] = $lang['Cache_generate']; *************** *** 592,596 **** { $portal_config = $db->sql_fetchrow($result); ! include($mx_root_path . "includes/mx_cache.$phpEx"); update_session_cache(); $process_msgs[] = $lang['Cache_generate']; --- 592,596 ---- { $portal_config = $db->sql_fetchrow($result); ! include($mx_root_path . "includes/mx_functions_core.$phpEx"); update_session_cache(); $process_msgs[] = $lang['Cache_generate']; |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:25
|
Update of /cvsroot/mxbb/core/modules/mx_last_msg/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/modules/mx_last_msg/language/lang_english Modified Files: lang_admin.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) Index: lang_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_last_msg/language/lang_english/lang_admin.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lang_admin.php 30 Jun 2003 08:53:56 -0000 1.2 --- lang_admin.php 20 Aug 2005 18:19:12 -0000 1.3 *************** *** 23,54 **** // setlocale(LC_ALL, "en"); ! $lang['Last_Msg_forum'] = "Source Forums<br /> You may do multiple selections<br />* If none is selected, all authorized forums vill be visible"; ! $lang['Last_Msg_Display_Icon_View'] = "Display Icon for 'Go to last message'"; ! $lang['Last_Msg_Display_Last_Author'] = "Display Last Post"; ! $lang['Last_Msg_Display_Author'] = "Display Author Name"; ! $lang['Last_Msg_Settings'] = "Configuration for Last Message Post Module:"; ! $lang['Last_Msg_Settings'] = "Configuration for Last Message Post Module:"; ! $lang['Last_Msg_Number_Title'] = "Number of Posts to display:"; ! $lang['Last_Msg_Display_Date'] = "Display Date?"; ! $lang['Last_Msg_Title_Length'] = "Title lenght (max characters):"; ! $lang['Last_Msg_Title_Length_Info']= ""; ! $lang['Last_Msg_Display_Forum'] = "Display Forum Name?"; ! $lang['Last_Msg_Align'] = "Title Align:" ; ! $lang['Last_Msg_Align_Left'] = "left"; ! $lang['Last_Msg_Align_Right'] = "right"; ! $lang['Last_Msg_Align_Center'] = "center"; ! $lang['Last_Msg_Target'] = "Target:"; ! $lang['Last_Msg_Target_1'] = "New Window"; ! $lang['Last_Msg_Target_2'] = "Current Window"; ! $lang['Config_updated'] = "Module Configuration successfully updated"; ! $lang['Click_return_config'] = "Click %sHere%s to return to Module Administration"; ! $lang['Click_return_admin_index'] = "Click %sHere%s to return to Index Administration"; // --- 23,54 ---- // setlocale(LC_ALL, "en"); ! $lang['Last_Msg_forum'] = "Source Forums"; ! $lang['Last_Msg_forum_explain'] = "- You may do multiple selections<br />* If none is selected, all authorized forums vill be visible"; ! $lang['Last_Msg_Display_Icon_View'] = "Display Icon for 'Go to last message'"; ! $lang['Last_Msg_Display_Last_Author'] = "Display Last Post"; ! $lang['Last_Msg_Display_Author'] = "Display Author Name"; ! $lang['Last_Msg_Settings'] = "Configuration for Last Message Post Module:"; ! $lang['Last_Msg_Settings'] = "Configuration for Last Message Post Module:"; ! $lang['Last_Msg_Number_Title'] = "Number of Posts to display:"; ! $lang['Last_Msg_Display_Date'] = "Display Date?"; ! $lang['Last_Msg_Title_Length'] = "Title lenght (max characters):"; ! $lang['Last_Msg_Title_Length_Info'] = ""; ! $lang['Last_Msg_Display_Forum'] = "Display Forum Name?"; ! $lang['Last_Msg_Align'] = "Title Align:" ; ! $lang['Last_Msg_Align_Left'] = "left"; ! $lang['Last_Msg_Align_Right'] = "right"; ! $lang['Last_Msg_Align_Center'] = "center"; ! $lang['Last_Msg_Target'] = "Target:"; ! $lang['Last_Msg_Target_1'] = "New Window"; ! $lang['Last_Msg_Target_2'] = "Current Window"; ! $lang['msg_filter_date'] = "Filter by time"; ! $lang['msg_filter_date_explain'] = "- Show posts from last week, month, year..."; // |
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/admin Modified Files: admin_mx_chkobjs.php admin_mx_gen_cache.php admin_mx_meta.php admin_mx_module.php admin_mx_phpinfo.php admin_mx_portal.php index.php page_footer_admin.php pagestart.php Added Files: admin_mx_block_cp.php admin_mx_module_cp.php admin_mx_page_cp.php Removed Files: admin_mx_block.php admin_mx_block_auth.php admin_mx_menu.php admin_mx_page.php admin_mx_page_auth.php admin_mx_page_setting.php admin_mx_page_template_setting.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- admin_mx_page_auth.php DELETED --- --- admin_mx_page.php DELETED --- Index: admin_mx_chkobjs.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_chkobjs.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_mx_chkobjs.php 28 Apr 2005 04:13:49 -0000 1.10 --- admin_mx_chkobjs.php 20 Aug 2005 18:19:11 -0000 1.11 *************** *** 26,30 **** if( !empty($setmodules) ) { ! $module['Portal - System']['Integrity_Checker'] = 'admin/' . basename(__FILE__); return; } --- 26,30 ---- if( !empty($setmodules) ) { ! $module['4_Panel_system']['4_1_Integrity'] = 'admin/' . basename(__FILE__); return; } --- admin_mx_block_auth.php DELETED --- --- admin_mx_page_template_setting.php DELETED --- Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.php 1 May 2005 15:41:06 -0000 1.8 --- index.php 20 Aug 2005 18:19:11 -0000 1.9 *************** *** 90,93 **** --- 90,95 ---- 'body' => 'admin/index_navigate.tpl') ); + + $admincp_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/'; $template->assign_vars(array( *************** *** 100,103 **** --- 102,113 ---- "U_FORUM_INDEX" => append_sid(PHPBB_URL . "index.$phpEx"), "U_ADMIN_INDEX" => append_sid("index.$phpEx?pane=right"), + //+MOD: DHTML Menu for ACP + 'COOKIE_NAME' => $board_config['cookie_name'], + 'COOKIE_PATH' => $board_config['cookie_path'], + 'COOKIE_DOMAIN' => $board_config['cookie_domain'], + 'COOKIE_SECURE' => $board_config['cookie_secure'], + 'IMG_URL_CONTRACT' => $admincp_nav_icon_url . 'contract.gif', + 'IMG_URL_EXPAND' => $admincp_nav_icon_url . 'expand.gif', + //-MOD: DHTML Menu for ACP "L_FORUM_INDEX" => $lang['Main_index'], "L_ADMIN_INDEX" => $lang['Admin_Index'], *************** *** 118,121 **** --- 128,135 ---- ksort($module_portal); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_portal) ) { *************** *** 123,126 **** --- 137,144 ---- $template->assign_block_vars('module_portal.catrow', array( + //+MOD: DHTML Menu for ACP + 'MENU_CAT_ID' => $menu_cat_id, + 'MENU_CAT_ROWS' => count($action_array), + //-MOD: DHTML Menu for ACP 'ADMIN_CATEGORY' => $cat) ); *************** *** 139,143 **** "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PORTAL_URL . $file) --- 157,163 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => $row_count, ! //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PORTAL_URL . $file) *************** *** 145,148 **** --- 165,171 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } *************** *** 157,160 **** --- 180,187 ---- ksort($module_phpbb); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_phpbb) ) { *************** *** 162,165 **** --- 189,196 ---- $template->assign_block_vars('module_phpbb.catrow', array( + //+MOD: DHTML Menu for ACP + 'MENU_CAT_ID' => $menu_cat_id, + 'MENU_CAT_ROWS' => count($action_array), + //-MOD: DHTML Menu for ACP 'ADMIN_CATEGORY' => $cat) ); *************** *** 178,182 **** "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PHPBB_URL . 'admin/' . $file)) --- 209,215 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => $row_count, ! //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PHPBB_URL . 'admin/' . $file)) *************** *** 184,187 **** --- 217,223 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } *************** *** 216,219 **** --- 252,259 ---- ksort($module_mx); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_mx) ) { *************** *** 221,224 **** --- 261,268 ---- $template->assign_block_vars('module_mx.catrow', array( + //+MOD: DHTML Menu for ACP + 'MENU_CAT_ID' => $menu_cat_id, + 'MENU_CAT_ROWS' => count($action_array), + //-MOD: DHTML Menu for ACP 'ADMIN_CATEGORY' => $cat) ); *************** *** 237,240 **** --- 281,287 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, + //+MOD: DHTML Menu for ACP + 'ROW_COUNT' => $row_count, + //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, *************** *** 243,246 **** --- 290,296 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } // ----------------------------------------------------------------------------------- --- NEW FILE: admin_mx_module_cp.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * $Id: admin_mx_module_cp.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ if( !empty($setmodules) ) { $file = basename(__FILE__); $module['2_CP']['2_2_ModuleCP'] = 'admin/' . $file; return; } // // Security and Page header // define('IN_PORTAL', 1); $mx_root_path = './../'; require($mx_root_path . 'extension.inc'); $no_page_header = TRUE; require('./pagestart.' . $phpEx); // // Instatiate the mx_admin class // $mx_admin = new mx_admin(); // // Instatiate the $mx_dynamic_select class (dynamic block select javascript) // $mx_dynamic_select = new mx_dynamic_select(); $mx_dynamic_select->generate(); // // Mode & Action setting // $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, ''); // Main module id, to load the adminCP blocks and parameter data $nav_module_id = $mx_request_vars->request('module_id', MX_TYPE_INT, ''); if ( empty($nav_module_id) ) { $cookie_tmp = $board_config['cookie_name'].'_adminModule_module_id'; $nav_module_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : ''; } // // SUBMIT? // if( !empty($mode) && !empty($action) ) { // // Get vars // $portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); $id = $mx_request_vars->request('id', MX_TYPE_INT, ''); // // Send to adminCP // $result_message = $mx_admin->do_it($mode, $action, $id); } // if .. !empty($mode) // Load states $cookie_tmp = $board_config['cookie_name'].'_admincp_blockstates'; $cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); $sort_cookie = !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) ? explode(",", $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) : array(); if ( isset( $HTTP_POST_VARS['include_all'] ) ) { switch ( $HTTP_POST_VARS['include_all'] ) { case '0': $include_all = '0'; break; case '1': $include_all = '1'; break; default: $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } } else { $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } $sort_cookie = array(isset($sort_cookie[0]) ? $sort_cookie[0] : '', isset($sort_cookie[1]) ? $sort_cookie[1] : '', isset($sort_cookie[2]) ? $sort_cookie[2] : $include_all, $include_all); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- // // Start page proper // $block_auth_fields = array('auth_view', 'auth_edit'); $block_auth_ary = array( 'auth_view' => AUTH_ALL, 'auth_edit' => AUTH_MOD, ); $block_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN', 'ANONYMOUS'); $block_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN, AUTH_ANONYMOUS); $field_names = array( 'auth_view' => $lang['View'], 'auth_edit' => $lang['Edit'], ); $template->set_filenames(array( 'admin_block' => 'admin/mx_modulecp_admin_body.tpl') ); // // Define some graphics // $module_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/admin_icons/'; $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; $admin_icon['module'] = $module_nav_icon_url . 'icon_module.gif'; $admin_icon['function'] = $module_nav_icon_url . 'icon_function.gif'; $admin_icon['parameter'] = $module_nav_icon_url . 'icon_parameter.gif'; $admin_icon['block'] = $module_nav_icon_url . 'icon_block.gif'; $admin_icon['edit_block'] = $module_nav_icon_url . 'icon_edit.gif'; // // Hidden vars // // // Send to template // $template->assign_vars(array( 'L_TITLE' => $lang['Modulecp_admin'], 'L_EXPLAIN' => $lang['Modulecp_admin_explain'], 'NAV_MODULE_ID' => $nav_module_id, 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'SID' => $userdata['session_id'], 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', // // General // "L_ACTION" => $lang['Action'], "L_DELETE" => $lang['Delete'], 'L_SETTING' => $lang['Settings'], 'L_VIEW' => $lang['View'], "L_EDIT" => $lang['Edit'], "L_ADD" => $lang['Create_parameter'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_CREATE_BLOCK' => ( !empty($lang['Create_block']) ) ? $lang['Create_block'] : 'Create new block', 'L_MOVE_UP' => $lang['Move_up'], 'L_MOVE_DOWN' => $lang['Move_down'], 'L_RESYNC' => $lang['Resync'], 'L_QUICK_NAV' => $lang['Quick_nav_modules'], 'L_INCLUDE_ALL' => $lang['Include_all_modules'], 'S_SUBMIT' => $lang['Update'], // // Parameter // 'L_PARAMETER_NAME' => $lang['Parameter_name'], 'L_PARAMETER_DESC' => $lang['Parameter_desc'], 'L_PARAMETER_TYPE' => $lang['Parameter_type'], 'L_PARAMETER_DEFAULT' => $lang['Parameter_default'], 'L_PARAMETER_FUNCTION' => $lang['Parameter_function'], "L_PARAMETER_TITLE" => $lang['Parameter_admin'], "L_PARAMETER_TEXT" => $lang['Parameter_admin_explain'], 'L_PARAMETER_ID' => $lang['Parameter_id'], // // Function // 'L_FUNCTION' => $lang['Function'], 'L_FUNCTION_TITLE' => $lang['Function_name'], 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_FUNCTION_FILE' => $lang['Function_file'], 'L_FUNCTION_ADMIN_FILE' => $lang['Function_admin_file'], 'L_ADD_FUNCTION' => $lang['Create_function'], // // Module // 'L_MODULE' => $lang['Module'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], 'L_MODULE_PATH' => $lang['Module_path'], 'L_MODULE_INCLUDE_ADMIN' => $lang['Module_include_admin'], // Block 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], 'L_SHOW_BLOCK' => $lang['Show_block'], 'L_SHOW_BLOCK_EXPLAIN' => $lang['Show_block_explain'], 'L_SHOW_TITLE' => $lang['Show_title'], 'L_SHOW_TITLE_EXPLAIN' => $lang['Show_title_explain'], 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], 'L_GROUPS' => $lang['Usergroups'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], // // Graphics // 'IMG_URL_CONTRACT' => $admin_icon['contract'], 'IMG_URL_EXPAND' => $admin_icon['expand'], 'IMG_ICON_MODULE' => $admin_icon['module'], 'IMG_ICON_FUNCTION' => $admin_icon['function'], 'IMG_ICON_PARAMETER' => $admin_icon['parameter'], 'IMG_ICON_BLOCK' => $admin_icon['block'], 'IMG_ICON_EDIT_BLOCK' => $admin_icon['edit_block'], // // Cookies // 'COOKIE_NAME' => $board_config['cookie_name'], 'COOKIE_PATH' => $board_config['cookie_path'], 'COOKIE_DOMAIN' => $board_config['cookie_domain'], 'COOKIE_SECURE' => $board_config['cookie_secure'], 'S_ACTION' => append_sid("admin_mx_module_cp.$phpEx"), 'S_ACTION_DEFAULT' => append_sid("admin_mx_module_cp.$phpEx"), // // Sorting Options // 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_INCLUDE_ALL_YES' => ( $include_all == '1' ) ? 'checked="checked"' : '', 'S_INCLUDE_ALL_NO' => ( $include_all == '0' ) ? 'checked="checked"' : '' )); // // ---------------------------------------------------------------------------------- Modules // // Get the list of phpBB usergroups $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . TRUE . " ORDER BY group_name ASC"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; } // // Get current/active module // $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_id = '" . $nav_module_id . "' ORDER BY module_name ASC"; if( !($q_modules_current = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } $module_rows_current = array(); $module_rows_current = $db->sql_fetchrowset($q_modules_current); // // Get the rest modules // $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_id <> '" . $nav_module_id . "' ORDER BY module_name ASC"; if( !($q_modules = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } $module_rows = array(); if( $total_modules = $db->sql_numrows($q_modules) ) { $module_rows = $db->sql_fetchrowset($q_modules); } if ( $total_modules == 0 ) { $template->assign_block_vars('nomodule', array( 'NONE' => $lang['No_modules'] )); } $module_rows = array_merge($module_rows_current, $module_rows); // // Setup an additional var for the quick nav dropdown // $module_rows_select = array(); // // Module loop // for( $module_count = 0; $module_count < $total_modules + 1; $module_count++ ) { // // Give main vars specific names // $module_id = $module_rows[$module_count]['module_id']; $is_current_module = ($module_id == $nav_module_id); $module_rows_select[$module_id] = $module_rows[$module_count]['module_name']; if (!$include_all && $module_count > 0) { continue; } $mode = MX_MODULE_TYPE; $action = MX_DO_UPDATE; // // Hidden fields // $s_hidden_module_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $module_id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $check_opt = ''; if( $module_rows[$module_count]['module_include_admin'] == 1 ) { $check_opt = 'checked="checked"'; } // // Load module specidic block parameters - add to standard // $type_row = array(); if ( file_exists( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_blockcp_parameter.php' ) ) { include_once( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_blockcp_parameter.php' ); if (class_exists('mx_blockcp_parameter')) { $mx_blockcp_parameter = new mx_blockcp_parameter(); if ( method_exists( $mx_blockcp_parameter, 'get_parameters' ) ) { $type_row = $mx_blockcp_parameter->get_parameters($type_row); } } } $type_row['Text'] = !empty($lang['ParType_Text']) ? $lang['ParType_Text'] : "Text"; $type_row['TextArea'] = !empty($lang['ParType_TextArea']) ? $lang['ParType_TextArea'] : "TextArea"; $type_row['BBText'] = !empty($lang['ParType_BBText']) ? $lang['ParType_BBText'] : "BBText"; $type_row['Html'] = !empty($lang['ParType_Html']) ? $lang['ParType_Html'] : "Html" ; $type_row['Boolean'] = !empty($lang['ParType_Boolean']) ? $lang['ParType_Boolean'] : "Boolean"; $type_row['Number'] = !empty($lang['ParType_Number']) ? $lang['ParType_Number'] : "Number" ; $type_row['Radio_single_select'] = !empty($lang['ParType_Radio_single_select']) ? $lang['ParType_Radio_single_select'] : "Radio_single_select"; $type_row['Menu_single_select'] = !empty($lang['ParType_Menu_single_select']) ? $lang['ParType_Menu_single_select'] : "Menu_single_select"; $type_row['Menu_multiple_select'] = !empty($lang['ParType_Menu_multiple_select']) ? $lang['ParType_Menu_multiple_select'] : "Menu_multiple_select"; $type_row['Checkbox_multiple_select'] = !empty($lang['ParType_Checkbox_multiple_select']) ? $lang['ParType_Checkbox_multiple_select'] : "Checkbox_multiple_select"; $type_row['Function'] = !empty($lang['ParType_Function']) ? $lang['ParType_Function'] : "Function"; //$type_row['Values'] = !empty($lang['ParType_Values']) ? $lang['ParType_Values'] : "Values"; // // Module subpanel - edit // $visible = in_array('adminModule_' . $module_id, $cookie_states); $template->assign_block_vars('module', array( 'L_TITLE' => $lang['Module_admin'], 'L_MODULE' => $lang['Module'], 'VISIBLE' => $visible ? 'block' : 'none', 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'MODULE_ID' => $module_id, 'MODULE_TITLE' => $module_rows[$module_count]['module_name'], 'MODULE_DESC' => ( $module_rows[$module_count]['module_desc'] != '' ) ? ' - ' . $module_rows[$module_count]['module_desc'] : '', 'U_MODULE_EDIT' => append_sid(PORTAL_URL . "admin/admin_mx_module.$phpEx?module_id=" . $module_rows[$module_count]['module_id']), // Module subpanel - edit 'E_MODULE_NAME' => $module_rows[$module_count]['module_name'], 'E_MODULE_DESC' => $module_rows[$module_count]['module_desc'], 'E_MODULE_PATH' => $module_rows[$module_count]['module_path'], 'E_MODULE_INCLUDE_CHECK_OPT' => $check_opt, 'S_HIDDEN_FIELDS' => $s_hidden_module_fields, 'S_SUBMIT' => $lang['Update'] )); if ( $module_count == 1 ) { $template->assign_block_vars('module.allmodules', array()); } if ( $is_current_module ) { $template->assign_block_vars('module.is_current', array()); } else { $template->assign_block_vars('module.reload', array( 'U_MODULE_EDIT' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx?module_id=" . $module_id), )); // // Only load all parameters for current module // continue; } // ----------------------------------------------------------------------------------Functions // Now continue with the module functions // $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE module_id = '" . $module_rows[$module_count]['module_id'] . "' ORDER BY function_name ASC"; if( !($q_functions = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query functions information", "", __LINE__, __FILE__, $sql); } $function_rows = array(); if( $total_functions = $db->sql_numrows($q_functions) ) { $function_rows = $db->sql_fetchrowset($q_functions); } if ( $total_functions == 0 ) { $template->assign_block_vars('module.nofunction', array( 'NONE' => $lang['No_functions'] )); } // // Function loop // $modulelist = get_list('module_id', MODULE_TABLE, 'module_id', 'module_name', $module_id, true); for( $function_count = 0; $function_count < $total_functions + 1; $function_count++ ) { $new_function = $function_count == $total_functions; $function_id = $new_function ? $module_id . '_0' : $function_rows[$function_count]['function_id']; $id = $new_function ? $module_id : $function_id; $mode = MX_FUNCTION_TYPE; $action = $new_function ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $function_id; // // Hidden fields // $s_hidden_function_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $function_title = !$new_function ? $function_rows[$function_count]['function_name'] : ''; $function_desc = !$new_function ? $function_rows[$function_count]['function_desc'] : ''; $function_file = !$new_function ? $function_rows[$function_count]['function_file'] : ''; $function_admin_file = !$new_function ? $function_rows[$function_count]['function_admin'] : ''; $message_delete = $lang['Delete_function'] . ' - ' . $function_title . '<br /><br />' . $lang['Delete_function_explain'] . '<br /><br />' . sprintf($lang['Click_function_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; $module_path = '../' . $module_rows[$module_count]['module_path']; // // Function subpanel - edit // $visible_func_tag = in_array('adminFunction_' . $function_id, $cookie_states); $visible_func_delete_tag = in_array('adminFunctionDelete_' . $function_id, $cookie_states); $visible_par_tag = in_array('adminParameter_' . $function_id, $cookie_states); $visible_block_tag = in_array('adminBlock_' . $function_id, $cookie_states); $template->assign_block_vars('module.function', array( 'L_TITLE' => $lang['Function_admin'], 'L_TITLE_PAR' => $lang['Parameter_admin'], 'L_EDIT' => $new_function ? '' : $lang['Edit'], 'L_EDIT_PAR' => $new_function ? '' : $lang['Parameters'], 'L_SHOW_BLOCKS' => $new_function ? '' : $lang['Show_blocks'], 'L_DELETE' => $new_function ? '' : $lang['Delete'], 'COOKIE_TAG' => $new_function ? 'adminFunction_' : 'adminBlock_', 'VISIBLE_FUNC' => $visible_func_tag ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_func_delete_tag ? 'block' : 'none', 'VISIBLE_PAR' => $visible_par_tag ? 'block' : 'none', 'VISIBLE_BLOCK' => $visible_block_tag ? 'block' : 'none', 'IMG_URL_FUNC' => $visible_func_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_func_delete_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_PAR' => $visible_par_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_BLOCK' => $visible_block_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'FUNCTION_ID' => $function_id, 'FUNCTION_TITLE' => $new_function ? '<span class="cattitle">'. $lang['Create_function'] . '</span>' : '<span class="topictitle">'.$lang['Function'].': </span>'.$function_title, 'FUNCTION_DESC' => ( $function_desc != '' ) ? ' - ' . $function_desc : '', 'U_FUNCTION_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx" . $deletemode), // // Function subpanel - edit // 'L_MODULE' => $lang['Module'], 'L_FUNCTION' => $lang['Function'], 'L_FUNCTION_TITLE' => $lang['Function_name'], 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_FUNCTION_FILE' => $lang['Function_file'], 'L_FUNCTION_ADMIN_FILE' => $lang['Function_admin_file'], 'E_MODULE_SELECT' => $modulelist, 'E_FUNCTION_TITLE' => $function_title, 'E_FUNCTION_DESC' => $function_desc, 'E_FUNCTION_FILE' => $function_file, 'E_FUNCTION_ADMIN_FILE' => $function_admin_file, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_function_fields, 'S_SUBMIT' => $new_function ? $lang['Create_function'] : $lang['Update'] )); if ($new_function) { continue; } else { $template->assign_block_vars('module.function.is_function', array()); } // ----------------------------------------------------------------------------------Parameters // Now continue with the function parameters // $sql = "SELECT * FROM " . PARAMETER_TABLE . " par WHERE par.function_id = $function_id ORDER BY par.parameter_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain the parameters from database", "", __LINE__, __FILE__, $sql); } $parameter_rows = $db->sql_fetchrowset($result); $total_parameters = count($parameter_rows); if ( $total_parameters == 0 ) { $template->assign_block_vars('module.function.noparameter', array( 'NONE' => $lang['No_parameters'] )); } $functionlist = get_list('function_id', FUNCTION_TABLE, 'function_id', 'function_name', $function_id, true); // // Parameter loop // for( $parameter_count = 0; $parameter_count < $total_parameters + 1; $parameter_count++ ) { $new_parameter = $parameter_count == $total_parameters; $parameter_id = $new_parameter ? $function_id . '_0': $parameter_rows[$parameter_count]['parameter_id']; $id = $new_parameter ? $function_id : $parameter_id; $mode = MX_PARAMETER_TYPE; $action = $new_parameter ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $parameter_id; // // Hidden fields // $s_hidden_parameter_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $parameter_title = !$new_parameter ? $parameter_rows[$parameter_count]['parameter_name'] : ''; $parameter_type = !$new_parameter ? get_list_static('parameter_type', $type_row, $parameter_rows[$parameter_count]['parameter_type']) : get_list_static('parameter_type', $type_row, 'BBText'); $parameter_function = $parameter_rows[$parameter_count]['parameter_function']; $parameter_function = !$new_parameter && !empty($parameter_function) ? ( $parameter_rows[$parameter_count]['parameter_type'] != 'Function' ? implode( "\n", unserialize( stripslashes( $parameter_function ) ) ) : $parameter_function ) : ''; $parameter_default = !$new_parameter ? $parameter_rows[$parameter_count]['parameter_default'] : ''; $message_delete = $lang['Delete_parameter'] . ' - ' . $parameter_title . '<br /><br />' . $lang['Delete_parameter_explain'] . '<br /><br />' . sprintf($lang['Click_parameter_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; // Replace htmlentites for < and > with actual character. $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; // // Parameter subpanel - edit // $visible = in_array('adminParEdit_' . $parameter_id, $cookie_states); $visible_delete = in_array('adminParDelete_' . $parameter_id, $cookie_states); $template->assign_block_vars('module.function.parameter', array( 'L_TITLE' => $lang['Parameter_admin'], 'L_EXPLAIN' => $lang['Parameter_admin_explain'], 'VISIBLE' => $visible ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_delete ? 'block' : 'none', 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_delete ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', "ROW_COLOR" => '#' . $row_color, "ROW_CLASS" => $row_class, 'L_EDIT' => $new_parameter ? '' : $lang['Edit'], 'L_DELETE' => $new_parameter ? '' : $lang['Delete'], "PARAMETER_ID" => $parameter_id, "PARAMETER_TITLE" => $new_parameter ? '<span class="cattitle">'. $lang['Create_parameter'] . '</span>' : ( ! empty ( $lang[$parameter_title] ) ? $lang[$parameter_title] : $parameter_title ), "PARAMETER_DESC" => $new_parameter ? '' : ' - ' . $parameter_desc, "U_DELETE" => append_sid("admin_mx_module_cp.php" . $deletemode), // // Parameter subpanel - edit // 'L_FUNCTION' => $lang['Function'], 'L_PARAMETER_TITLE' => $lang['Parameter_name'], 'L_PARAMETER_TYPE' => $lang['Parameter_type'], 'L_PARAMETER_DEFAULT' => $lang['Parameter_default'], 'L_PARAMETER_FUNCTION' => $lang['Parameter_function'], "L_PARAMETER_TEXT" => $lang['Parameter_admin_explain'], 'L_PARAMETER_ID' => $lang['Parameter_id'], 'E_FUNCTION_SELECT' => $functionlist, 'E_PARAMETER_TITLE' => $parameter_title, 'E_PARAMETER_TYPE' => $parameter_type, 'E_PARAMETER_FUNCTION' => $parameter_function, 'E_PARAMETER_DEFAULT' => $parameter_default, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_parameter_fields, 'S_SUBMIT' => $new_parameter ? $lang['Create_parameter'] : $lang['Update'] )); if (!$new_parameter) { $template->assign_block_vars('module.function.parameter.is_parameter', array()); } } // ----------------------------------------------------------------------------------Blocks // Now continue with the function blocks // $sql = "SELECT blk.*, function_admin, fnc.function_name, fnc.function_id, fnc.function_desc, fnc.module_id FROM " . BLOCK_TABLE . " blk, " . FUNCTION_TABLE . " fnc WHERE blk.function_id = fnc.function_id AND fnc.function_id = '" . $function_rows[$function_count]['function_id'] . "' ORDER BY fnc.function_name ASC"; if( !($q_blocks = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query blocks information", "", __LINE__, __FILE__, $sql); } $block_rows = array(); if( $total_blocks = $db->sql_numrows($q_blocks) ) { $block_rows = $db->sql_fetchrowset($q_blocks); } if ( $total_blocks == 0 ) { $template->assign_block_vars('module.function.noblock', array( 'NONE' => $lang['No_blocks'] )); } // // Block loop // for( $block_count = 0; $block_count < $total_blocks + 1; $block_count++ ) { $new_block = $block_count == $total_blocks; $block_id = $new_block ? $function_id . '_0' : $block_rows[$block_count]['block_id']; $id = $new_block ? $function_id : $block_id; $mode = MX_BLOCK_TYPE; $mode_private = MX_BLOCK_PRIVATE_TYPE; $action = $new_block ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $block_id; // // Hidden fields // $s_hidden_block_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; // // Hidden fields // $s_hidden_block_private_fields = '<input type="hidden" name="mode" value="' . $mode_private . '" /> <input type="hidden" name="action" value="' . MX_DO_UPDATE . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $block_title = !$new_block ? $block_rows[$block_count]['block_title'] : ''; $block_desc = !$new_block ? $block_rows[$block_count]['block_desc']: ''; $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; $show_block = !$new_block ? $block_rows[$block_count]['show_block'] : '1'; $show_title = !$new_block ? $block_rows[$block_count]['show_title'] : '1'; $show_stats = !$new_block ? $block_rows[$block_count]['show_stats'] : '0'; $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; $show_block_yes = ( $show_block == 1 ) ? 'checked="checked"' : ''; $show_block_no = ( $show_block == 0 ) ? 'checked="checked"' : ''; $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; $block_editor_id = !$new_block ? $block_rows[$block_count]['block_editor_id'] : $userdata['user_id']; $editor_name_tmp = get_userdata($block_editor_id); $editor_name = $editor_name_tmp['username']; $block_time = !$new_block ? $block_rows[$block_count]['block_time'] : time(); $edit_time = create_date( $board_config['default_dateformat'], $block_time, $board_config['board_timezone'] ); if ($new_block) { $block_rows[$block_count][$block_auth_fields[0]] = AUTH_ALL; $block_rows[$block_count][$block_auth_fields[1]] = AUTH_ADMIN; } // // Block subpanel - edit // $visible_tag_edit = in_array('adminEdit_' . $block_id, $cookie_states); $visible_tag_private = in_array('adminPrivate_' . $block_id, $cookie_states); $visible_tag_delete = in_array('adminBlockDelete_' . $block_id, $cookie_states); $visible_tag_settings = in_array('adminSettings_' . $block_id, $cookie_states); $template->assign_block_vars('module.function.block', array( 'L_TITLE' => $lang['Block_admin'], 'VISIBLE_EDIT' => $visible_tag_edit ? 'block' : 'none', 'VISIBLE_PRIVATE' => $visible_tag_private ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_tag_delete ? 'block' : 'none', 'VISIBLE_SETTINGS' => $visible_tag_settings ? 'block' : 'none', 'IMG_URL_EDIT' => $visible_tag_edit ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_PRIVATE' => $visible_tag_private ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_tag_delete ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_SETTINGS' => $visible_tag_settings ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'L_SETTINGS' => $new_block ? '' : $lang['Block_cp'], 'L_PERMISSIONS_ADV' => $new_block ? '' : $lang['Permissions_adv'], 'L_DELETE' => $new_block ? '' : $lang['Delete'], 'L_EDIT' => $new_block ? '' : $lang['Block_quick_edit'], 'L_QUICK_STATS' => $new_block ? '' : $lang['Block_quick_stats'], 'BLOCK_ID' => $block_id, 'BLOCK_TITLE' => $new_block ? '<span class="cattitle">'. $lang['Create_block'] . '</span>' : $block_title, 'BLOCK_DESC' => ( $block_desc != '' ) ? '<br /> ' . $block_desc : '', 'BLOCK_LAST_EDITED' => ( $editor_name != '' && !$new_block) ? ' (' . $lang['Block_updated_by'] . $editor_name . ', ' . $edit_time . ')' : '', 'U_BLOCK_SETTINGS' => append_sid(PORTAL_URL . "admin/admin_mx_block_cp.$phpEx?block_id=$block_id"), 'U_BLOCK_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx" . $deletemode), 'U_BLOCK_PERMISSIONS' => append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), // // Block subpanel - edit // 'L_FUNCTION' => $lang['Function'], 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], 'L_SHOW_BLOCK' => $lang['Show_block'], 'L_SHOW_BLOCK_EXPLAIN' => $lang['Show_block_explain'], 'L_SHOW_TITLE' => $lang['Show_title'], 'L_SHOW_TITLE_EXPLAIN' => $lang['Show_title_explain'], 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, 'S_FUNCTION_LIST' => $functionlist, 'S_SHOW_BLOCK_YES' => $show_block_yes, 'S_SHOW_BLOCK_NO' => $show_block_no, 'S_SHOW_TITLE_YES' => $show_title_yes, 'S_SHOW_TITLE_NO' => $show_title_no, 'S_SHOW_STATS_YES' => $show_stats_yes, 'S_SHOW_STATS_NO' => $show_stats_no, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_block_fields, 'S_HIDDEN_PRIVATE_FIELDS' => $s_hidden_block_private_fields, 'S_SUBMIT' => $new_block ? $lang['Create_block'] : $lang['Update'] )); // // Auth // for( $l = 0; $l < count($block_auth_fields); $l++ ) { $custom_auth[$l] = ' <select name="' . $block_auth_fields[$l] . '">'; for( $k = 0; $k < count($block_auth_levels); $k++ ) { $selected = ( $block_rows[$block_count][$block_auth_fields[$l]] == $block_auth_const[$k] ) ? ' selected="selected"' : ''; $custom_auth[$l] .= '<option value="' . $block_auth_const[$k] . '"' . $selected . '>' . $lang['AUTH_' . $block_auth_levels[$k]] . "</option>\n"; } $custom_auth[$l] .= '</select> '; $cell_title = $field_names[$block_auth_fields[$l]]; $template->assign_block_vars('module.function.block.block_auth_titles', array( 'CELL_TITLE' => $cell_title )); $template->assign_block_vars('module.function.block.block_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$l] )); $s_column_span++; } // // PRIVATE auth // $view_groups = @explode(',', $block_rows[$block_count]['auth_view_group']); $edit_groups = @explode(',', $block_rows[$block_count]['auth_edit_group']); $moderator_groups = @explode(',', $block_rows[$block_count]['auth_moderator_group']); $row_private = ''; for( $i = 0; $i < count($groupdata); $i++ ) { $row_color = ( !( $i % 2 ) ) ? 'row1' : 'row2'; $row_private .= '<tr>'; $row_private .= '<td width="40%" class="'.$row_color.'" align="center"><span class="gen">'.$groupdata[$i]['group_name'].'</span></td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $block_rows[$block_count]['auth_view'] == AUTH_ACL ) { $view_checked = in_array($groupdata[$i]['group_id'], $view_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="view[]" type="checkbox" ' . $view_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $block_rows[$block_count]['auth_edit'] == AUTH_ACL ) { $edit_checked = in_array($groupdata[$i]['group_id'], $edit_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="edit[]" type="checkbox" ' . $edit_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; $row_private .= '<input name="moderator[]" type="checkbox" '. (( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') . '" value="'.$groupdata[$i]['group_id'].'" />'; $row_private .= '</td>'; $row_private .= '</tr>'; } $template->assign_block_vars('module.function.block.grouprows', array( 'GROUP_ROWS' => $row_private )); if (!$new_block) { $template->assign_block_vars('module.function.block.is_block', array()); } } // for ... blocks } // for ... functions } // for .... modules // // Create quick nav box // $module_select_box = get_list_static('module_id', $module_rows_select, $nav_module_id, false); $template->assign_vars(array( 'MODULE_SELECT_BOX' => $module_select_box )); include_once('./page_header_admin.' . $phpEx); $template->pparse('admin_block'); include_once('./page_footer_admin.' . $phpEx); ?> Index: admin_mx_phpinfo.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_phpinfo.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_mx_phpinfo.php 28 Apr 2005 04:13:50 -0000 1.5 --- admin_mx_phpinfo.php 20 Aug 2005 18:19:11 -0000 1.6 *************** *** 21,25 **** if( !empty($setmodules) ) { ! $module['Portal - System']['phpInfo'] = 'admin/' . basename(__FILE__); return; } --- 21,25 ---- if( !empty($setmodules) ) { ! $module['4_Panel_system']['4_1_PHPinfo'] = 'admin/' . basename(__FILE__); return; } Index: admin_mx_module.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** admin_mx_module.php 28 Apr 2005 04:13:49 -0000 1.30 --- admin_mx_module.php 20 Aug 2005 18:19:11 -0000 1.31 *************** *** 21,25 **** if( !empty($setmodules) ) { ! $module['Portal - Modules']['Module_admin'] = 'admin/' . basename( __FILE__ ); return; } --- 21,26 ---- if( !empty($setmodules) ) { ! $file = basename(__FILE__); ! $module['2_CP']['2_1_Modules'] = 'admin/' . $file; return; } *************** *** 35,38 **** --- 36,44 ---- // + // Instatiate the mx_cache class + // + $mx_admin = new mx_admin(); + + // // Pak file delimiter // *************** *** 40,55 **** // ! // Check to see what mode we should operate in. // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) ! { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); ! } ! else { ! $mode = ''; } if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) { --- 46,67 ---- // ! // Mode & Action setting // ! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); ! $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, ''); ! ! // Main module id, to load the adminCP blocks and parameter data ! $nav_module_id = $mx_request_vars->request('module_id', MX_TYPE_INT, ''); ! ! if ( empty($nav_module_id) ) { ! $cookie_tmp = $board_config['cookie_name'].'_adminModule_module_id'; ! $nav_module_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : ''; } + // Load states + $cookie_tmp = $board_config['cookie_name'].'_admincp_blockstates'; + $cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); + if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) { *************** *** 64,77 **** $mode = 'upgrade_module'; } ! if( isset($HTTP_POST_VARS['this_module_path']) || isset($HTTP_GET_VARS['this_module_path']) ) ! { ! $this_module_path = ( isset($HTTP_POST_VARS['this_module_path']) ) ? $HTTP_POST_VARS['this_module_path'] : $HTTP_GET_VARS['this_module_path']; ! $this_module_path = htmlspecialchars($this_module_path); ! } ! else { ! $this_module_path = ''; ! } // // Main switch --- 76,98 ---- $mode = 'upgrade_module'; } ! ! $this_module_path = $mx_request_vars->request('this_module_path', MX_TYPE_NO_TAGS, ''); ! ! if( !empty($mode) && !empty($action) ) { ! // ! // Get vars ! // ! $portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); ! $id = $mx_request_vars->request('id', MX_TYPE_INT, ''); ! ! // ! // Send to adminCP ! // ! $result_message = $mx_admin->do_it($mode, $action, $id); ! ! } // if .. !empty($mode) + /* // // Main switch *************** *** 79,86 **** if( !empty($mode) ) { ! $module_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); ! $function_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); ! $parameter_id = intval($HTTP_GET_VARS['id']); ! switch( $mode ) { --- 100,109 ---- if( !empty($mode) ) { ! // ! // Get vars ! // ! $module_id = $function_id = $mx_request_vars->request('id', MX_TYPE_INT, 0); ! $parameter_id = $mx_request_vars->get('id', MX_TYPE_INT, 0);; ! switch( $mode ) { *************** *** 114,160 **** break; - case 'edit_func': - module_edit_func($function_id); - break; - - case 'insert_func': - module_insert_func(0); - break; - - case 'modify_func': - module_update_func($function_id); - break; - - case 'delete_func': - module_delete_func($function_id, false); - break; - - case 'add_func': - module_edit_func(0); - break; - - case 'add_param': - module_edit_param(0, $function_id); - break; - - case 'edit_param': - module_edit_param($parameter_id, 0); - break; - - case 'delete_param': - module_delete_param($parameter_id, false); - break; - - case 'modify_param': - $parameter_id = intval($HTTP_POST_VARS['id']); - module_update_param($parameter_id); - break; - - case 'insert_param': - module_insert_param(0); - break; - case 'export_pack': ! $module_id = intval($HTTP_POST_VARS['module_select']); if( empty($module_id) ) { --- 137,142 ---- break; case 'export_pack': ! $module_id = $mx_request_vars->request('module_select', MX_TYPE_INT, 0); if( empty($module_id) ) { *************** *** 166,170 **** case 'upgrade_module': ! $file_name = $HTTP_POST_VARS['file_select']; if( empty($file_name) ) { --- 148,152 ---- case 'upgrade_module': ! $file_name = $mx_request_vars->request('file_select', MX_TYPE_NO_TAGS, ''); if( empty($file_name) ) { *************** *** 179,183 **** case 'import_pack' : ! $file_name = $HTTP_POST_VARS['file_select']; if( empty($file_name) ) { --- 161,165 ---- case 'import_pack' : ! $file_name = $mx_request_vars->request('file_select', MX_TYPE_NO_TAGS, ''); if( empty($file_name) ) { *************** *** 196,210 **** } // End mode switch } // End ifmode ! ! // Display list of Modules --------------------------------------------------------------- ! // --------------------------------------------------------------------------------------- ! $sql = "SELECT * FROM " . MODULE_TABLE . " ORDER BY module_id"; ! ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't obtain modules from database", "", __LINE__, __FILE__, $sql); ! } ! $module = $db->sql_fetchrowset($result); $template->set_filenames(array( --- 178,189 ---- } // End mode switch } // End ifmode + */ ! // -------------------------------------------------------------------------------------------------------------------- ! // -------------------------------------------------------------------------------------------------------------------- ! // -------------------------------------------------------------------------------------------------------------------- ! // ! // Start page proper ! // $template->set_filenames(array( *************** *** 212,302 **** ); $s_hidden_fields_module = '<input type="hidden" name="mode" value="add" /><input type="hidden" name="id" value="' . $module_id . '" />'; - $s_hidden_fields_function = '<input type="hidden" name="mode" value="add_func" /><input type="hidden" name="id" value="' . $module_id . '" />'; $template->assign_vars(array( 'L_ACTION' => $lang['Action'], - 'L_MODULE_TITLE' => $lang['Module_admin'], - 'L_MODULE_TEXT' => $lang['Module_admin_explain'], - 'L_FUNCTION_TITLE' => $lang['Function_admin'], - 'L_FUNCTION_TEXT' => $lang['Function_admin_explain'], 'L_DELETE' => $lang['Delete'], 'L_UNINSTALL' => $lang['Uninstall_module'], 'L_EDIT' => $lang['Edit'], 'L_ADD' => $lang['Create_module'], ! 'L_ADD_FUNCTION' => $lang['Create_function'], 'L_CODE' => $lang['Code'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], - 'L_FUNCTION_NAME' => $lang['Function_name'], - 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_IMPORT_PACK' => $lang['import_module_pack'], 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], 'S_HIDDEN_FIELDS_MODULE' => $s_hidden_fields_module, ! 'S_HIDDEN_FIELDS_FUNCTION' => $s_hidden_fields_function, 'S_ACTION' => append_sid("admin_mx_module.$phpEx") )); // ! // Loop through the rows of modules setting block vars for the template. // - for( $i = 0; $i < count($module); $i++ ) - { - // Replace htmlentites for < and > with actual character. - $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; - $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars('module', array( ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class, ! 'CODE' => $module[$i]['module_id'], ! 'NAME' => $module[$i]['module_name'] . '<br />' . $module[$i]['module_version'], ! 'DESC' => $module[$i]['module_desc'], ! 'U_EDIT' => append_sid("admin_mx_module.$phpEx?mode=edit&id=" . $module[$i]['module_id']), ! 'U_DELETE' => append_sid("admin_mx_module.$phpEx?mode=delete&id=" . $module[$i]['module_id']) ! )); } ! // Display list of function --------------------------------------------------------------- ! // ---------------------------------------------------------------------------------------- ! $sql = "SELECT module_name, function_id, function_name, function_desc ! FROM " . FUNCTION_TABLE . " fnc, " . MODULE_TABLE . " mdl ! WHERE mdl.module_id = fnc.module_id ! ORDER BY fnc.module_id, fnc.function_id"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't obtain functions from database", "", __LINE__, __FILE__, $sql); } ! $function_rows = $db->sql_fetchrowset($result); // ! // Loop through the rows of functions setting block vars for the template. // ! for( $i = 0; $i < count($function_rows); $i++ ) { ! // Replace htmlentites for < and > with actual character. ! $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars('function', array( ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class, ! 'MODULE' => $function_rows[$i]['module_name'], ! 'CODE' => $function_rows[$i]['function_id'], ! 'NAME' => $function_rows[$i]['function_name'], ! 'DESC' => $function_rows[$i]['function_desc'], ! 'U_EDIT' => append_sid("admin_mx_module.$phpEx?mode=edit_func&id=" . $function_rows[$i]['function_id']), ! 'U_DELETE' => append_sid("admin_mx_module.$phpEx?mode=delete_func&id=" . $function_rows[$i]['function_id']) )); } // // Generate Module and Function Page // --- 191,429 ---- ); + // + // Define some graphics + // + $module_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/admin_icons/'; + $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; + $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; + $admin_icon['module'] = $module_nav_icon_url . 'icon_module.gif'; + + // + // Hidden vars + // $s_hidden_fields_module = '<input type="hidden" name="mode" value="add" /><input type="hidden" name="id" value="' . $module_id . '" />'; + // + // Send to template + // $template->assign_vars(array( + 'L_TITLE' => $lang['Module_admin'], + 'L_EXPLAIN' => $lang['Module_admin_explain'], + + 'NAV_MODULE_ID' => $nav_module_id, + + // + // General + // 'L_ACTION' => $lang['Action'], 'L_DELETE' => $lang['Delete'], 'L_UNINSTALL' => $lang['Uninstall_module'], 'L_EDIT' => $lang['Edit'], + 'L_SETTING' => $lang['Settings'], 'L_ADD' => $lang['Create_module'], ! ! // ! // Module ! // 'L_CODE' => $lang['Code'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], 'L_IMPORT_PACK' => $lang['import_module_pack'], 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], + + 'L_QUICK_NAV' => $lang['Quick_nav'], + + 'IMG_URL_CONTRACT' => $admin_icon['contract'], + 'IMG_URL_EXPAND' => $admin_icon['expand'], + 'IMG_ICON_MODULE' => $admin_icon['module'], 'S_HIDDEN_FIELDS_MODULE' => $s_hidden_fields_module, ! 'S_SUBMIT' => $lang['Update'], ! ! // ! // Cookies ! // ! 'COOKIE_NAME' => $board_config['cookie_name'], ! 'COOKIE_PATH' => $board_config['cookie_path'], ! 'COOKIE_DOMAIN' => $board_config['cookie_domain'], ! 'COOKIE_SECURE' => $board_config['cookie_secure'], ! 'S_ACTION' => append_sid("admin_mx_module.$phpEx") )); // ! // ---------------------------------------------------------------------------------- Modules // ! // Display list of Modules --------------------------------------------------------------- ! // --------------------------------------------------------------------------------------- ! // ! // Get current/active module ! // ! $sql = "SELECT * ! FROM " . MODULE_TABLE . " ! WHERE module_id = '" . $nav_module_id . "' ! ORDER BY module_name ASC"; ! if( !($q_modules_current = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } ! $module_rows_current = array(); ! $module_rows_current = $db->sql_fetchrowset($q_modules_current); ! // ! // Get the rest modules ! // ! ! $sql = "SELECT * ! FROM " . MODULE_TABLE . " ! WHERE module_id <> '" . $nav_module_id . "' ! ORDER BY module_name ASC"; ! ! if( !($q_modules = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } ! ! $module_rows = array(); ! if( $total_modules = $db->sql_numrows($q_modules) ) ! { ! $module_rows = $db->sql_fetchrowset($q_modules); ! } ! ! if ( $total_modules == 0 ) ! { ! $template->assign_block_vars('nomodule', array( ! 'NONE' => $lang['No_modules'] ! )); ! } ! ! $module_rows = array_merge($module_rows_current, $module_rows); // ! // Setup an additional var for the quick nav dropdown // ! $module_rows_select = array(); ! ! // ! // Loop through the rows of modules setting block vars for the template. ! // ! for( $module_count = -1; $module_count < $total_modules + 1; $module_count++ ) { ! // ! // Give main vars specific names ! // ! $new_module = $module_count == -1; ! ! $newmode = $new_module ? 'add' : 'modify'; ! $module_id = $new_module ? '0' : $module_rows[$module_count]['module_id']; ! $mode = MX_MODULE_TYPE; ! $action = $new_module ? MX_DO_INSERT : MX_DO_UPDATE; ! ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $module_id; ! $upgrademode = '?mode=' . $mode . '&action=' . MX_DO_UPGRADE . '&id=' . $module_id; ! $exportmode = '?mode=' . $mode . '&action=' . MX_DO_EXPORT . '&id=' . $module_id; ! ! $settingmode = '?module_id=' . $module_id; ! ! // ! // Hidden fields ! // ! $s_hidden_module_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> ! <input type="hidden" name="action" value="' . $action . '" /> ! <input type="hidden" name="id" value="' . $module_id . '" /> ! <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! ! $is_current_module = $module_id == $nav_module_id; ! $module_rows_select[$module_id] = $module_rows[$module_count]['module_name']; ! ! $check_opt = ''; ! if( $module_rows[$module_count]['module_include_admin'] == 1 ) ! { ! $check_opt = 'checked="checked"'; ! } ! ! $message_uninstall = $lang['Module_delete'] ! . '<br /><br />' . sprintf($lang['Click_module_delete_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $deletemode) . '">', '</a>') ! . '<br /><br />'; ! ! $message_upgrade = $lang['upgrade_module_pack_explain'] ! . '<br /><br />' . sprintf($lang['Click_module_upgrade_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $upgrademode) . '">', '</a>') ! . '<br /><br />'; ! ! $message_export = $lang['export_module_pack_explain'] ! . '<br /><br />' . sprintf($lang['Click_module_export_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $exportmode) . '">', '</a>') ! . '<br /><br />'; ! ! // ! // Module subpanel - edit ! // ! $visible = in_array('adminModule_' . $module_id, $cookie_states); ! $visible_upgrade = in_array('adminModuleUpgrade_' . $module_id, $cookie_states); ! $visible_export = in_array('adminModuleExport_' . $module_id, $cookie_states); ! $visible_uninstall = in_array('adminModuleDelete_' . $module_id, $cookie_states); ! ! $template->assign_block_vars('module', array( ! 'L_TITLE' => $new_module ? $lang['Create_module'] : $lang['Edit_module'], ! 'L_MODULE' => $lang['Module'], ! 'VISIBLE' => $visible ? 'block' : 'none', ! 'VISIBLE_UPGRADE' => $visible_upgrade ? 'block' : 'none', ! 'VISIBLE_EXPORT' => $visible_export ? 'block' : 'none', ! 'VISIBLE_DELETE' => $visible_uninstall ? 'block' : 'none', ! ! 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_UPGRADE' => $visible_upgrade ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_EXPORT' => $visible_export ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_DELETE' => $visible_uninstall ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! ! 'U_MODULE' => append_sid("admin_mx_module_cp.$phpEx" . $settingmode), ! ! 'MODULE_ID' => $module_id, ! 'MODULE_TITLE' => $new_module ? $lang['Create_module'] : $module_rows[$module_count]['module_name'], ! 'MODULE_DESCRIPTION' => ( $module_rows[$module_count]['module_desc'] != '' ) ? ' - ' . $module_rows[$module_count]['module_desc'] : '', ! 'MODULE_VERSION' => ( $module_rows[$module_count]['module_version'] != '' ) ? '- ' . $module_rows[$module_count]['module_version'] : '', ! ! // Module subpanel - edit ! 'E_MODULE_NAME' => $module_rows[$module_count]['module_name'], ! 'E_MODULE_DESC' => $module_rows[$module_count]['module_desc'], ! 'E_MODULE_PATH' => $module_rows[$module_count]['module_path'], ! 'E_MODULE_INCLUDE_CHECK_OPT' => $check_opt, ! ! // Quick Panels ! 'MESSAGE_UPGRADE' => $message_upgrade, ! 'MESSAGE_EXPORT' => $message_export, ! 'MESSAGE_DELETE' => $message_uninstall, ! ! 'S_SUBMIT' => $new_module ? $lang['Create_module'] : $lang['Update'], ! ! 'S_HIDDEN_FIELDS' => $s_hidden_module_fields )); + + if (!$new_module) + { + $template->assign_block_vars('module.settings', array()); + } + + } // + // Create quick nav box + // + + $module_select_box = get_list_static('module_id', $module_rows_select, $nav_module_id, false); + + $template->assign_vars(array( + 'MODULE_SELECT_B... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:19:23
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797 Modified Files: common.php index.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** common.php 1 May 2005 16:13:59 -0000 1.34 --- common.php 20 Aug 2005 18:19:11 -0000 1.35 *************** *** 218,223 **** include_once($mx_root_path . 'includes/mx_functions.' . $phpEx); include_once($mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_auth.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_cache.' . $phpEx); --- 218,223 ---- include_once($mx_root_path . 'includes/mx_functions.' . $phpEx); include_once($mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_functions_auth.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_functions_core.' . $phpEx); *************** *** 320,323 **** mx_message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); } - ?> \ No newline at end of file --- 320,322 ---- Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/index.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** index.php 1 May 2005 16:14:00 -0000 1.37 --- index.php 20 Aug 2005 18:19:11 -0000 1.38 *************** *** 265,272 **** if ( $mx_dynamic_block->dynamic_block_id > 0 ) { ! $mx_dynamic_block->output_cp( $edit_on ); } ! $mx_block->output_cp( $edit_on ); // --- 265,272 ---- if ( $mx_dynamic_block->dynamic_block_id > 0 ) { ! $mx_dynamic_block->output_cp_button( $edit_on ); } ! $mx_block->output_cp_button( $edit_on ); // *************** *** 342,346 **** if ( $mx_parent_block->is_sub ) { ! $mx_parent_block->erase(); } } --- 342,346 ---- if ( $mx_parent_block->is_sub ) { ! $mx_parent_block->kill_me(); } } |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:15:44
|
Update of /cvsroot/mxbb/core/modules/mx_textblocks/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21248/admin Log Message: Directory /cvsroot/mxbb/core/modules/mx_textblocks/templates/subSilver/admin added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:12:27
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20526/admin Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/templates/subSilver/admin added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:12:07
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20476/subSilver Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/templates/subSilver added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:11:39
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20367/lang_english Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/language/lang_english added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:11:14
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254/admin Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/admin added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:11:14
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254/templates Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/templates added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:11:14
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254/language Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu/language added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:10:45
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20153/mx_navmenu Log Message: Directory /cvsroot/mxbb/core/modules/mx_navmenu added to the repository |
|
From: Jon O. <jon...@us...> - 2005-08-20 18:06:27
|
Update of /cvsroot/mxbb/core/modules/mx_ajax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19212/mx_ajax Log Message: Directory /cvsroot/mxbb/core/modules/mx_ajax added to the repository |
|
From: Jon O. <jon...@us...> - 2005-05-26 21:54:48
|
Update of /cvsroot/mxbb/core27x/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4750/core27x/admin Modified Files: admin_mx_gen_cache.php admin_mx_menu.php pagestart.php Removed Files: admin_mx_block_edit.php Log Message: massive commit, for 2.7.7 http://www.mx-system.com/forum/viewtopic.php?t=6902 Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core27x/admin/pagestart.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pagestart.php 6 May 2005 06:47:56 -0000 1.1 --- pagestart.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 53,57 **** if ($HTTP_GET_VARS['sid'] != $userdata['session_id']) { ! mx_redirect(PORTAL_URL . "admin/index.$phpEx?sid=" . $userdata['session_id']); } --- 53,58 ---- if ($HTTP_GET_VARS['sid'] != $userdata['session_id']) { ! //mx_redirect(PORTAL_URL . "admin/index.$phpEx?sid=" . $userdata['session_id']); ! mx_redirect("admin/index.$phpEx?sid=" . $userdata['session_id']); } Index: admin_mx_gen_cache.php =================================================================== RCS file: /cvsroot/mxbb/core27x/admin/admin_mx_gen_cache.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_mx_gen_cache.php 6 May 2005 06:47:56 -0000 1.1 --- admin_mx_gen_cache.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 10,15 **** * ***************************************************************************/ - $no_page_header = TRUE; - if( !empty($setmodules) ) { --- 10,13 ---- *************** *** 18,30 **** } define('IN_PORTAL', 1); ! $mx_root_path = '../'; ! ! // Security and page header - require('./pagestart.php'); // Getting mode of operation ! $generate = ( $mx_request_vars->request('generate', MX_TYPE_INT, 0) == 1 ? true : false ); --- 16,32 ---- } + // + // Security and Page header + // define('IN_PORTAL', 1); ! $mx_root_path = './../'; ! require($mx_root_path . 'extension.inc'); ! $no_page_header = TRUE; ! require('./pagestart.' . $phpEx); + // // Getting mode of operation ! // $generate = ( $mx_request_vars->request('generate', MX_TYPE_INT, 0) == 1 ? true : false ); *************** *** 36,42 **** ); // Main procedure ! ! if ( !$generate ) { $message = $lang['Cache_explain'] . '<br /> <br /> <br />'; --- 38,45 ---- ); + // // Main procedure ! // ! if( !$generate ) { $message = $lang['Cache_explain'] . '<br /> <br /> <br />'; *************** *** 48,96 **** else { ! ! $cache_dir = $mx_root_path . 'cache/'; ! include($cache_dir . "mx_cache.$phpEx"); ! ! @mkdir($cache_dir, 0777); ! @chmod($cache_dir, 0777); ! ! if ( !is_writable($cache_dir) ) ! { ! $message = $lang['Cache_dir_write_protect']; ! mx_message_die(GENERAL_MESSAGE, $message, ''); ! exit; ! } ! ! $sql = "SELECT blk.block_id ! , blk.block_title ! , blk.block_desc ! , blk.function_id ! , blk.auth_view ! , blk.auth_edit ! , blk.auth_delete ! , blk.auth_view_group ! , blk.auth_edit_group ! FROM " . BLOCK_TABLE . " blk ! ORDER BY blk.block_id"; ! ! db2xml($sql, $cache_dir. "block_config.xml"); ! ! $sql = "SELECT sys.parameter_id ! , sys.block_id ! , par.parameter_name ! , sys.parameter_value ! , sys.bbcode_uid ! FROM " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . PARAMETER_TABLE . " par ! WHERE sys.parameter_id = par.parameter_id ! ORDER BY sys.block_id, sys.parameter_id"; ! ! db2xml($sql, $cache_dir. "block_config_param.xml"); ! ! // ! // Unset all session variables, so it will force ! // loading all cached data to the admin session. ! // ! @session_unset(); $message = $lang['Cache_generate']; --- 51,56 ---- else { ! // Update mxBB cache ! $mx_cache->update( ); $message = $lang['Cache_generate']; Index: admin_mx_menu.php =================================================================== RCS file: /cvsroot/mxbb/core27x/admin/admin_mx_menu.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_mx_menu.php 6 May 2005 06:47:56 -0000 1.1 --- admin_mx_menu.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 37,41 **** if ( !empty($HTTP_POST_VARS['block_id']) || !empty($HTTP_GET_VARS['block_id']) ) { ! $block_id = ( !empty($HTTP_POST_VARS['block_id']) ) ? $HTTP_POST_VARS['block_id'] : $HTTP_GET_VARS['block_id']; } else --- 37,41 ---- if ( !empty($HTTP_POST_VARS['block_id']) || !empty($HTTP_GET_VARS['block_id']) ) { ! $block_id = isset($HTTP_GET_VARS['block_id']) ? intval($HTTP_GET_VARS['block_id']) : intval($HTTP_POST_VARS['block_id']); } else --- admin_mx_block_edit.php DELETED --- |
|
From: Jon O. <jon...@us...> - 2005-05-26 21:54:21
|
Update of /cvsroot/mxbb/core27x/modules/mx_textblocks/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4750/core27x/modules/mx_textblocks/admin Modified Files: admin_edit.php mx_textblock_edit.php Log Message: massive commit, for 2.7.7 http://www.mx-system.com/forum/viewtopic.php?t=6902 Index: admin_edit.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_textblocks/admin/admin_edit.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_edit.php 6 May 2005 06:48:10 -0000 1.1 --- admin_edit.php 26 May 2005 21:54:09 -0000 1.2 *************** *** 1,32 **** <?php ! /*************************************************************************** ! * mx_block_edit.php ! * ------------------- ! * begin : December, 2002 ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * ! * $Id$ ! * ! ***************************************************************************/ $no_page_header = TRUE; ! if( !empty($setmodules) ) { ! return; } ! define('IN_PORTAL', 1); ! $mx_root_path = '../../../'; // ! // Security and page header // ! require( $mx_root_path . 'admin/pagestart.php'); ! mx_message_die(GENERAL_MESSAGE, 'Sorry, but this block is NOT designed to be configured in the AdminCP <br /> - please use the EDIT feature in normal portal mode instead.'); ! include_once($mx_root_path . 'admin/page_footer_admin.'.$phpEx); ?> \ No newline at end of file --- 1,619 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! */ ! ! define('IN_PORTAL', 1); ! $mx_root_path = './../../../'; ! $module_root_path = './../'; $no_page_header = TRUE; + include_once($mx_root_path . 'extension.inc'); + include_once($mx_root_path . 'common.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_post.'.$phpEx); ! // ! // Start session management ! // ! $userdata = session_pagestart($user_ip, PAGE_INDEX); ! mx_init_userprefs($userdata); ! // ! // End session management ! // ! ! // ! // Mode setting ! // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); ! } ! else ! { ! $mode = ''; } ! // ! // Initial vars ! // ! $block_id = isset($HTTP_GET_VARS['block_id']) ? intval($HTTP_GET_VARS['block_id']) : intval($HTTP_POST_VARS['block_id']); ! $portalpage = isset($HTTP_GET_VARS['portalpage']) ? intval($HTTP_GET_VARS['portalpage'] ) : intval($HTTP_POST_VARS['portalpage']); ! $block_mode = isset($HTTP_GET_VARS['block_mode']) ? $HTTP_GET_VARS['block_mode'] : $HTTP_POST_VARS['block_mode']; ! ! ! $s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $portalpage . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="sub_id" value="' . $sub_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="u" value="' . $blog_u . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="blog_mode" value="' . $blog_mode . '" />'; // ! // Setup config parameters // ! $block_config = read_block_config( $block_id ); ! // ********************************************************************** ! // Read language definition ! // ********************************************************************** ! if( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) ! { ! include($module_root_path . 'language/lang_english/lang_main.' . $phpEx); ! } ! else ! { ! include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); ! } ! // ! // Parameters ! // ! $submit = ( isset($HTTP_POST_VARS['post']) ) ? true : false; ! $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; ! $preview = ( isset($HTTP_POST_VARS['preview']) ) ? true : false; ! $refresh = $preview || $submit_search; ! ! // ! // Cancel ! // ! if( $cancel ) ! { ! $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; ! header($header_location . append_sid(PORTAL_URL . "index.$phpEx?page=" . $portalpage, true)); ! exit; ! } ! ! $error = false; ! ! // ! // Define all config data ! // ! ! // ! // Main parameters ! // ! if( isset($block_config[$block_id]['Html']['parameter_value']) ) ! { ! // ! // Html Textblock ! // ! $block_text_par = 'Html'; ! $mode = 'edithtml'; ! $bbcode_on = false; ! $html_on = true; ! $smilies_on = false; ! ! $html_entities_match = array(); ! $html_entities_replace = array(); ! ! // ! // This switch is for enabling the wysiwyg html editor addon "tiny mce". to disable this feature ! // either remove this section or delete the modules/tinymce folder ! // ! if ( file_exists( $mx_root_path . 'modules/tinymce/jscripts/tiny_mce/blank.htm' ) ) ! { ! $template->assign_block_vars( "tinyMCE", array() ); ! } ! ! } ! else if( isset($block_config[$block_id]['Text']['parameter_value']) ) ! { ! // ! // Multi, phpBB, Blog Textblock ! // ! $block_text_par = isset( $block_config[$block_id]['Blog']['parameter_value'] ) ? "Blog" : "Text"; ! $mode = isset( $block_config[$block_id]['Blog']['parameter_value'] ) ? "editblog" : "edit"; ! ! if ($block_mode == 'bbcode') ! { ! $bbcode_on = true; ! $html_on = false; ! $smilies_on = true; ! } ! else ! { ! $bbcode_on = $board_config['allow_bbcode'] ? true : false; ! $html_on = $board_config['allow_html'] ? true : false; ! $smilies_on = $board_config['allow_smilies'] ? true : false; ! } ! } ! else ! { ! $block_text_par = ''; ! $mode = 'edit'; ! } ! ! // ! // Main parameters ! // ! $block_title_par = 'block_title'; ! $block_desc_par = 'block_desc'; ! ! // ! // Style parameters ! // ! $block_style_par = 'block_style'; ! $text_style_par = 'text_style'; ! $title_style_par = 'title_style'; ! ! $text_style_options = array(); ! $text_style_options = array('none', 'gen', 'gensmall', 'genmed', 'genlarge', 'postbody'); ! ! $new_vars = array(); ! $new_vars = array($block_text_par, $block_style_par, $text_style_par, $title_style_par); ! ! $new = array(); ! ! // ! // Extract info - main loop ! // ! for( $j = 0; $j < count( $new_vars ); $j++ ) ! { ! $new[$new_vars[$j]] = ( isset($HTTP_POST_VARS[$new_vars[$j]]) ) ? $HTTP_POST_VARS[$new_vars[$j]] : $block_config[$block_id][$new_vars[$j]]['parameter_value']; ! $parameter_id = $block_config[$block_id][$new_vars[$j]]['parameter_id']; ! ! if( $submit ) ! { ! if( empty($new[$new_vars[$j]]) || ( $new_vars[$j] == $blog_id_par && $sub_id > 0 ) ) ! { ! $error = true; ! } ! else ! { ! if( $new_vars[$j] == $block_text_par ) ! { ! if( $bbcode_on ) ! { ! $bbcode_uid = make_bbcode_uid(); ! } ! //Format the input: ! $new[$new_vars[$j]] = prepare_message(trim($new[$new_vars[$j]]), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); ! } ! ! if( $block_config[$block_id][$new_vars[$j]]['sub_id'] == $sub_id ) ! { ! // ! // Note: is str_replace really needed here ?? ! // ! $sql = "UPDATE " . BLOCK_SYSTEM_PARAMETER_TABLE . " ! SET parameter_value = '" . str_replace("\'", "''", $new[$new_vars[$j]]) . "', ! bbcode_uid = '$bbcode_uid' ! WHERE block_id = '$block_id' ! AND parameter_id = '$parameter_id'"; ! ! if( !($db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not update textblock information.", "", __LINE__, __FILE__, $sql); ! } ! ! } ! else ! { ! $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . "(block_id, parameter_id, parameter_value, bbcode_uid) ! VALUES('$block_id','$parameter_id','" . str_replace("\'", "''", $new[$new_vars[$j]]) . "','$bbcode_uid')"; ! if( !($db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Couldnt insert comments', '', __LINE__, __FILE__, $sql); ! } ! } ! ! } ! } ! } ! ! // ! // For title, cache and submit ! // ! if( $submit ) ! { ! if( $sub_id == 0 ) ! { ! $block_title = ( isset($HTTP_POST_VARS['block_title']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['block_title'])) : $block_config[$block_id]['block_title']; ! $block_desc = htmlspecialchars(trim($HTTP_POST_VARS['block_desc'])); ! ! $sql = "UPDATE " . BLOCK_TABLE . " ! SET block_title = '" . str_replace("\'", "''", $block_title) . "', ! block_desc = '" . str_replace("\'", "''", $block_desc) . "' ! 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); ! ! $template->assign_vars(array( ! 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(PORTAL_URL . "index.$phpEx?page=" . $portalpage) . '">') ! ); ! ! if( !empty($portalpage) ) ! { ! $page_title = $lang['Block_admin']; ! $blog_return = $blog_u > 0 ? "&u=" . $blog_u : ( $sub_id > 0 ? "&g=" . $sub_id : '' ); ! $msg = $lang['Block_Config_updated'] . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?page=" . $portalpage . $blog_return) . '">', '</a>'); ! } ! else ! { ! $msg = $lang['Block_Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(PORTAL_URL . "admin/admin_mx_block.php") . '">', '</a>'); ! } ! mx_message_die(GENERAL_MESSAGE, $msg); ! } ! ! // ! // Main ------------------------------------- ! // ! ! // ! // First (re)declare basic variables ! // ! $block_title = ( isset($HTTP_POST_VARS[$block_title_par]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[$block_title_par]))) : $block_config[$block_id][$block_title_par]; ! $block_desc = ( isset($HTTP_POST_VARS[$block_desc_par]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[$block_desc_par]))) : $block_config[$block_id][$block_desc_par]; ! $block_text = ( isset($HTTP_POST_VARS[$block_text_par]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[$block_text_par]))) : $block_config[$block_id][$block_text_par]['parameter_value']; ! ! $blog_id = trim(stripslashes($new[$blog_id_par])); ! ! // ! // Style parameters ! // ! $block_style_yes = ( $new[$block_style_par] == 'TRUE' ) ? 'checked="checked"' : ''; ! $block_style_no = ( !( $new[$block_style_par] == 'TRUE' ) ) ? 'checked="checked"' : ''; ! ! $text_style_list = '<select name="text_style">'; ! for( $j = 0; $j < count($text_style_options); $j++ ) ! { ! $selected = ( $new[$text_style_par] == $text_style_options[$j] ) ? ' selected="selected"' : ''; ! $text_style_list .= '<option value="' . $text_style_options[$j] . '"' . $selected . '>' . $text_style_options[$j] . "</option>\n"; ! } ! $text_style_list .= '</select>'; ! ! $text_style_yes = ( $new[$text_style_par] == 'TRUE' ) ? 'checked="checked"' : ''; ! $text_style_no = ( !( $new[$text_style_par] == 'TRUE' ) ) ? 'checked="checked"' : ''; ! ! $title_style_yes = ( $new[$title_style_par] == 'TRUE' ) ? 'checked="checked"' : ''; ! $title_style_no = ( !( $new[$title_style_par] == 'TRUE' ) ) ? 'checked="checked"' : ''; ! ! ! // ! // Main parameters ! // ! $show_block = ( isset($HTTP_POST_VARS[$show_block_par]) ) ? intval($HTTP_POST_VARS[$show_block_par]) : $block_config[$block_id][$show_block_par]['parameter_value']; ! $show_title = ( isset($HTTP_POST_VARS[$show_title_par]) ) ? intval($HTTP_POST_VARS[$show_title_par]) : $block_config[$block_id][$show_title_par]['parameter_value']; ! $show_stats = ( isset($HTTP_POST_VARS[$show_stats_par]) ) ? intval($HTTP_POST_VARS[$show_stats_par]) : $block_config[$block_id][$show_stats_par]['parameter_value']; ! ! $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; ! $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; ! ! $show_block_yes = ( $show_block == 1 ) ? 'checked="checked"' : ''; ! $show_block_no = ( $show_block == 0 ) ? 'checked="checked"' : ''; ! ! $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; ! $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; ! ! // ! // Start output, first preview, then errors then post form ! // ! $page_title = $block_title; ! ! $template->assign_block_vars('switch_view', array()); ! ! if( !empty($portalpage) ) ! { ! $page_title = $lang['Block_admin']; ! include_once($mx_root_path . 'includes/page_header.' . $phpEx); ! } ! else ! { ! include_once($mx_root_path . 'admin/page_header_admin.' . $phpEx); ! } ! ! // -------------------------------------------------------- ! // Previews Layout ! // -------------------------------------------------------- ! if( $preview && !$error ) ! { ! $preview_title = $block_title; ! $preview_text = $block_text; ! ! $orig_word = array(); ! $replacement_word = array(); ! obtain_word_list($orig_word, $replacement_word); ! ! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; ! $preview_text = stripslashes(prepare_message(addslashes(unprepare_message($preview_text)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); ! ! if( $bbcode_on ) ! { ! $preview_text = bbencode_second_pass($preview_text, $bbcode_uid); ! } ! ! if( count($orig_word) ) ! { ! $preview_title = preg_replace($orig_word, $replacement_word, $preview_title); ! $preview_text = preg_replace($orig_word, $replacement_word, $preview_text); ! } ! ! if( $smilies_on ) ! { ! $preview_text = mx_smilies_pass($preview_text); ! } ! ! $preview_text = make_clickable($preview_text); ! ! $preview_text = str_replace("\n", '<br />', $preview_text); ! ! $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $portalpage . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="sub_id" value="' . $sub_id . '" />'; ! ! $template->set_filenames(array( ! 'preview' => 'mx_textblock_preview.tpl') ! ); ! ! $template->assign_vars(array( ! 'BLOCK_TITLE' => $preview_title, ! 'BLOCK_INFO' => $preview_text, ! ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! ! 'L_BLOCK_TITLE' => $lang['Block_Title'], ! 'L_PREVIEW' => $lang['Preview'] ! )); ! ! $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview'); ! } ! else ! { ! $bbcode_uid = $block_config[$block_id][$block_text_par]['bbcode_uid']; ! ! if( $bbcode_uid != '' ) ! { ! $block_text = preg_replace('/\:(([a-z0-9]:)?)' . $bbcode_uid . '/s', '', $block_text); ! } ! ! $block_text = str_replace('<', '<', $block_text); ! $block_text = str_replace('>', '>', $block_text); ! $block_text = str_replace('<br />', "\n", $block_text); ! } ! ! // -------------------------------------------------------- ! // Default Layout ! // -------------------------------------------------------- ! $template->set_filenames(array( ! 'body' => ( $mode == 'editblog' ? 'mx_textblock_editblog.tpl' : 'mx_textblock_edit.tpl' )) ! ); ! ! // ! // HTML, BBCode & Smilies toggle selection ! // ! $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; ! $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; ! $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; ! ! // ! // Send smilies to template ! // ! if( $smilies_on ) ! { ! mx_generate_smilies('inline', PAGE_INDEX); ! } ! ! if( $mode == 'edit' ) ! { ! $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edit"; ! } ! elseif( $mode == 'edithtml' ) ! { ! $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edithtml"; ! } ! elseif( $mode == 'editblog' ) ! { ! $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=editblog"; ! } ! else ! { ! $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx"; ! } ! ! if( $bbcode_on ) ! { ! $template->assign_block_vars('switch_bbcodes', array()); ! } ! ! if( $sub_id == 0 ) ! { ! $template->assign_block_vars('titles_row', array()); ! } ! ! // ! // For Multi block ! // ! if( !empty($new[$text_style_par]) ) ! { ! $template->assign_block_vars('switch_text_style', array()); ! $template->assign_block_vars('switch_block_style', array()); ! $template->assign_block_vars('switch_title_style', array()); ! } ! ! $template->assign_vars(array( ! 'L_TITLE' => $lang['Block_admin'], ! 'L_EXPLAIN' => $lang['Block_admin_explain'], ! //'BLOCK_TITLE' => $block_title, ! ! 'HTML_STATUS' => $html_status, ! 'BBCODE_STATUS' => $bbcode_status, ! 'SMILIES_STATUS' => $smilies_status, ! ! 'BLOCK_TEXT_NAME' => $block_text_par, ! ! 'L_BLOCK_STYLE' => $lang['Block_Style'], ! 'L_TEXT_STYLE' => $lang['Text_Style'], ! 'L_TITLE_STYLE' => $lang['Title_Style'], ! ! 'L_ALLOW_SMILIES' => $lang['Allow_smilies'], ! 'L_ALLOW_HTML' => $lang['Allow_HTML'], ! 'L_ALLOW_BBCODE' => $lang['Allow_BBCode'], ! 'L_HTML_TAGS' => $lang['Allowed_tags'], ! ! 'L_YES' => $lang['Yes'], ! 'L_NO' => $lang['No'], ! ! 'L_BLOCK_STYLE_EXPLAIN' => $lang['Block_Style_Explain'], ! 'L_TEXT_STYLE_EXPLAIN' => $lang['Text_Style_Explain'], ! 'L_TITLE_STYLE_EXPLAIN' => $lang['Title_Style_Explain'], ! ! 'L_BLOCK_TITLE' => $lang['Block_Title'], ! 'L_BLOCK_INFO' => $lang['Block_Info'], ! 'L_OPTIONS' => $lang['Options'], ! 'L_PREVIEW' => $lang['Preview'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_CANCEL' => $lang['Cancel'], ! 'L_DISABLE_HTML' => $lang['Disable_HTML_pm'], ! 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_pm'], ! 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_pm'], ! 'L_ATTACH_SIGNATURE' => $lang['Attach_signature'], ! ! 'L_BLOG_ID' => $lang['Blog_id'], ! 'BLOG_ID' => $blog_id, ! ! 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], ! 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], ! 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], ! 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], ! 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], ! 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], ! 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], ! 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], ! 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], ! 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], ! 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], ! 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], ! 'L_EMPTY_MESSAGE' => $lang['Empty_message'], ! ! 'L_FONT_COLOR' => $lang['Font_color'], ! 'L_COLOR_DEFAULT' => $lang['color_default'], ! 'L_COLOR_DARK_RED' => $lang['color_dark_red'], ! 'L_COLOR_RED' => $lang['color_red'], ! 'L_COLOR_ORANGE' => $lang['color_orange'], ! 'L_COLOR_BROWN' => $lang['color_brown'], ! 'L_COLOR_YELLOW' => $lang['color_yellow'], ! 'L_COLOR_GREEN' => $lang['color_green'], ! 'L_COLOR_OLIVE' => $lang['color_olive'], ! 'L_COLOR_CYAN' => $lang['color_cyan'], ! 'L_COLOR_BLUE' => $lang['color_blue'], ! 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], ! 'L_COLOR_INDIGO' => $lang['color_indigo'], ! 'L_COLOR_VIOLET' => $lang['color_violet'], ! 'L_COLOR_WHITE' => $lang['color_white'], ! 'L_COLOR_BLACK' => $lang['color_black'], ! ! 'L_FONT_SIZE' => $lang['Font_size'], ! 'L_FONT_TINY' => $lang['font_tiny'], ! 'L_FONT_SMALL' => $lang['font_small'], ! 'L_FONT_NORMAL' => $lang['font_normal'], ! 'L_FONT_LARGE' => $lang['font_large'], ! 'L_FONT_HUGE' => $lang['font_huge'], ! ! 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'], ! ! 'S_HTML_CHECKED' => ( !$html_on ) ? ' checked="checked"' : '', ! 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? ' checked="checked"' : '', ! 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? ' checked="checked"' : '', ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields, ! 'S_POST_ACTION' => append_sid( "$POST_ACTION" ), ! ! 'S_BLOCK_STYLE_YES' => $block_style_yes, ! 'S_BLOCK_STYLE_NO' => $block_style_no, ! ! 'S_TEXT_STYLE' => $text_style_list, ! ! 'S_TITLE_STYLE_YES' => $title_style_yes, ! 'S_TITLE_STYLE_NO' => $title_style_no, ! ! 'S_ALLOW_BBCODE_YES' => $allow_bbcode_yes, ! 'S_ALLOW_BBCODE_NO' => $allow_bbcode_no, ! ! 'S_ALLOW_HTML_YES' => $allow_html_yes, ! 'S_ALLOW_HTML_NO' => $allow_html_no, ! ! 'S_ALLOW_SMILIES_YES' => $allow_smilies_yes, ! 'S_ALLOW_SMILIES_NO' => $allow_smilies_no, ! ! 'S_HTML_TAGS' => $textblock_allowed_html_tags, ! ! 'L_BLOCK_TITLE' => $lang['Block_title'], ! 'L_BLOCK_DESC' => $lang['Block_desc'], ! 'L_SHOW_BLOCK' => $lang['Show_block'], ! 'L_SHOW_TITLE' => $lang['Show_title'], ! 'L_SHOW_STATS' => $lang['Show_stats'], ! ! 'E_BLOCK_TITLE' => $block_title, ! 'E_BLOCK_DESC' => $block_desc, ! 'BLOCK_INFO' => $block_text, ! ! 'S_SHOW_BLOCK_YES' => $show_block_yes, ! 'S_SHOW_BLOCK_NO' => $show_block_no, ! ! 'S_SHOW_TITLE_YES' => $show_title_yes, ! 'S_SHOW_TITLE_NO' => $show_title_no, ! ! 'S_SHOW_STATS_YES' => $show_stats_yes, ! 'S_SHOW_STATS_NO' => $show_stats_no, ! ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL ! )); ! ! $template->pparse('body'); ! ! if( !empty($portalpage) ) ! { ! $page_title = $lang['Block_admin']; ! include($mx_root_path . 'includes/page_tail.' . $phpEx); ! } ! else ! { ! include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx); ! } ?> \ No newline at end of file Index: mx_textblock_edit.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_textblocks/admin/mx_textblock_edit.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_textblock_edit.php 6 May 2005 06:48:10 -0000 1.1 --- mx_textblock_edit.php 26 May 2005 21:54:09 -0000 1.2 *************** *** 1,18 **** <?php ! /*************************************************************************** ! * mx_textblocks_edit.php ! * ------------------- ! * begin : Monday, Mar 31, 2003 ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... ! * ! * $Id$ ! * [...1089 lines suppressed...] ! 'S_SHOW_STATS_YES' => $show_stats_yes, ! 'S_SHOW_STATS_NO' => $show_stats_no, ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL ! )); ! ! $template->pparse('body'); ! ! if( !empty($portalpage) ) ! { ! $page_title = $lang['Block_admin']; ! include($mx_root_path . 'includes/page_tail.' . $phpEx); ! } ! else ! { ! include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx); ! } ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2005-05-26 21:54:21
|
Update of /cvsroot/mxbb/core27x/cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4750/core27x/cache Removed Files: mx_cache.php Log Message: massive commit, for 2.7.7 http://www.mx-system.com/forum/viewtopic.php?t=6902 --- mx_cache.php DELETED --- |