このガイドを使用して Drupal 7 モジュールを開発しています。
このモジュールで管理者に表示するだけで、管理者はそこから変更して受け入れることができます。モジュールを [モジュール] セクションに表示できますが、有効にすると、作成したフォームとメニュー項目が本来あるべき場所に表示されません。構成セクションにメニュー項目がないため、作成したフォームに移動できません。これが私の.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);
}
そして私の.info:
name = Moderate Submissions
description = Moderate pending goal submissions.
core = 7.x
configure = admin/config/content/moderate_submissions
これはおそらく、私が構築しているものにチュートリアルを適応させようとして見落とした結果です。