Peter <br><br>The reason I added the file element is that I got an error on another module<br>(system.admin.inc ...) and that element made it go away.<br><br>
It works now with your changes.<br><br>
Thanks.<br>
<br><div class="gmail_quote">On Jan 3, 2008 8:53 PM, Peter Wolanin <<a href="mailto:pwolanin@gmail.com">pwolanin@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Khalid,<br><br>One thing looks wrong for sure:<br><br>'file' => 'lists.module',<br><br>I'm not sure if that's causing the problem, but it instructs the menu<br>system to include the module file again. 'file' should only be used
<br>with .inc files.<br><br>Also, don't use t() anywhere - titles, etc are localized dynamically.<br><br>Finally (and most importantly), the access part is wrong. Since you<br>are using the defaullt callback (user_access), you can have something
<br>like this:<br><div class="Ih2E3d"><br><br>function lists_menu() {<br> $items = array();<br> $items['lists'] = array(<br></div> 'title' => 'Mailing lists',<br><div class="Ih2E3d">
'page callback' => 'drupal_get_form',<br></div> 'page arguments' => array('lists_subscribe_form'),<br> 'access arguments' => array('access content'),
<br> 'type' => MENU_SUGGESTED_ITEM,<br> );<br> return $items;<br><div><div></div><div class="Wj3C7c">}<br><br>> ---------- Forwarded message ----------<br>> From: "Khalid Baheyeldin" <
<a href="mailto:kb@2bits.com">kb@2bits.com</a>><br>> To: <a href="mailto:development@drupal.org">development@drupal.org</a><br>> Date: Thu, 3 Jan 2008 20:27:37 -0500<br>> Subject: [development] Question on Drupal 6 menus
<br>> This is a question for chx, but I posted it publicly so we all benefit from his reply.<br>><br>> I found a weird problem with the menus in D6. Most probably I am missing something<br>> obvious, but I am missing what it is.
<br>><br>> This does work. Note that the lists inherits from admin, and it is a NORMAL item.<br>><br>> function lists_menu() {<br>> $items = array();<br>> $items['admin/lists'] = array(<br>> 'title' => t('Mailing lists'),
<br>> 'page callback' => 'drupal_get_form',<br>> 'page arguments' => array('lists_subscribe'),<br>> 'access' => user_access('access content'),
<br>> 'type' => MENU_NORMAL_ITEM,<br>> 'file' => 'lists.module',<br>> );<br>> return $items;<br>> }<br>><br>> This, which is what I want, does not show the lists path anywhere, not under menu
<br>> as disabled, nothing (I marked the changed lines with an *).<br>><br>> function lists_menu() {<br>> $items = array();<br>> * $items['lists'] = array(<br>> 'title' => t('Mailing lists'),
<br>> 'page callback' => 'drupal_get_form',<br>> 'page arguments' => array('lists_subscribe'),<br>> 'access' => user_access('access content'),
<br>> * 'type' => MENU_SUGGESTED_ITEM,<br>> 'file' => ' lists.module',<br>> );<br>> return $items;<br>> }<br>><br>> The latter is the one needed so that the path can be enabled or disabled in the
<br>> menus as needed. This is the way it works on D5.<br>><br>> What is amiss here?<br>> --<br>> Khalid M. Baheyeldin<br>> <a href="http://2bits.com" target="_blank">2bits.com</a>, Inc.<br>> <a href="http://2bits.com" target="_blank">
http://2bits.com</a><br>> Drupal optimization, development, customization and consulting.<br></div></div>> --<br>> [ Drupal development list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/
</a> ]<br>><br></blockquote></div><br><br clear="all"><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a>, Inc.<br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.