Welcome, Guest
Username: Password: Remember me

TOPIC: Can you hide or remove a control panel icon?

Can you hide or remove a control panel icon? 04 Jun 2017 23:55 #15182

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
Hi, just wondering if it is possible to remove icon(s) from a components control panel. What file determines what is produced on the control panel?

Cheers in advance
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 05 Jun 2017 13:16 #15186

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This stuff is located in JDom for the rendering
Namespace : html.menu.cpanel
Cpanel menu:
libraries/jdom/html/menu/cpanel.php
and buttons here:
libraries/jdom/html/link/menu/cpanel.php

JDom is gonna disapear in future. All this will be handled with a component helper. Maybe very soon. It could be the next monday, or following.
At the moment, you can override JDom in you component, placing the modified files in "dom" directory of your back-end component.
Just respect the same folders tree, and your custom file will override the native JDom. It is not using the fork system. It was designed before and JDom is independant.

Hope it helps, otherwise, I can give you more details.
If you hold patience, I tell you, this is gonna evolve soon.
Coding is now a piece of cake
Last Edit: 05 Jun 2017 13:17 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: jonathanbell

Can you hide or remove a control panel icon? 05 Jun 2017 16:37 #15187

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
  • Karma: 22
For that, I didn't hack JDOM, but just disable the display of Menu Item ... [helper.php]
	public static function addSubmenu($view, $layout, $alias = 'menu')
	{
		$items = static::getMenuItems();
			- - - - -
				switch($alias)
				{
					case 'cpanel':
					case 'menu':
					default:
						$links = array(
							'admin.pedigrees.default',
							'admin.etalons.default',
							'admin.lices.default',
							'admin.portees.default',
							'admin.actualites.default',
		// disable Status Icon	'admin.statuts.default',
							'admin.races.default',
							'admin.robes.default',
							'admin.yeuxs.default',
		// disable  Sexes Icon	'admin.sexes.default',
							'admin.annees.default',
							'admin.rubriques.default'
						);
Works fine too :)
Last Edit: 05 Jun 2017 16:39 by liubov.
The administrator has disabled public write access.
The following user(s) said Thank You: admin, jonathanbell

Can you hide or remove a control panel icon? 05 Jun 2017 16:42 #15188

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Thanks @liubov,

Of course you can do that way, and the future rewrite will include a XML file for configuring menus.
I was explaining for HTML custom (removing all icons).
But, now I understand the question was about removing a button, not an image.
For rendering customs, the CSS is also good.

You may answered better than me. So the two solutions are explained.
Coding is now a piece of cake
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 05 Jun 2017 17:11 #15189

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
  • Karma: 22
Thanks,
Customized CPanel handle with XML will be a great feature, with a key Icon => show/hide
The administrator has disabled public write access.
The following user(s) said Thank You: jonathanbell

Can you hide or remove a control panel icon? 05 Jun 2017 19:22 #15190

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
Thanks :). Got it and will now be able to sort. :)
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 06 Jun 2017 18:49 #15191

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
Are you going to remove the plugin Jocelyn?
That will have a huge impact on projects I made, because I call the JDom in fork to create custom actions, buttons etc.
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 06 Jun 2017 19:16 #15192

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
No, I am not gonna end with JDom now.
And will still be available and usable when you want.

JDom remains a great piece but will be used more for embeding snipplets of code, such as the Google map (or charts...) for instance.
And in case, it is still great to instance headless controls (without JForms)

But JDom is not the best for grids (memory optimization), and almost useless for the forms.
It was designed long time ago, but now Joomla has filled the gap, and building native is better and required.

So don't worry, because your component will still have some JDom inside, but ONLY where Joomla is not able natively.
It is a long way after successive versions where I will remove the CALLS step by step.
But don't worry, it will always be included by default because Cook will grow with more advanced plugins (the direction).
And for purists, I will may include an option for avoiding JDom, but restricting the exetended features.

For your forks, if they use JDom, it will always work. the problem would be if you made your customs in JDom classes which would become not called anymore.
Coding is now a piece of cake
Last Edit: 06 Jun 2017 19:23 by admin.
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 06 Jun 2017 20:05 #15193

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
I am not worried, I fully agree that native is better :)
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 12 Jun 2017 09:30 #15210

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
The feature is done.

Since 3.1.9, you can now manage menus through the XML menu file.

menu.xml at the component root.
(FRONT and BACK)

This file is forkable, but will replace all.
Coding is now a piece of cake
The administrator has disabled public write access.

Can you hide or remove a control panel icon? 12 Jun 2017 09:34 #15211

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
  • Karma: 22
Real good job, and curious to play with ...
The administrator has disabled public write access.
Time to create page: 0.076 seconds

Get Started