Changeset 1705 for trunk/admin.php
- Timestamp:
- Jan 9, 2007, 12:38:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
-
Property
svn:keywords
changed from
Author Date Id Revision
toAuthor Date Id Revision Rev URL
r1700 r1705 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) 8 // | file : $ RCSfile$8 // | file : $Id$ 9 9 // | last update : $Date$ 10 10 // | last modifier : $Author$ … … 55 55 // +-----------------------------------------------------------------------+ 56 56 57 unset($page['page']); 58 59 if 60 ( 61 isset($_GET['page']) 57 if (isset($_GET['page']) 62 58 and preg_match('/^[a-z_]*$/', $_GET['page']) 63 )59 and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php')) 64 60 { 65 if 66 ( 67 (!isset($_GET['page_type']) or $_GET['page_type'] == 'standard') 68 and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php') 69 ) 70 { 71 $page['page']['type'] = 'standard'; 72 $page['page']['name'] = $_GET['page']; 73 } 74 else if 75 ( 76 (isset($_GET['page_type']) and $_GET['page_type'] == 'plugin') 77 and isset($_GET['plugin_id']) 78 and preg_match('/^[a-z_]*$/', $_GET['plugin_id']) 79 and is_file(PHPWG_PLUGINS_PATH.$_GET['plugin_id'].'/admin/'.$_GET['page'].'.php') 80 ) 81 { 82 if (function_exists('mysql_real_escape_string')) 83 { 84 $page['page']['plugin_id'] = mysql_real_escape_string($_GET['plugin_id']); 85 } 86 else 87 { 88 $page['page']['plugin_id'] = mysql_escape_string($_GET['plugin_id']); 89 } 90 91 $check_db_plugin = get_db_plugins('active', $page['page']['plugin_id']); 92 if (!empty($check_db_plugin)) 93 { 94 $page['page']['type'] = $_GET['page_type']; 95 $page['page']['name'] = $_GET['page']; 96 } 97 else 98 { 99 unset($page['page']); 100 } 101 unset($check_db_plugin); 102 } 61 $page['page'] = $_GET['page']; 103 62 } 104 105 if (!isset($page['page'])) 63 else 106 64 { 107 if (isset($_GET['page_type']) and $_GET['page_type'] == 'plugin') 108 { 109 $page['page']['type'] = 'standard'; 110 $page['page']['name'] = 'plugins'; 111 } 112 else 113 { 114 $page['page']['type'] = 'standard'; 115 $page['page']['name'] = 'intro'; 116 } 65 $page['page'] = 'intro'; 117 66 } 118 67 … … 185 134 186 135 // required before plugin page inclusion 187 trigger_action('plugin_admin_menu'); 188 189 switch($page['page']['type']) 190 { 191 case 'standard': 192 { 193 include(PHPWG_ROOT_PATH.'admin/'.$page['page']['name'].'.php'); 194 break; 195 } 196 case 'plugin': 197 { 198 include(PHPWG_PLUGINS_PATH.$page['page']['plugin_id'].'/admin/'.$page['page']['name'].'.php'); 199 break; 200 } 201 default: 202 { 203 die ("Hacking attempt!"); 204 break; 205 } 206 } 207 208 209 //------------------------------------------------------------- content display 210 $template->assign_block_vars('plugin_menu.menu_item', 136 $plugin_menu_links = array( 211 137 array( 212 138 'NAME' => l10n('admin'), … … 214 140 ) 215 141 ); 216 if ( isset($page['plugin_admin_menu']) ) 142 $plugin_menu_links = trigger_event('get_admin_plugin_menu_links', 143 $plugin_menu_links ); 144 145 146 include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php'); 147 148 //------------------------------------------------------------- content display 149 foreach ($plugin_menu_links as $menu_item) 217 150 { 218 $plug_base_url = $link_start.'plugin&section='; 219 foreach ($page['plugin_admin_menu'] as $menu) 220 { 221 $template->assign_block_vars('plugin_menu.menu_item', 222 array( 223 'NAME' => $menu['title'], 224 'URL' => $plug_base_url.$menu['uid'] 225 ) 226 ); 227 } 151 $template->assign_block_vars('plugin_menu.menu_item', $menu_item); 228 152 } 229 153 -
Property
svn:keywords
changed from
Note: See TracChangeset
for help on using the changeset viewer.