Page 1 of 1

Help with UMIL - adding UCP tab and module

Posted: Sat Feb 18, 2012 9:27 am
by BrokenCrust
I would like to add a new UCP tab with a new module under it. so I tried this:-

Code: Select all

'module_add' => array(array('ucp', 0, 'UCP_MY_MOD')),
'module_add' => array(array('ucp', 'UCP_MY_MOD', array('module_basename' => 'my_mod'))),
Which gives the error

ERROR: The parent category specified for this module does not exist.

If I add the tab only, it works

Code: Select all

'module_add' => array(array('ucp', 0, 'UCP_MY_MOD')),
If instead of a new tab I add the module to an existing tab it works

Code: Select all

'module_add' => array(array('ucp', 'UCP_MAIN', array('module_basename' => 'my_mod'))),
If I add the tab manually myself and then just add the module to it, then it works

Code: Select all

'module_add' => array(array('ucp', 'UCP_MY_MOD', array('module_basename' => 'my_mod'))),
But I can not seem to add a tab and then a module to it at the same time.

Please can someone help me with the UMIL syntax?

I have phpBB 3.0.10 and UMIL 1.0.4

Re: Help with UMIL - adding UCP tab and module

Posted: Sat Feb 18, 2012 9:59 am
by AmigoJack
[quote="BrokenCrust"]

Code: Select all

'module_add' => ...,
'module_add' => ...,
Array keys have to be unique - you're always overwriting any previous one with the last one if the key is the same. PHP basics. In other words:

Code: Select all

// This is the same...
$a= array
( 'one'=> 1
, 'one'=> 2
, 'one'=> 3
);

// ...as writing this one:
$a= array
( 'one'=> 3
);

// This can be proven by:
print_r( $a ); 
Have a look at phpBB Statistics which also adds its own modules.

Re: Help with UMIL - adding UCP tab and module

Posted: Sat Feb 18, 2012 10:00 am
by Steve
try this:

Code: Select all

        
'module_add' => array(
    // First, lets add a new category 
            array('ucp', '', 'UCP_MY_MOD'), //Category/tab title 

    // next let's add our module
            array('ucp', 'UCP_USER_MY_MOD', array( // Mode title
                    'module_basename'    => my_mod', //info file name minus ucp_
                    'modes'                => array('my_mod_mode), // Mode set in info file
                ),    
            )
 

Re: Help with UMIL - adding UCP tab and module

Posted: Sat Feb 18, 2012 10:15 am
by BrokenCrust
Thanks, I've sorted it. I knew it would be something obvious. Looking too much at UMIL and not enough at PHP. :oops:

Re: Help with UMIL - adding UCP tab and module

Posted: Mon May 04, 2015 9:55 am
by michaelo
What's the file structure for ucp modules?

The acp has changed to not require the info folder as all files are in the acp root..
For example: ...acp\my_filename_module.php & ...acp\my_filename_ino.php, is this true for ucp?

When I try to add ucp modle I get: A required module info file is missing: \myextension\balh\ucp\ucp_my_filename...

I'm also assuming the ucp files go into: extension_name\extension\ucp ...

Re: Help with UMIL - adding UCP tab and module

Posted: Mon May 04, 2015 10:01 am
by Paul
Are you talking about 3.0 or 3.1?
In 3.0 is nothing changed, and the info folder is still there. In 3.1 it is changed, however UMIL should/can't be used with 3.1.

Re: Help with UMIL - adding UCP tab and module

Posted: Mon May 04, 2015 10:18 am
by michaelo
Sorry Paul, looks like posted in wrong forum... I was reading so many post I got lost :oops: