help!!!

machacaz - September 5, 2009 - 20:31

Hello. I had the followin menu item:
$items['admin/repository/back'] = array(
'title' => 'Backup DataBase',
'access arguments' => array('data'),
'page callback' => 'test',
'page arguments' => array(3),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);

Now i installed a module (backup and migrate).
I want to know if it is possible to call up that module inside my menu.
something like the callback, but instead of calling the test funcion would call the module backup_and migrate....

I tried something like:
$items['admin/repository/back'] = array(
'title' => 'Backup DataBase',
'access arguments' => array('data'),
'page callback' => 'drupal/admin/content/backup_migrate',
'page arguments' => array(3),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);

drupal/admin/content/backup_migrate

The functionality of the

nevets - September 5, 2009 - 20:52

The functionality of the module is already available at admin/content/backup_migrate

yes... i know... but i want,

machacaz - September 5, 2009 - 20:56

yes... i know... but i want, if possible, that when i click in item... that it call (goes) there...
that is my doubt, how to do it? if possible, off course.

You have a two options: 1)

chrisshattuck - September 7, 2009 - 05:11

You have a two options:

1) You could set your own function and redirect to the page already supplied by the backup and migrate module
2) You can set the page callback to be the function that is called in /admin/content/backup_migrate. So, look in the module and find the menu item for admin/content/backup_migrate and use the page callback parameter you find there.

Cheers,
Chris

Build a Module.com - The definitive video guide to Drupal development

Cheers,
Chris

Build a Module.com - The definitive video guide to Drupal development

i have no ideia how?

machacaz - September 19, 2009 - 17:38

Hey... chrisshattuck.... could you give me a hand on this for your 1s ideia?
i had no ideia how to do it, just as for the second one...on this, i got a blank screen.

function repository_menu(){

module_load_include("module"," backup_migrate.module");

    /**
     *Main Menu
     */
        $items['admin/repository'] = array(
'title' => 'Algorithm Repository',
'access arguments' => array('data'),
        'page callback' => 'repository_overview',
'type' => MENU_NORMAL_ITEM,
);


//submenus


//submenu 3
        $items['admin/repository/back'] = array(
        'title' => 'Backup DataBase',
        'access arguments' => array('data'),
        'page callback' => 'backup_migrate_backup',
        'page arguments' => array(3),
        'type' => MENU_LOCAL_TASK,
        'weight' => 3,
        );

on submenu3, pagecallback i tried to call the menu function, trying to call up the backupmodule (http://drupal.org/project/backup_migrate)

Here's how it would look in

chrisshattuck - October 2, 2009 - 17:20

Here's how it would look in your hook_menu:

<?php
$items
['admin/repository/back'] = array(
'title' => 'Backup DataBase',
'access arguments' => array('data'),
'page callback' => 'mymodule_function_callback',
'page arguments' => array(3),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
?>

And then you would define the callback function for the page to redirect to the existing page:

<?php
function mymodule_function_callback() {
drupal_goto('admin/content/backup_migrate');
}
?>

Hope that helps!
?>

Cheers,
Chris

Build a Module.com - The definitive video guide to Drupal development

help on this? 1st point... how to?

machacaz - September 19, 2009 - 17:22
 
 

Drupal is a registered trademark of Dries Buytaert.