[development] inferring which file to include based on pagecallback array

Larry Garfield larry at garfieldtech.com
Mon Jun 11 20:25:40 UTC 2007


That's the other reason I rejected that method for menu-split. :-)  Too much magic, especially with so much legacy code.  

--Larry Garfield

On Mon, 11 Jun 2007 16:10:58 -0400, "Peter Wolanin" <pwolanin at gmail.com> wrote:
> This seems like a little too much "magic" in terms of the file and
> function naming, and perhaps too rigid as well.  What if I want to
> include both admin and export function in one .inc file?
> 
> -Peter
> 
> On 6/11/07, Moshe Weitzman <weitzman at tejasa.com> wrote:
>> you do so based on the first part of the function. so in my example
>> below, 'admin' is the part and thus system.admin.inc is known. sorry, i
>> omitted that. it was buried in the issue where larry added the include
>> parameter. that file would only be included if it existed, of course.
>>
>> Peter Wolanin wrote:
>> > Moshe - how does this make sense?  You no longer know which file to
>> > include for the callback.
>> >
>> > -Peter
>> >
>> > On 6/11/07, Moshe Weitzman <weitzman at tejasa.com> wrote:
>> >
>> >> CURRENT
>> >>    $items['admin/build'] = array(
>> >>      'title' => 'Site building',
>> >>      'page callback' => 'system_admin_menu_block_page',
>> >>      'file' => 'system.admin.inc',
>> >>
>> >> PROPOSED
>> >>    $items['admin/build'] = array(
>> >>      'title' => 'Site building',
>> >>      'page callback' => array('system, 'admin_menu_block_page'),
>> >>    (
>> >>
>> >> Note that we may still have to support a string as a page callback (i
>> >> think) for non module defined callbacks.
>> >>
>> >>
>>



More information about the development mailing list