/[drupal]/contributions/modules/automenu/automenu.module
ViewVC logotype

Diff of /contributions/modules/automenu/automenu.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.4, Tue May 5 14:15:21 2009 UTC revision 1.1.4.5, Fri Oct 9 14:34:20 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: automenu.module,v 1.1.4.3 2009/05/05 13:14:03 farbridges Exp $  // $Id: automenu.module,v 1.1.4.4 2009/05/05 14:15:21 farbridges Exp $
3    
4  /**  /**
5   * Implementation of hook_nodeapi().   * Implementation of hook_nodeapi().
# Line 21  function automenu_nodeapi(&$node, $op, $ Line 21  function automenu_nodeapi(&$node, $op, $
21              'hidden' => variable_get('automenu_hide_'.$node->type, 0),              'hidden' => variable_get('automenu_hide_'.$node->type, 0),
22              //'customized' => true, // ?              //'customized' => true, // ?
23            );            );
24              if ($node->language) {
25                $new_menu['options'] = array('langcode'=> $node->language);
26              }
27              if( $existing_item = db_fetch_array(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s' AND plid = %d", 'node/' . $node->nid, $new_menu['plid']))) {
28                $new_menu['mlid']=$existing_item['mlid'];
29              }
30            if (!menu_link_save($new_menu)) {            if (!menu_link_save($new_menu)) {
31              drupal_set_message(t('There was an error saving the auto-menu link.'), 'error');              drupal_set_message(t('There was an error saving the auto-menu link.'), 'error');
32            }            }
33            else {            else {
34              drupal_set_message(t('The page was automatically added to: !menu.', array('!menu' => $parent_menu[0])));        drupal_set_message(t('The page was automatically added/updated to: !menu.', array('!menu' => $parent_menu[0])));
35            }            }
36          }          }
37        }        }

Legend:
Removed from v.1.1.4.4  
changed lines
  Added in v.1.1.4.5

  ViewVC Help
Powered by ViewVC 1.1.2