Modifying a custom ACP template module.


Topic author
cabot
Active Member
Posts: 8
Joined: 21. March 2023 13:54
phpBB.com User: cabot

Modifying a custom ACP template module.

Post by cabot »

Hello,

I have created a module that allows me to display blocks of links retrieved from an extension.
The permissions for displaying these blocks are configured upstream by the extension.

I would like to disable the ‘Module permissions’ block.
Image

Alternatively, if this is not possible, display a message to warn the administrator that the permissions are already set by the extension and that it is recommended not to change anything in this block.

The current code is very basic.

Code: Select all

	public function get_template_side($module_id)
	{
		if (is_object($this->controller_helpers) && method_exists($this->controller_helpers, 'build_sidebar'))
		{
			$this->controller_helpers->build_sidebar();
		}

		return '@gtroph_b3pgtrophlinks/gtroph_links_side.html';
	}

	public function get_template_acp($module_id)
	{
		return [
			'title' => 'B3P_GTROPH_LINKS',
			'vars' => [],
		];
	}
}
User avatar

Kirk
Dev
Posts: 1983
Joined: 27. July 2010 18:02
phpBB.de User: Kirk

Re: Modifying a custom ACP template module.

Post by Kirk »

Hi
This is not possible as it is displayed in every block. You could add something to the PHP file of your block.
within:

Code: Select all

	public function get_template_acp($module_id)
Gruß Udo

Topic author
cabot
Active Member
Posts: 8
Joined: 21. March 2023 13:54
phpBB.com User: cabot

Re: Modifying a custom ACP template module.

Post by cabot »

So return a message using “legend1” or something like that?
User avatar

Kirk
Dev
Posts: 1983
Joined: 27. July 2010 18:02
phpBB.de User: Kirk

Re: Modifying a custom ACP template module.

Post by Kirk »

Exactly, it looks like this:
no_change_module_permissions.jpg
You do not have the required permissions to view the files attached to this post.
Gruß Udo

Topic author
cabot
Active Member
Posts: 8
Joined: 21. March 2023 13:54
phpBB.com User: cabot

Re: Modifying a custom ACP template module.

Post by cabot »

Thx!

Return to “Modifications Support”