Index: inc/admin/prepend.php
===================================================================
--- inc/admin/prepend.php	(revision 2721)
+++ inc/admin/prepend.php	(revision 2724)
@@ -59,4 +59,14 @@
 	}
 	return $img;
+}
+
+
+function addMenuItem($section,$desc,$adminurl,$icon,$perm) {
+	global $core,$_menu;
+	$url=$core->adminurl->get($adminurl);
+	$_menu[$section]->prependItem(
+		$desc, $url, $icon, preg_match('/'.$url.'(\?.*)?$/',
+		$_SERVER['REQUEST_URI']), $perm
+	);
 }
 
@@ -261,44 +271,31 @@
 	$_menu['Plugins']->title = __('Plugins');
 
-
-	$_menu['Blog']->prependItem(__('Blog appearance'),'blog_theme.php','images/menu/themes.png',
-		preg_match('/blog_theme.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	$url = $core->adminurl->get('admin.blog.theme');
+	addMenuItem('Blog',__('Blog appearance'),'admin.blog.theme','images/menu/themes.png',
 		$core->auth->check('admin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Blog settings'),'blog_pref.php','images/menu/blog-pref.png',
-		preg_match('/blog_pref.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Blog settings'),'admin.blog.pref','images/menu/blog-pref.png',
 		$core->auth->check('admin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Media manager'),'media.php','images/menu/media.png',
-		preg_match('/media(_item)?.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Media manager'),'admin.media','images/menu/media.png',
 		$core->auth->check('media,media_admin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Categories'),'categories.php','images/menu/categories.png',
-		preg_match('/categories.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Categories'),'admin.categories','images/menu/categories.png',
 		$core->auth->check('categories',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Search'),'search.php','images/menu/search.png',
-		preg_match('/search.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Search'),'admin.search','images/menu/search.png',
 		$core->auth->check('usage,contentadmin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Comments'),'comments.php','images/menu/comments.png',
-		preg_match('/comments.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Comments'),'admin.comments','images/menu/comments.png',
 		$core->auth->check('usage,contentadmin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('Entries'),'posts.php','images/menu/entries.png',
-		preg_match('/posts.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('Entries'),'admin.posts','images/menu/entries.png',
 		$core->auth->check('usage,contentadmin',$core->blog->id));
-	$_menu['Blog']->prependItem(__('New entry'),'post.php','images/menu/edit.png',
-		preg_match('/post.php$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('Blog',__('New entry'),'admin.post','images/menu/edit.png',
 		$core->auth->check('usage,contentadmin',$core->blog->id));
 
-	$_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png',
-		preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('System',__('Update'),'admin.update','images/menu/update.png',
 		$core->auth->isSuperAdmin() && is_readable(DC_DIGESTS));
-	$_menu['System']->prependItem(__('Languages'),'langs.php','images/menu/langs.png',
-		preg_match('/langs.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('System',__('Languages'),'admin.langs','images/menu/langs.png',
 		$core->auth->isSuperAdmin());
-	$_menu['System']->prependItem(__('Plugins management'),'plugins.php','images/menu/plugins.png',
-		preg_match('/plugins.php(\?.*)?$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('System',__('Plugins management'),'admin.plugins','images/menu/plugins.png',
 		$core->auth->isSuperAdmin());
-	$_menu['System']->prependItem(__('Users'),'users.php','images/menu/users.png',
-		preg_match('/users.php$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('System',__('Users'),'admin.users','images/menu/users.png',
 		$core->auth->isSuperAdmin());
-	$_menu['System']->prependItem(__('Blogs'),'blogs.php','images/menu/blogs.png',
-		preg_match('/blogs.php$/',$_SERVER['REQUEST_URI']),
+	addMenuItem('System',__('Blogs'),'admin.blogs','images/menu/blogs.png',
 		$core->auth->isSuperAdmin() ||
 		$core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->getBlogCount() > 1);
