简体   繁体   中英

Custom Drupal 7 Module not appearing in Configuration

I've been using this guide to develop a Drupal 7 module.

I want this module to simply display them to an administrator who can then change and accept them from there. I can get my module to appear in the Modules section but when I enable it, the form and menu item I built are not where they should be. There is no menu item in the Configuration section so I can't navigate to the form I made. Here's my .module:

/**
* Implements hook_help.
*
* Displays help and module information.
*
* @param path
*   Which path of the site we're using to display help
* @param arg
*   Array that holds the current path as returned from arg() function
*/
function moderate_submissions_help($path, $arg) {
  switch ($path) {
    case "admin/help#moderate_submissions":
      return '<p>' . "Allows admins to moderate new pending submissions." . '</p>';
      break;
  }
} 

/**
* Implements hook_menu().
*/

function moderate_submissions_menu() {
    $items = array();
    $items['admin/config/content/moderate_submissions'] = array(
        'title' => 'Moderate Submissions',
        'description' => 'Go through submissions.',
        'page callback' => 'drupal_get_form',
        'access arguments' => array('access administration pages'),
        'type' => MENU_NORMAL_ITEM,
    );
}

/**
* Page callback: Settings
*
* @see moderate_submissions_menu()
*/

function moderate_submissions_form($form, &$form_state) {
    $form['moderate_submissions_max'] = array(
        '#type' => 'textfield',
        '#title' => t('Maximum number of posts'),
        '#size' => 2,
        '#maxlength' => 2,
        '#description' => t('The maximum number of links to display in the block.'),
        '#required' => TRUE,
    );

    return system_settings_form($form);
}

And my .info:

name = Moderate Submissions
description = Moderate pending goal submissions.
core = 7.x
configure  = admin/config/content/moderate_submissions

This is probably the result of something I overlooked in trying to adapt the tutorial to what I'm building.

moderate_submisisons_menu()需要返回$items

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM