Styling the left admin menu

Started by Atomixx, March 13, 2017, 09:20:52 PM

Previous topic - Next topic

Atomixx


Hello!
As you can see from the above image I've been styling the admin menu for my theme. I've added icons, but unfortunately, I don't know where the admin menu is generated so in order to add those icons, I inserted them into admin.english.php. Turns out that text such as "$txt['support_credits_title']" are used more than once throughout the forum and I don't want these icons in these places, only on the admin menu. So I've been wondering in which file is the admin menu generated?

Kindred

It's slightly complicated...  the array that is used to generate the menu is in admin.php, but the script that calls the array and generates the menu is elsewhere (can't recall where exactly) and that code is used to generate every side menu in the system
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

But, as I said, it can't be done just there, since that same function handles all the left menus, afaik
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Haven't tinkered with it, but seems to be a lot of code specific to admin sidebars, like this -



// This contains the html for the side bar of the admin center, which is used for all admin pages.
function template_generic_menu_sidebar_above()


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Atomixx

#5
Quote from: Kindred on March 13, 2017, 11:20:35 PM
But, as I said, it can't be done just there, since that same function handles all the left menus, afaik

I believe it generates in /Sources/Admin.php

// Define all the menu structure - see Subs-Menu.php for details!
$admin_areas = array(
'forum' => array(
'title' => $txt['admin_main'],
'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'),
'areas' => array(
'index' => array(
'label' => $txt['admin_center'],
'function' => 'AdminHome',
'icon' => 'administration.gif',
),
'credits' => array(
'label' => $txt['support_credits_title'],
'function' => 'AdminHome',
'icon' => 'support.gif',
),
'news' => array(
'label' => $txt['news_title'],
'file' => 'ManageNews.php',
'function' => 'ManageNews',
'icon' => 'news.gif',


I'm thinking of just altering the titles like $txt['admin_center'] to $txt['admin_center1'] and adding
$txt['admin_center1'] = '<i class="fa fa-home" aria-hidden="true"></i> Administration Center';
to index.english and leaving the original $txt['admin_center']

Advertisement: