[wp-cvs] wordpress/wp-admin admin-functions.php, 1.56,
1.57 menu-header.php, 1.1, 1.2
Ryan Boren
rboren at users.sourceforge.net
Fri Nov 26 01:50:39 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18852/wp-admin
Modified Files:
admin-functions.php menu-header.php
Log Message:
add_menu_page(), add_submenu_page(), add_management_page().
Index: admin-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** admin-functions.php 24 Nov 2004 00:12:45 -0000 1.56
--- admin-functions.php 26 Nov 2004 01:50:36 -0000 1.57
***************
*** 733,744 ****
}
! function add_options_page($page_title, $menu_title, $access_level, $file) {
global $submenu;
$file = basename($file);
! $submenu['options-general.php'][] = array($menu_title, $access_level, $file, $page_title);
}
function validate_file_to_edit($file, $allowed_files = '') {
--- 733,759 ----
}
! function add_menu_page($page_title, $menu_title, $access_level, $file) {
! global $menu;
!
! $file = basename($file);
!
! $menu[] = array($menu_title, $access_level, $file, $page_title);
! }
!
! function add_submenu_page($parent, $page_title, $menu_title, $access_level, $file) {
global $submenu;
$file = basename($file);
! $submenu[$parent][] = array($menu_title, $access_level, $file, $page_title);
}
+ function add_options_page($page_title, $menu_title, $access_level, $file) {
+ add_submenu_page('options-general.php', $page_title, $menu_title, $access_level, $file);
+ }
+
+ function add_management_page($page_title, $menu_title, $access_level, $file) {
+ add_submenu_page('edit.php', $page_title, $menu_title, $access_level, $file);
+ }
function validate_file_to_edit($file, $allowed_files = '') {
Index: menu-header.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/menu-header.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** menu-header.php 19 Oct 2004 03:03:04 -0000 1.1
--- menu-header.php 26 Nov 2004 01:50:37 -0000 1.2
***************
*** 9,23 ****
$class = '';
! // 0 = name, 1 = user_level, 2 = file
! if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
! if ($user_level >= $item[1]) {
! if (
! ('upload.php' == $item[2] &&
! get_settings('use_fileupload') &&
! ($user_level >= get_settings('fileupload_minlevel'))
! ) || 'upload.php' != $item[2])
! echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
! }
}
--- 9,27 ----
$class = '';
! // 0 = name, 1 = user_level, 2 = file
! if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
! if ($user_level >= $item[1]) {
! if (
! ('upload.php' == $item[2] &&
! get_settings('use_fileupload') &&
! ($user_level >= get_settings('fileupload_minlevel'))
! ) || 'upload.php' != $item[2]) {
! if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}"))
! echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
! else
! echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
! }
! }
}
More information about the cvs
mailing list