hook_menu

seanr's picture

Can't get sustainability/report/download/%hash to load it's callback, returns sustainability/report/download's instead

  1. /**
  2.  * All below is for the secure report download.
  3.  */
  4. function crown_sustainability_menu() {
  5.   $items['admin/settings/sustainability'] = array(
  6.     'title' => 'Sustainability Report',
  7.     'des

Refactoring perms arrays in hook_menu

  1. <?php
  2.   // Compare two versions
  3.   $admin_access = array('administer filters');
  4.   $items['admin/settings/filters'] = array(
  5.     'page callback' => 'drupal_get_form',
  6.     'access arguments' => arra

Fix for Example of using 'title callback' and 'title arguments' in Drupal 6

  1. /**
  2.  * Implementation of hook_menu().
  3.  */
  4. function cck_gallery_menu() {
  5.   $items['cck-galleries/%user'] = array(
  6.     //define the function that generates the page title
  7.     'title callback' => '

Fix for Code

  1. <?php
  2.  
  3. function swingnet_utils_menu() {
  4.  
  5.   $items = array();
  6.  
  7.   $items['perfil/edit'] = array(
  8.     'title' => t('Editar Perfil'),
  9.     'description' => t('Editar Perfil'),
  10.     'page callback'

Code

  1. <?php
  2.  
  3. global $user;
  4.  
  5.  
  6.   $query = db_query("select {node.nid} as nid from {node} where {node.uid} =%d and {node.type} = 'perfil'",$user->uid);
  7.   $dado = db_fetch_array($query);
  8.  
  9. function swing

Fix for Callback overrides 5.x -> 6.x

  1. // what we had in 5.x
  2.  
  3. function mymodule_menu($may_cache)
  4. {
  5.   $items = array();
  6.   if(!may_cache && module_exists('devel'))
  7.   {
  8.      $items[] = array(
  9.                  'path' => 'devel/cache/cl

Fix for Fix for Creating a simple menu entry

  1. /*
  2.  * I'm trying to create a menu item that links to 'author/<username>', where username is the name of the logged in user.
  3.  * The menu has no callback associated, it's just a simple menu item, poin

Fix for Creating a simple menu entry

  1. /*
  2.  * I'm trying to create a menu item that links to 'author/<username>', where username is the name of the logged in user.
  3.  * The menu has no callback associated, it's just a simple menu item, poin

Creating a simple menu entry

  1. /*
  2.  * I'm trying to create a menu item that links to 'author/<username>', where username is the name of the logged in user.
  3.  * The menu has no callback associated, it's just a simple menu item, poin

cant catch the alias of the node

  1. function raphael_receipts_menu() {
  2.   $items  = array();
  3.  
  4.   $items['receipts/%'] = array(
  5.     'title' => 'Raphael Restaurant Receipts',
  6.     //'title callback' => 'raphael_receipts_title',
  7.     'ti
Syndicate content