install mcp module

Discussion forum for Extension Writers regarding Extension Development.
User avatar
sebo
Registered User
Posts: 56
Joined: Mon Jan 22, 2024 10:28 pm

install mcp module

Post by sebo »

hello there, i'm still trying developing something for my forum and now i am searching to add two mcp modules.
If i install it via SQL (i've tryed before in xampp PhpMyAdmin) it works.
If i try to install via extension manager it crashes.

so i guess my errors are in the install_mcp_module.php

here is my code:

Code: Select all

	public function update_data()
	{
		return [
			['module.add', [
				'mcp',
				0,
				'MCP_PANDANOTIZIE_TITLE'
			]],
			['module.add', [
				'mcp',
				'MCP_PANDANOTIZIE_TITLE',
				[
					'module_basename'	=> '\sebo\pandanotizie\mcp\main_module',
					'modes'				=> ['front'],
				],
			]],
			['module.add', [
				'mcp',
				'MCP_PANDANOTIZIE_TITLE',
				[
					'module_basename'	=> '\sebo\pandanotizie\mcp\settings_module',
					'modes'				=> ['settings'],
				],
			]],
		];
	}
But it blocks the installation and don't know why. i've searched the wiki, but it reports the example of a single module installation only...the skeleton extension created this one (for only one module but i need two of them):

Code: Select all

	public function update_data()
	{
		return [
			['module.add', [
				'mcp',
				0,
				'MCP_PANDANOTIZIE_TITLE'
			]],
			['module.add', [
				'mcp',
				'MCP_PANDANOTIZIE_TITLE',
				[
					'module_basename'	=> '\sebo\pandanotizie\mcp\main_module',
					'modes'				=> ['front'],
				],
			]],
		];
	}
the result i would like to have is in SQL:

|module_id|module_enabled|module_display|module_basename|module_class|parent_id|left_id|right_id|module_langname|module_mode|module_auth|
|323|1|1|\sebo\pandanotizie\mcp\settings_module|mcp|321|76|77|MCP_PANDANOTIZIE_SETTINGS|settings|ext_sebo/pandanotizie|
|322|1|1|\sebo\pandanotizie\mcp\main_module|mcp|321|74|75|MCP_PANDANOTIZIE|front|ext_sebo/pandanotizie|
|321|1|1|NULL|mcp|0|73|78|MCP_PANDANOTIZIE_TITLE|NULL|NULL|

how can i do it? what's wrong?!

eg. i want the main module in mcp with two subpages:
one front (main)
and one settings (settings one)
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3937
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: install mcp module

Post by Kailey »

Code: Select all

'modes'				=> ['front', 'settings'],
You don't need to separate out the modes.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders

Return to “Extension Writers Discussion”