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

Diff of /contributions/modules/feature/feature.module

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

revision 1.28, Thu Jan 3 05:15:09 2008 UTC revision 1.29, Fri Jan 4 02:31:38 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: feature.module,v 1.27 2007/12/05 20:48:08 kbahey Exp $  // $Id: feature.module,v 1.28 2008/01/03 05:15:09 kbahey Exp $
3    
4  define('FEATURE_CATEGORY_LIST', 'feature_category_list');  define('FEATURE_CATEGORY_LIST', 'feature_category_list');
5    
# Line 29  function feature_perm() { Line 29  function feature_perm() {
29    
30  function feature_menu() {  function feature_menu() {
31    $items = array();    $items = array();
   $access = user_access("maintain feature list");  
32    
33    $items['admin/feature'] = array(    $items['admin/feature'] = array(
34      'title'         => t('Features'),      'title'            => 'Features',
35      'page callback' => 'feature_admin_list',      'page callback'    => 'feature_admin_list',
36      'access'        => $access,      'access arguments' => array('maintain feature list'),
     'file'          => 'feature.module',  
37    );    );
38    $items['admin/feature/list'] = array(    $items['admin/feature/list'] = array(
39      'title'         => t('List'),      'title'         => 'List',
40      'page callback' => 'feature_admin_list',      'page callback' => 'feature_admin_list',
41      'access'        => $access,      'access arguments' => array('maintain feature list'),
     'file'          => 'feature.module',  
42      'type'          => MENU_DEFAULT_LOCAL_TASK,      'type'          => MENU_DEFAULT_LOCAL_TASK,
43      'weight'        => -10,      'weight'        => -10,
44    );    );
45    $items['admin/feature/add'] = array(    $items['admin/feature/add'] = array(
46      'title'          => t('Add feature'),      'title'          => 'Add feature',
47      'page callback'  => 'drupal_get_form',      'page callback'  => 'drupal_get_form',
48        'access arguments' => array('maintain feature list'),
49      'page arguments' => array('feature_admin'),      'page arguments' => array('feature_admin'),
     'access'         => $access,  
     'file'           => 'feature.module',  
50      'type'           => MENU_LOCAL_TASK,      'type'           => MENU_LOCAL_TASK,
51    );    );
52    $items['admin/feature/edit'] = array(    $items['admin/feature/edit'] = array(
53      'title'          => t('Edit feature'),      'title'          => 'Edit feature',
54      'page callback'  => 'drupal_get_form',      'page callback'  => 'drupal_get_form',
55        'access arguments' => array('maintain feature list'),
56      'page arguments' => array('feature_admin'),      'page arguments' => array('feature_admin'),
     'access'         => $access,  
     'file'           => 'feature.module',  
57      'type'           => MENU_CALLBACK,      'type'           => MENU_CALLBACK,
58    );    );
59    $items['admin/feature/delete'] = array(    $items['admin/feature/delete'] = array(
60      'title'          => t('Delete feature'),      'title'          => 'Delete feature',
61      'page callback'  => 'feature_admin_delete',      'page callback'  => 'feature_admin_delete',
62      'access'         => $access,      'access arguments' => array('maintain feature list'),
     'file'           => 'feature.module',  
63      'type'           => MENU_CALLBACK,      'type'           => MENU_CALLBACK,
64    );    );
65    $items['admin/feature/settings'] = array(    $items['admin/feature/settings'] = array(
66      'title'          => t('Settings'),      'title'          => 'Settings',
67      'page callback'  => 'drupal_get_form',      'page callback'  => 'drupal_get_form',
68      'page arguments' => array('feature_settings'),      'page arguments' => array('feature_settings'),
69      'access'         => $access,      'access arguments' => array('maintain feature list'),
     'file'           => 'feature.module',  
70      'type'           => MENU_LOCAL_TASK,      'type'           => MENU_LOCAL_TASK,
71    );    );
72    $items['features'] = array(    $items['features'] = array(
73      'title'           => t('Features'),      'title'           => 'Features',
74      'page callback'   => 'feature_listing',      'page callback'   => 'feature_listing',
75      'access'          => user_access('access content'),      'access arguments' => array('access content'),
     'file'            => 'feature.module',  
76      'type'            => MENU_CALLBACK,      'type'            => MENU_CALLBACK,
77    );    );
78    return $items;    return $items;
# Line 265  function feature_listing() { Line 257  function feature_listing() {
257    
258    $result = db_query("SELECT * FROM {feature} ORDER BY category, name");    $result = db_query("SELECT * FROM {feature} ORDER BY category, name");
259    
260      $output = '';
261      $category = NULL;
262    while ($feature = db_fetch_object($result)) {    while ($feature = db_fetch_object($result)) {
263    
264      if ($feature->category != $category) {      if ($feature->category != $category) {

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.2