功能相当强大

源代码在线查看: dialog.php

软件大小: 95 K
上传用户: xiaotiao
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

								/*
				版权归原作者
				汉化:slender
				我们的目标
				做专业的blog中心!
				http://phpstu.uni.cc
				*/
				
				// Configuration
				include('config/config.php');
				
				// Authenticate
				if ( !($_SERVER['PHP_AUTH_USER']===ADMIN_USERNAME && $_SERVER['PHP_AUTH_PW']===ADMIN_PASSWORD) )
				{
					header('WWW-Authenticate: Basic realm="bd:blog"');
					header('HTTP/1.0 401 Unauthorized');
					?>
				
				
				
				Invalid user information
				
				
				
				
				
				
				  
				    Invalid user information
				  
				
				
				
										exit();
				}
				
				// Libraries
				include('lib/bdDB.php');
				include('lib/TableHandler.php');
				include('lib/CategoriesHandler.php');
				include('lib/EntriesHandler.php');
				
				$db = new bdDB( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
				
				// Handlers
				$categoriesHandler = new CategoriesHandler( $db );
				$entriesHandler = new EntriesHandler( $db );
				
				// Controls
				include('controls/DateControl.php');
				include('controls/CategoryControl.php');
				
				// register_globals
				import_request_variables('gp');
				
				switch( $_a )
				{
					case 'CategoryAdd':
						$categoriesHandler->insert( $_REQUEST );
						break;
					case 'CategoryRename':
						$categoriesHandler->update( $id, $_REQUEST );
						break;
					case 'CategoryDelete':
						$categoriesHandler->delete( $id );
						$entriesHandler->transferCategoryToUnfiled( $id );
						break;
					case 'NewEntry':
						$vars = $_POST;
						$vars['date'] = $year.'-'.$month.'-'.$day;
						$entriesHandler->insert( $vars );
						?>
						
												opener.location = 'index.php?date=--'
						window.close();
						// -->
						
												break;
					case 'UpdateEntry':
						$vars = $_POST;
						$vars['date'] = $year.'-'.$month.'-'.$day;
						$entriesHandler->update( $id, $vars );
						?>
						
												opener.location = 'index.php?date=--'
						window.close();
						// -->
						
												break;
					case 'DeleteEntry':
						$entriesHandler->delete( $id );
						?>
						
												opener.location = ''
						window.close();
						// -->
						
												break;
				}
				
				switch( $_d )
				{
					case 'EditCategories':
						include('dialogs/EditCategoriesDialog.php');
						$contents = new EditCategoriesDialog( $categoriesHandler->getList(), $referer );
						$title = 'Category Editor';
						break;
					case 'NewEntry':
						include('dialogs/NewEntryDialog.php');
						$contents = new NewEntryDialog( new CategoryControl( $categoriesHandler->getFullList(), 'category',0 , false  ) );
						$title = 'New Entry';
						break;
					case 'UpdateEntry':
						include('dialogs/UpdateEntryDialog.php');
						$info = $entriesHandler->getInfo( $id );
						$contents = new UpdateEntryDialog( new CategoryControl( $categoriesHandler->getFullList(), 'category', $info['category'] , false  ), $info, $referer );
						$title = 'Update Entry';
						break;
					case 'DeleteEntry':
						include('dialogs/DeleteEntryDialog.php');
						$contents = new DeleteEntryDialog( $entriesHandler->getInfo( $id ), $referer );
						$title = 'Delete Entry';
						break;
				}
				?>
				
				
				
				
				
				
				
								_editor_url = "3rdparty/htmlarea/";                     // URL to htmlarea files
				var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
				if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
				if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
				if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
				if (win_ie_ver >= 5.5) {
				  document.write('				  document.write(' language="Javascript1.2">');  
				} else { document.write('function editor_generate() { return false; }'); }
				// -->
				
				
				
				  
				    
				  
				
				
							

相关资源