|
From: Jon O. <jon...@us...> - 2007-02-15 12:44:00
|
Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/modules/tabs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7691/bugsbt/modules/tabs Added Files: bugsbt__node.php bugsbt__tab-index.php Log Message: Ok. here we go. This is the cool new mxBB Bugtracker ;) --- NEW FILE: bugsbt__tab-index.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: bugsbt__tab-index.php,v 1.1 2007/02/15 12:43:52 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', 1 ); $mx_root_path = "./../../../../../"; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.' . $phpEx); define( 'MXBB_MODULE', true ); define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); $is_block = true; // // Page selector // $page_id = $mx_request_vars->request('page_id', MX_TYPE_INT, 0); // // Start session, user and style (template + theme) management // - populate $userdata, $lang, $theme, $images and initiate $template. // $mx_user->init($user_ip, - ( 1000 + $page_id )); // // Load and instatiate page and block classes // $mx_page = new mx_page(); $mx_page->init( $page_id ); $mx_block = new mx_block(); // // Block selector // $block_id = $mx_request_vars->request('block_id', MX_TYPE_INT, 0); // // Instatiate block // $mx_block->init( $block_id ); // // Page Auth and IP filter // if ( !$mx_page->auth_view && $userdata['session_logged_in'] ) { echo('Not authorized - 1'); return; } elseif ( !$mx_page->auth_view && !$userdata['session_logged_in'] ) { echo('Not authorized - 2'); return; } elseif ( !$mx_page->auth_ip ) { echo('Not authorized - 3'); return; } // // Page Auth and IP filter // if ( !( ( $mx_block->auth_view && $mx_block->show_block ) || $mx_block->auth_mod ) ) { echo('Not authorized - 4'); return; } // // Define $module_root_path, to be used within blocks // $module_root_path = $mx_root_path . $mx_block->module_root_path; // ------------------------------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------------------------------- // Start // ------------------------------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------------------------------- // =================================================== // Include the common file // =================================================== include_once( $module_root_path . 'bugsbt/bugsbt_common.' . $phpEx ); // =================================================== // Get mode variables, otherwise set it to the main // =================================================== $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, 'product'); // =================================================== // Is admin? // =================================================== $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; // =================================================== // if the database disabled give them a nice message // =================================================== if ( intval( $bugsbt_config['module_enable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['bugsbt_disable'] ); } // =================================================== // an array of all expected actions // =================================================== $actions = array( 'index' => 'index', 'product' => 'product', 'post' => 'post', 'add' => 'post', 'edit' => 'post', 'view' => 'view', 'update_tree' => 'update_tree', ); $mx_bugsbt->module( $actions[$mode] ); $mx_bugsbt->modules[$actions[$mode]]->main( $mode ); $template->assign_vars( array( 'U_PORTAL' => $mx_root_path, 'L_PORTAL' => "<<", 'U_KB' => append_sid( $mx_bugsbt->this_mxurl() ), 'L_KB' => $lang['bugsbt_title'] ) ); $CONFIG['encoding'] = 'iso-8859-1'; // Date in the past header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // always modified header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // HTTP/1.1 header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0 header("Pragma: no-cache"); header('Content-type: text/html; charset='.$CONFIG['encoding']); $template->pparse( 'body' ); // // load module footer // $mx_bugsbt_functions->page_footer(); ?> --- NEW FILE: bugsbt__node.php --- <?php // +--------------------------------------------------------------------+ // | DO NOT REMOVE THIS | // +--------------------------------------------------------------------+ // | node.php | // | Execute tree actions. | // +--------------------------------------------------------------------+ // | Author: Cezary Tomczak [www.gosu.pl] | // | Project: SimpleDoc | // | URL: http://gosu.pl/php/simpledoc.html | // | License: GPL | // +--------------------------------------------------------------------+ define( 'IN_PORTAL', 1 ); $mx_root_path = "./../../../../"; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.' . $phpEx); // // Page selector // $page_id = $mx_request_vars->request('page_id', MX_TYPE_INT, 0); // // Start session, user and style (template + theme) management // - populate $userdata, $lang, $theme, $images and initiate $template. // $mx_user->init($user_ip, - ( 1000 + $page_id )); // // Load and instatiate page and block classes // $mx_page = new mx_page(); $mx_page->init( $page_id ); $mx_block = new mx_block(); // // Block selector // $block_id = $mx_request_vars->request('block_id', MX_TYPE_INT, 0); // // Instatiate block // $mx_block->init( $block_id ); // // Page Auth and IP filter // if ( !$mx_page->auth_view && $userdata['session_logged_in'] ) { echo('Not authorized - 1'); return; } elseif ( !$mx_page->auth_view && !$userdata['session_logged_in'] ) { echo('Not authorized - 2'); return; } elseif ( !$mx_page->auth_ip ) { echo('Not authorized - 3'); return; } // // Page Auth and IP filter // if ( !( ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ) ) { echo('Not authorized - 4'); return; } // // Define $module_root_path, to be used within blocks // $module_root_path = $mx_root_path . $mx_block->module_root_path; // =================================================== // Include the common file // =================================================== include_once( $module_root_path . 'simpledoc/simpledoc_common.' . $phpEx ); if ($simpledoc_debug) { set_error_handler('myErrorHandler'); } else { set_error_handler('logError'); $LOGERROR = 'error.txt'; } $do = get('do'); $id = $mx_simpledoc->unicode_urldecode($mx_simpledoc_functions->fix_charset(get('id'))); $name = $mx_simpledoc->unicode_urldecode($mx_simpledoc_functions->fix_charset(get('name'))); $is_folder = get('is_folder'); switch ($do) { case 'moveUp': case 'moveDown': case 'moveLeft': case 'moveRight': case 'insert': case 'insertBefore': case 'insertAfter': case 'insertInsideAtStart': case 'insertInsideAtEnd': case 'remove': $Node = new Node($id); break; } switch ($do) { case 'moveUp': $Node->moveUp(); break; case 'moveDown': $Node->moveDown(); break; case 'moveLeft': $Node->moveLeft(); break; case 'moveRight': $Node->moveRight(); break; case 'insert': $Node->insert($name, $is_folder); break; case 'insertBefore': $Node->insertBefore($name, $is_folder); break; case 'insertAfter': $Node->insertAfter($name, $is_folder); break; case 'insertInsideAtStart': $Node->insertInsideAtStart($name, $is_folder); break; case 'insertInsideAtEnd': $Node->insertInsideAtEnd($name, $is_folder); break; case 'remove': $Node->remove(); break; default: trigger_error("node.php failed, unknown action: '$do' (query_string={$_SERVER['QUERY_STRING']})", E_USER_ERROR); break; } ?> |