コード例 #1
0
ファイル: _blog.funcs.php プロジェクト: Ariflaw/b2evolution
/**
 * Check that we have received a valid blog param
 *
 * For use in admin
 */
function valid_blog_requested()
{
    global $Blog, $Messages;
    if (empty($Blog)) {
        // The requested blog does not exist, Try to get other available blog for the current User
        $blog_ID = get_working_blog();
        if ($blog_ID) {
            $BlogCache =& get_BlogCache();
            $Blog =& $BlogCache->get_by_ID($blog_ID, false, false);
        }
    }
    if (empty($Blog)) {
        // The requested blog does not exist
        $Messages->add(T_('The requested blog does not exist (any more?)'), 'error');
        return false;
    }
    return true;
}
コード例 #2
0
ファイル: __core.init.php プロジェクト: Ariflaw/b2evolution
 /**
  * Build the evobar menu
  */
 function build_evobar_menu()
 {
     /**
      * @var Menu
      */
     global $topleft_Menu, $topright_Menu;
     global $current_User;
     global $baseurl, $home_url, $admin_url, $debug, $debug_jslog, $dev_menu, $seo_page_type, $robots_index;
     global $Blog, $blog, $activate_collection_toolbar;
     global $Settings;
     $perm_admin_normal = $current_User->check_perm('admin', 'normal');
     $perm_admin_restricted = $current_User->check_perm('admin', 'restricted');
     $entries = NULL;
     $working_blog = get_working_blog();
     if ($working_blog) {
         // Set collection url only when current user has an access to the working blog
         if (is_admin_page()) {
             // Front page of the working blog
             $BlogCache =& get_BlogCache();
             $working_Blog =& $BlogCache->get_by_ID($working_blog);
             $collection_url = $working_Blog->get('url');
         } else {
             // Dashboard of the working blog
             $collection_url = $admin_url . '?ctrl=dashboard&blog=' . $working_blog;
         }
     }
     if ($perm_admin_normal || $perm_admin_restricted) {
         // Normal OR Restricted Access to Admin:
         $entries = array();
         if ($perm_admin_normal) {
             // Only for normal access
             $entries['b2evo'] = array('text' => '<strong>b2evolution</strong>', 'href' => $home_url, 'entry_class' => 'rwdhide');
         }
         $entries['front'] = array('text' => T_('Front<u>-office</u>'), 'href' => $baseurl, 'title' => T_('Go to the site home page (Front-office)'));
         $entries['dashboard'] = array('text' => T_('Back<u>-office</u>'), 'href' => $admin_url, 'title' => T_('Go to the site dashboard (Back-office)'));
         if ($perm_admin_normal) {
             // Only for normal access
             $entries['write'] = array('text' => '<span class="fa fa-plus-square"></span> ' . T_('Post'), 'title' => T_('No blog is currently selected'), 'disabled' => true, 'entry_class' => 'rwdhide');
         }
         if ($working_blog) {
             // Display a link to manage first available collection
             $entries['blog'] = array('text' => T_('Collection'), 'href' => $collection_url, 'disabled' => true);
         }
         $entries['tools'] = array('text' => T_('More'), 'href' => $admin_url . '#', 'disabled' => true);
     }
     if ((!is_admin_page() || !empty($activate_collection_toolbar)) && !empty($Blog)) {
         // A blog is currently selected AND we can activate toolbar items for selected collection:
         if ($current_User->check_perm('blog_post_statuses', 'edit', false, $Blog->ID)) {
             // We have permission to add a post with at least one status:
             $write_item_url = $Blog->get_write_item_url();
             if ($write_item_url) {
                 // write item URL is not empty, so it's sure that user can create new post
                 if (!$perm_admin_normal) {
                     $entries['write'] = array('text' => '<span class="fa fa-plus-square"></span> ' . T_('Post'));
                 }
                 $entries['write']['href'] = $write_item_url;
                 $entries['write']['disabled'] = false;
                 $entries['write']['title'] = T_('Write a new post into this blog');
             }
         }
         if ($perm_admin_normal && $working_blog) {
             if (empty($write_item_url)) {
                 // Display restricted message on this blog
                 $entries['write']['title'] = T_('You don\'t have permission to post into this blog');
             }
             // BLOG MENU:
             $entries['blog'] = array('text' => T_('Collection'), 'title' => T_('Manage this blog'), 'href' => $collection_url);
             $display_separator = false;
             if ($current_User->check_perm('blog_ismember', 'view', false, $Blog->ID)) {
                 // Check if current user has an access to post lists
                 $items_url = $admin_url . '?ctrl=items&amp;blog=' . $Blog->ID . '&amp;filter=restore';
                 // Collection front page
                 $entries['blog']['entries']['coll_front'] = array('text' => T_('Collection Front Page') . '&hellip;', 'href' => $Blog->get('url'));
                 // Collection dashboard
                 $entries['blog']['entries']['coll_dashboard'] = array('text' => T_('Collection Dashboard') . '&hellip;', 'href' => $admin_url . '?ctrl=dashboard&amp;blog=' . $Blog->ID);
                 $entries['blog']['entries'][] = array('separator' => true);
                 if ($Blog->get('type') == 'manual') {
                     // Manual view
                     $entries['blog']['entries']['manual'] = array('text' => T_('Manual view') . '&hellip;', 'href' => $items_url . '&amp;tab=manual');
                 }
                 if ($Blog->get_setting('use_workflow')) {
                     // Workflow view
                     $entries['blog']['entries']['workflow'] = array('text' => T_('Workflow view') . '&hellip;', 'href' => $items_url . '&amp;tab=tracker');
                 }
                 $entries['blog']['entries']['posts'] = array('text' => T_('Posts') . '&hellip;', 'href' => $items_url);
                 $display_separator = true;
             }
             // Check if user has permission for published, draft or depreceted comments (any of these)
             if ($current_User->check_perm('blog_comments', 'edit', false, $Blog->ID)) {
                 // Comments:
                 $entries['blog']['entries']['comments'] = array('text' => T_('Comments') . '&hellip;', 'href' => $admin_url . '?ctrl=comments&amp;blog=' . $Blog->ID . '&amp;filter=restore');
                 $display_separator = true;
             }
             // Chapters / Categories:
             if ($current_User->check_perm('blog_cats', 'edit', false, $Blog->ID)) {
                 // Either permission for a specific blog or the global permission:
                 $entries['blog']['entries']['chapters'] = array('text' => T_('Categories') . '&hellip;', 'href' => $admin_url . '?ctrl=chapters&amp;blog=' . $Blog->ID);
                 $display_separator = true;
             }
             if ($display_separator) {
                 $entries['blog']['entries'][] = array('separator' => true);
             }
             // PLACE HOLDER FOR FILES MODULE:
             $entries['blog']['entries']['files'] = NULL;
             // BLOG SETTINGS:
             if ($current_User->check_perm('blog_properties', 'edit', false, $Blog->ID)) {
                 // We have permission to edit blog properties:
                 $blog_param = '&amp;blog=' . $Blog->ID;
                 $entries['blog']['entries']['features'] = array('text' => T_('Features'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=home' . $blog_param, 'entries' => array('front' => array('text' => T_('Front page') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=home' . $blog_param), 'posts' => array('text' => T_('Posts') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=features' . $blog_param), 'comments' => array('text' => T_('Comments') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=comments' . $blog_param), 'other' => array('text' => T_('Other displays') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=other' . $blog_param), 'more' => array('text' => T_('More') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=more' . $blog_param)));
                 $entries['blog']['entries']['skin'] = array('text' => T_('Skin') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=skin' . $blog_param);
                 $entries['blog']['entries']['plugin_settings'] = array('text' => T_('Plugins') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=plugin_settings' . $blog_param);
                 $entries['blog']['entries']['widgets'] = array('text' => T_('Widgets') . '&hellip;', 'href' => $admin_url . '?ctrl=widgets' . $blog_param);
                 if (!is_admin_page()) {
                     // Display a menu to turn on/off the debug containers
                     global $ReqURI, $Session;
                     if ($Session->get('display_containers_' . $Blog->ID) == 1) {
                         // To hide the debug containers
                         $entries['blog']['entries']['containers'] = array('text' => T_('Hide containers'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_containers=hide'));
                     } else {
                         // To show the debug containers
                         $entries['blog']['entries']['containers'] = array('text' => T_('Show containers'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_containers=show'));
                     }
                 }
                 $entries['blog']['entries']['general'] = array('text' => T_('Settings'), 'href' => $admin_url . '?ctrl=coll_settings' . $blog_param, 'entries' => array('general' => array('text' => T_('General') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=general' . $blog_param), 'urls' => array('text' => T_('URLs') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=urls' . $blog_param), 'seo' => array('text' => T_('SEO') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=seo' . $blog_param)));
                 if ($current_User->check_perm('options', 'view', false, $Blog->ID)) {
                     // Post Types & Statuses
                     $entries['blog']['entries']['general']['entries']['item_types'] = array('text' => T_('Post Types') . '&hellip;', 'href' => $admin_url . '?ctrl=itemtypes&amp;tab=settings&amp;tab3=types' . $blog_param);
                     $entries['blog']['entries']['general']['entries']['item_statuses'] = array('text' => T_('Post Statuses') . '&hellip;', 'href' => $admin_url . '?ctrl=itemstatuses&amp;tab=settings&amp;tab3=statuses' . $blog_param);
                 }
                 $entries['blog']['entries']['general']['entries']['advanced'] = array('text' => T_('Advanced') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=advanced' . $blog_param);
                 if ($Blog && $Blog->advanced_perms) {
                     $entries['blog']['entries']['general']['entries']['userperms'] = array('text' => T_('User perms') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=perm' . $blog_param);
                     $entries['blog']['entries']['general']['entries']['groupperms'] = array('text' => T_('Group perms') . '&hellip;', 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=permgroup' . $blog_param);
                 }
                 if ($current_User->check_perm('options', 'view')) {
                     // Check if current user has a permission to view the common settings of the blogs
                     $entries['blog']['entries']['general']['entries']['common_settings'] = array('text' => T_('Common Settings') . '&hellip;', 'href' => $admin_url . '?ctrl=collections&amp;tab=blog_settings');
                 }
             }
         }
     }
     if ($perm_admin_restricted) {
         // DEV MENU:
         $dev_entries = array();
         if ($dev_menu || $debug || $debug_jslog) {
             if (isset($Blog)) {
                 $dev_entries['coll'] = array('text' => 'Collection = ' . $Blog->shortname, 'disabled' => true);
             }
             global $disp, $is_front;
             if (!empty($disp)) {
                 $dev_entries['disp'] = array('text' => '$disp = ' . $disp, 'disabled' => true);
             }
             global $disp_detail;
             if (!empty($disp_detail)) {
                 $dev_entries['disp_detail'] = array('text' => '$disp_detail = ' . $disp_detail, 'disabled' => true);
             }
             if (!empty($seo_page_type)) {
                 // Set in skin_init()
                 $dev_entries['seo_page_type'] = array('text' => '> ' . $seo_page_type, 'disabled' => true);
             }
             global $is_front;
             if (!empty($is_front)) {
                 $dev_entries['front'] = array('text' => 'This is the FRONT page', 'disabled' => true);
             }
             if ($robots_index === false) {
                 $debug_text = 'NO INDEX';
             } else {
                 $debug_text = 'do index';
             }
             $dev_entries['noindex'] = array('text' => $debug_text, 'disabled' => true);
         }
         if (($dev_menu || $debug) && !is_admin_page() && !empty($Blog)) {
             // Display a menu to turn on/off the debug containers
             global $ReqURI, $Session;
             $dev_entries[] = array('separator' => true);
             if ($Session->get('display_containers_' . $Blog->ID) == 1) {
                 // To hide the debug containers
                 $dev_entries['containers'] = array('text' => T_('Hide containers'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_containers=hide'));
             } else {
                 // To show the debug containers
                 $dev_entries['containers'] = array('text' => T_('Show containers'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_containers=show'));
             }
             if ($Session->get('display_includes_' . $Blog->ID) == 1) {
                 // To hide the debug includes
                 $dev_entries['includes'] = array('text' => T_('Hide includes'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_includes=hide'));
             } else {
                 // To show the debug includes
                 $dev_entries['includes'] = array('text' => T_('Show includes'), 'href' => url_add_param(regenerate_url('display_containers'), 'display_includes=show'));
             }
         }
         // MORE menu:
         if ($current_User->check_perm('users', 'view')) {
             // Users:
             $entries['tools']['disabled'] = false;
             $entries['tools']['entries']['users'] = array('text' => T_('Users') . '&hellip;', 'href' => $admin_url . '?ctrl=users');
         }
         // PLACE HOLDER FOR MESSAGING MODULE:
         $entries['tools']['entries']['messaging'] = NULL;
         // PLACE HOLDER FOR FILES MODULE:
         $entries['tools']['entries']['files'] = NULL;
         $perm_options = $current_User->check_perm('options', 'view');
         $perm_spam = $perm_options && $current_User->check_perm('spamblacklist', 'view');
         $perm_emails = $current_User->check_perm('emails', 'view');
         $perm_maintenance = $current_User->check_perm('perm_maintenance', 'upgrade');
         if ($perm_spam || $perm_options || $perm_maintenance) {
             $entries['tools']['entries'][] = array('separator' => true);
             if ($perm_emails) {
                 $entries['tools']['entries']['email'] = array('text' => T_('Emails'), 'href' => $admin_url . '?ctrl=campaigns', 'entries' => array('campaigns' => array('text' => T_('Campaigns') . '&hellip;', 'href' => $admin_url . '?ctrl=campaigns'), 'blocked' => array('text' => T_('Addresses') . '&hellip;', 'href' => $admin_url . '?ctrl=email'), 'sent' => array('text' => T_('Sent') . '&hellip;', 'href' => $admin_url . '?ctrl=email&amp;tab=sent'), 'return' => array('text' => T_('Returned') . '&hellip;', 'href' => $admin_url . '?ctrl=email&amp;tab=return'), 'settings' => array('text' => T_('Settings') . '&hellip;', 'href' => $admin_url . '?ctrl=email&amp;tab=settings')));
             }
             $entries['tools']['disabled'] = false;
             $entries['tools']['entries']['system'] = array('text' => T_('System'), 'href' => $admin_url . '?ctrl=system');
             if ($perm_options) {
                 $entries['tools']['entries']['system']['entries']['status'] = array('text' => T_('Status') . '&hellip;', 'href' => $admin_url . '?ctrl=system');
             }
             if ($perm_options) {
                 $entries['tools']['entries']['system']['entries']['crontab'] = array('text' => T_('Scheduler') . '&hellip;', 'href' => $admin_url . '?ctrl=crontab');
             }
             if ($perm_spam) {
                 $entries['tools']['entries']['system']['entries']['antispam'] = array('text' => T_('Antispam') . '&hellip;', 'href' => $admin_url . '?ctrl=antispam');
             }
         }
         if ($perm_options) {
             // Global settings:
             $entries['tools']['entries']['system']['entries']['regional'] = array('text' => T_('Regional') . '&hellip;', 'href' => $admin_url . '?ctrl=regional');
             $entries['tools']['entries']['system']['entries']['skins'] = array('text' => T_('Skins') . '&hellip;', 'href' => $admin_url . '?ctrl=skins&amp;tab=system');
             $entries['tools']['entries']['system']['entries']['plugins'] = array('text' => T_('Plugins') . '&hellip;', 'href' => $admin_url . '?ctrl=plugins');
             $entries['tools']['entries']['system']['entries']['remote'] = array('text' => T_('Remote publishing') . '&hellip;', 'href' => $admin_url . '?ctrl=remotepublish');
             $entries['tools']['entries']['system']['entries']['maintenance'] = array('text' => T_('Maintenance') . '&hellip;', 'href' => $admin_url . '?ctrl=tools');
             $entries['tools']['entries']['system']['entries']['syslog'] = array('text' => T_('System log'), 'href' => '?ctrl=syslog');
         }
     }
     if ($entries !== NULL) {
         $topleft_Menu->add_menu_entries(NULL, $entries);
     }
     // ---------------------------------------------------------------------------
     /*
      * RIGHT MENU
      */
     global $localtimenow, $is_admin_page;
     $entries = array();
     // Dev menu:
     global $debug_jslog;
     if ($debug || $debug_jslog) {
         // Show JS log menu if debug is enabled
         $dev_entries[] = array('separator' => true);
         $dev_entries['jslog'] = array('text' => T_('JS log'), 'title' => T_('JS log'), 'class' => 'jslog_switcher');
     }
     if (!empty($dev_entries)) {
         // Add Dev menu if at least one entry is should be displayed
         $entries['dev'] = array('href' => $admin_url . '#', 'text' => '<span class="fa fa-wrench"></span> Dev', 'entries' => $dev_entries);
     }
     // User menu:
     $current_user_Group = $current_User->get_Group();
     $userprefs_entries = array('name' => array('text' => $current_User->get_avatar_imgtag('crop-top-32x32', '', 'left') . '&nbsp;' . $current_User->get_preferred_name() . '<br />&nbsp;<span class="note">' . $current_user_Group->get_name() . '</span>', 'href' => get_user_profile_url()));
     $userprefs_entries[] = array('separator' => true);
     $user_profile_url = get_user_profile_url();
     if (!empty($user_profile_url)) {
         // Display this menu item only when url is available to current user
         $userprefs_entries['profile'] = array('text' => T_('Edit your profile') . '&hellip;', 'href' => $user_profile_url);
     }
     $user_avatar_url = get_user_avatar_url();
     if (!empty($user_avatar_url)) {
         // Display this menu item only when url is available to current user
         $userprefs_entries['avatar'] = array('text' => T_('Your profile picture') . '&hellip;', 'href' => $user_avatar_url);
     }
     $user_pwdchange_url = get_user_pwdchange_url();
     if (!empty($user_pwdchange_url)) {
         // Display this menu item only when url is available to current user
         $userprefs_entries['pwdchange'] = array('text' => T_('Change password') . '&hellip;', 'href' => $user_pwdchange_url);
     }
     $user_preferences_url = get_user_preferences_url();
     if (!empty($user_preferences_url)) {
         // Display this menu item only when url is available to current user
         $userprefs_entries['userprefs'] = array('text' => T_('Preferences') . '&hellip;', 'href' => $user_preferences_url);
     }
     $user_subs_url = get_user_subs_url();
     if (!empty($user_subs_url)) {
         // Display this menu item only when url is available to current user
         $userprefs_entries['subs'] = array('text' => T_('Notifications') . '&hellip;', 'href' => $user_subs_url);
     }
     $entries['userprefs'] = array('text' => '<strong>' . $current_User->get_colored_login(array('login_text' => 'name')) . '</strong>', 'href' => get_user_profile_url(), 'entries' => $userprefs_entries);
     $entries['time'] = array('text' => date(locale_shorttimefmt(), $localtimenow), 'disabled' => true, 'entry_class' => 'rwdhide');
     if ($current_User->check_perm('admin', 'normal') && $current_User->check_perm('options', 'view')) {
         // Make time as link to Timezone settings if permission
         $entries['time']['disabled'] = false;
         $entries['time']['href'] = $admin_url . '?ctrl=time';
     }
     // ADMIN SKINS:
     if ($is_admin_page) {
         $admin_skins = get_admin_skins();
         if (count($admin_skins) > 1) {
             // We have several admin skins available: display switcher:
             $entries['userprefs']['entries']['admskins'] = array('text' => T_('Admin skin'));
             $redirect_to = rawurlencode(regenerate_url('', '', '', '&'));
             foreach ($admin_skins as $admin_skin) {
                 $entries['userprefs']['entries']['admskins']['entries'][$admin_skin] = array('text' => $admin_skin, 'href' => $admin_url . '?ctrl=users&amp;action=change_admin_skin&amp;new_admin_skin=' . rawurlencode($admin_skin) . '&amp;redirect_to=' . $redirect_to);
             }
         }
     }
     $entries['userprefs']['entries'][] = array('separator' => true);
     $entries['userprefs']['entries']['logout'] = array('text' => T_('Log out!'), 'href' => get_user_logout_url());
     $topright_Menu->add_menu_entries(NULL, $entries);
 }
コード例 #3
0
 /**
  * Builds the 2nd half of the menu. This is the one with the configuration features
  *
  * At some point this might be displayed differently than the 1st half.
  */
 function build_menu_2()
 {
     global $loc_transinfo, $ctrl, $admin_url;
     /**
      * @var User
      */
     global $current_User;
     global $Blog;
     /**
      * @var AdminUI_general
      */
     global $AdminUI;
     $blog = get_working_blog();
     if (!$blog) {
         // No available blogs for current user
         return;
     }
     // Collection Dashboard
     $collection_menu_entries = array('dashboard' => array('text' => T_('Collection Dashboard'), 'href' => $admin_url . '?ctrl=dashboard&amp;blog=' . $blog, 'order' => 'group_last'));
     $perm_comments = $current_User->check_perm('blog_comments', 'edit', false, $blog);
     $perm_cats = $current_User->check_perm('blog_cats', '', false, $blog);
     // Posts
     $collection_menu_entries['posts'] = array('text' => T_('Posts'), 'href' => $admin_url . '?ctrl=items&amp;tab=full&amp;filter=restore&amp;blog=' . $blog);
     $last_group_menu_entry = 'posts';
     if ($perm_comments) {
         // User has permission to edit published, draft or deprecated comments (at least one kind)
         $collection_menu_entries['comments'] = array('text' => T_('Comments'), 'href' => $admin_url . '?ctrl=comments&amp;blog=' . $blog . '&amp;filter=restore');
         $last_group_menu_entry = 'comments';
     }
     if ($perm_cats) {
         // Categories
         $collection_menu_entries['categories'] = array('text' => T_('Categories'), 'href' => $admin_url . '?ctrl=chapters&amp;blog=' . $blog);
         $last_group_menu_entry = 'categories';
     }
     // Mark last menu entry in group
     $collection_menu_entries[$last_group_menu_entry]['order'] = 'group_last';
     $AdminUI->add_menu_entries('collections', $collection_menu_entries);
     if ($current_User->check_perm('blog_properties', 'edit', false, $blog)) {
         // Display these menus only when some blog is selected and current user has an access to edit the blog properties
         // BLOG SETTINGS:
         // We're on any other page, we may have a direct destination
         // + we have subtabs (fp > maybe the subtabs should go into the controller as for _items ?)
         $AdminUI->add_menu_entries('collections', array('features' => array('text' => T_('Features'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=home&amp;blog=' . $blog, 'entries' => array('home' => array('text' => T_('Front page'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=home&amp;blog=' . $blog), 'features' => array('text' => T_('Posts'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=features&amp;blog=' . $blog), 'comments' => array('text' => T_('Comments'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=comments&amp;blog=' . $blog), 'other' => array('text' => T_('Other displays'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=other&amp;blog=' . $blog), 'more' => array('text' => T_('More'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=more&amp;blog=' . $blog))), 'skin' => array('text' => T_('Skins'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=skin&amp;blog=' . $blog, 'entries' => array('current_skin' => array('text' => T_('Skins for this blog'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=skin&amp;blog=' . $blog))), 'plugin_settings' => array('text' => T_('Plugins'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=plugin_settings&amp;blog=' . $blog), 'widgets' => array('text' => T_('Widgets'), 'href' => $admin_url . '?ctrl=widgets&amp;blog=' . $blog, 'order' => 'group_last'), 'settings' => array('text' => T_('Settings'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=general&amp;blog=' . $blog, 'entries' => array('general' => array('text' => T_('General'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=general&amp;blog=' . $blog), 'urls' => array('text' => T_('URLs'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=urls&amp;blog=' . $blog), 'seo' => array('text' => T_('SEO'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=seo&amp;blog=' . $blog)))));
         if ($current_User->check_perm('options', 'view')) {
             // Manage skins
             $AdminUI->add_menu_entries(array('collections', 'skin'), array('manage_skins' => array('text' => T_('Manage skins'), 'href' => $admin_url . '?ctrl=skins&amp;blog=' . $blog)));
         }
         if ($current_User->check_perm('options', 'view', false, $blog)) {
             // Post Types & Statuses
             $AdminUI->add_menu_entries(array('collections', 'settings'), array('types' => array('text' => T_('Post Types'), 'title' => T_('Post Types Management'), 'href' => $admin_url . '?ctrl=itemtypes&amp;tab=settings&amp;tab3=types&amp;blog=' . $blog), 'statuses' => array('text' => T_('Post Statuses'), 'title' => T_('Post Statuses Management'), 'href' => $admin_url . '?ctrl=itemstatuses&amp;tab=settings&amp;tab3=statuses&amp;blog=' . $blog)));
         }
         $AdminUI->add_menu_entries(array('collections', 'settings'), array('advanced' => array('text' => T_('Advanced'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=advanced&amp;blog=' . $blog)));
         if ($Blog && $Blog->advanced_perms) {
             // Permissions
             $AdminUI->add_menu_entries(array('collections', 'settings'), array('perm' => array('text' => T_('User perms'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=perm&amp;blog=' . $blog), 'permgroup' => array('text' => T_('Group perms'), 'href' => $admin_url . '?ctrl=coll_settings&amp;tab=permgroup&amp;blog=' . $blog)));
         }
         if ($current_User->check_perm('options', 'view')) {
             // Check if current user has a permission to view the common settings of the blogs
             $AdminUI->add_menu_entries(array('collections', 'settings'), array('blog_settings' => array('text' => T_('Common Settings'), 'href' => $admin_url . '?ctrl=collections&amp;tab=blog_settings&amp;blog=' . $blog)));
         }
     }
 }