Only in /var/www/crm/sites/all/modules/views/modules: .svn
Only in /var/www/crm/sites/all/modules/views/po: .svn
Only in /var/www/crm/sites/all/modules/views/: .svn
diff -urp downloads/drupal50/views/views.module /var/www/crm/sites/all/modules/views/views.module
--- downloads/drupal50/views/views.module	2007-05-04 23:40:18.000000000 -0300
+++ /var/www/crm/sites/all/modules/views/views.module	2007-05-15 14:05:41.000000000 -0300
@@ -52,6 +52,11 @@ function views_menu_standard_items(&$ite
       continue;
     }
 
+    // Skip views with advanced php menu access code
+    if ( $view->menu_access_php && $view->menu_access_php != '' ) {
+      continue;
+    }
+
     // unpack the array
     $view->access = ($view->access ? explode(', ', $view->access) : array());
 
@@ -218,6 +223,16 @@ function _views_create_menu_item(&$items
     $weight = $view->menu_tab_weight;
   }
   $access = views_access($view);
+
+  // if the view has advanced menu code to assign access to the menu item, us it
+  if ( $access && $view->menu_access_php && $view->menu_access_php != '' ) {
+    ob_start();
+    $result = eval($view->menu_access_php);
+    ob_end_clean();
+
+    $access &= $result;
+  }
+
   $items[] = _views_menu_item($path, $title, $view, $args, $access, $type, $weight);
 
   if ($type == MENU_DEFAULT_LOCAL_TASK) {
@@ -855,6 +870,7 @@ function _views_view_fields() {
     'menu_tab_default_parent_type' => "'%s'",
     'menu_parent_title' => "'%s'", 
     'menu_parent_tab_weight' => '%d', 
+    'menu_access_php' => "'%s'",
     'block' => '%d', 
     'block_title' => "'%s'", 
     'block_use_page_header' => '%d', 
diff -urp downloads/drupal50/views/views_ui.module /var/www/crm/sites/all/modules/views/views_ui.module
--- downloads/drupal50/views/views_ui.module	2007-05-04 23:40:18.000000000 -0300
+++ /var/www/crm/sites/all/modules/views/views_ui.module	2007-05-15 14:06:56.000000000 -0300
@@ -1017,6 +1017,30 @@ function views_edit_view($view, $op = ''
     '#description' => t('If the Parent Menu Item is being defined by this view (if you set the %type_field to either %tab or %menu), you can specify its title here.  If blank, the menu title will be used if that is defined, or the page title if not.', array('%type_field' => t('Parent Menu Item Type'), '%tab' => t('Tab'), '%menu' => t('Normal menu item'))),
   );
 
+  $access = user_access('use PHP for block visibility');
+  if ($access) {
+    $form['page-info']['menu-info']['menu_access_php_fieldset'] = array(
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => empty($view->menu_access_php) ? TRUE : FALSE,
+      '#title' => t('Menu Access Code'),
+    );
+
+    $form['page-info']['menu-info']['menu_access_php_fieldset']['menu_access_php'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Menu Access Code'),
+      '#default_value' => $view->menu_access_php,
+      '#cols' => 60,
+      '#rows' => 6,
+      '#description' => '<p>'. t('Advanced Usage Only: PHP code that returns a boolean to the menu system, this code may control whether a menu item or tab is accesible or not. Should not include &lt;?php ?&gt; delimiters.') .'</p>',
+    );
+  } else {
+    $form['page-info']['menu-info']['menu_access_php_fieldset']['menu_access_php'] = array(
+      '#type' => 'value',
+      '#value' => $view->menu_access_php,
+    );
+  }
+
   // block info
 
   $form['block-info'] = array(
