# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- C:\wamp\www\drupal-6.6\sites\all\modules\nodeadmin\nodeadmin.module
+++ C:\Documents and Settings\JSCL\My Documents\Descargas\nodeadmin\nodeadmin.module
@@ -17,15 +17,8 @@
  * Implementation of hook_perm().
  */
 function nodeadmin_perm() {
-
-  $ctypes = node_get_types();
-  $permissions = array();
-  $permissions[] = 'access content administration';
-  foreach ($ctypes as $ctype => $cdata) {
-    $permissions[] = 'view '.$cdata->type;
+  return array('access content administration');
   }
-    return $permissions;
-}
 
 /**
  * Implementation of hook_menu().
@@ -78,22 +71,25 @@
   $types = array();
   $ctypes = node_get_types();
   foreach ($ctypes as $ctype => $cdata) {
-    if(user_access('view '.$cdata->type))
         $types[$ctype] = $cdata->name;
   }
 
   // generate content administration page
-  $output = '<div class="nodeadmin-options"><div>'.t('Filter by type:').' <select id="filterType"><option value="" selected>'.t('All').'</option>';
+  $output = '<div class="nodeadmin-options"><div>Filter by type: <select id="filterType"><option value="" selected>All</option>';
   foreach ($types as $ctype => $cname) {
     $output .= '<option value="' . $ctype .'">'. $cname .'</option>';
   }
   $output .= '</select></div>';
-  $output .= '<div>'.t('Filter by author:').' <input id="filterUser" type="text" size="20" value="" /></div>';
+  $output .= '<div>Filter by author: <input id="filterUser" type="text" size="20" value="" /></div>';
   if (module_exists('search')) {
-    $output .= '<div>'.t('Filter by text content:').'<input id="filterText" type="text" size="20" value="" /></div>';
+    $output .= '<div>Filter by text content: <input id="filterText" type="text" size="20" value="" /></div>';
   }
-  $output .= '<div>'.t('Results per page:').' <input id="optionLimit" type="text" size="6" value="50" /><span id="numberResults">&nbsp;</span><div id="pageResults"></div></div>';
-  $output .= '</div><br/>';
+  $output .= '<div>Results per page: <input id="optionLimit" type="text" size="6" value="50" /><span id="numberResults">&nbsp;</span><div id="pageResults"></div></div>';
+  $output .= '</div><br/><div class="nodeadmin-addnode"><img src="'. $base_url .'/'. drupal_get_path('module', 'nodeadmin') .'/icons/doc-option-add.png" width="16" height="16" /> Add new content by type: <select id="addType"><option value="" selected></option>';
+  foreach ($ctypes as $ctype => $cdata) {
+    $output .= '<option value="' . $ctype .'">'. $cdata->name .'</option>';
+  }
+  $output .= '</select></div>';
 
   $results = array();
   nodeadmin_ajax_query($results);
@@ -104,9 +100,9 @@
   if (is_array($node_data) && count($node_data)) {
     foreach ($node_data as $nid => $node) {
       $links = '';
-      $links .= "<a href='?q=node/{$node->nid}' title='". t('View') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-tab.png' alt='". t('View') ."' width='16' height='16' /></a>";
-      $links .= " <a href='?q=node/{$node->nid}/edit' title='". t('Edit') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-edit.png' alt='". t('Edit') ."' width='16' height='16' /></a>";
-      $links .= " <a href='?q=node/{$node->nid}/delete' title='". t('Delete') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-remove.png' alt='". t('Delete') ."' width='16' height='16' /></a>";
+      $links .= "<a href='javascript:viewNode({$node->nid})' title='". t('View') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-tab.png' alt='". t('View') ."' width='16' height='16' /></a>";
+      $links .= " <a href='javascript:editNode({$node->nid})' title='". t('Edit') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-edit.png' alt='". t('Edit') ."' width='16' height='16' /></a>";
+      $links .= " <a href='javascript:deleteNode({$node->nid})' title='". t('Delete') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-remove.png' alt='". t('Delete') ."' width='16' height='16' /></a>";
       $row = array(
         array(
           'data' => $links,
@@ -221,29 +217,7 @@
     $qwheres[] = 'u.name = "%s" ';
     $args[] = check_plain($options['filterUser']);
   }
-
-  $counter = 0;
-  $where_types = '';
-  $ctypes = node_get_types();
-  $types = array();
-  foreach ($ctypes as $ctype => $cdata) {
-    if(user_access('view '.$cdata->type)){
-        if($counter == 1)
-        {
-                    $where_types .= ' OR ';
-        }
-
-        $where_types .= ' n.type=\''.$cdata->type.'\'';
-        $counter = 1;
-    }
-  }
-  if(!empty($where_types))
-    $qwhere = 'WHERE ('.$where_types.') ';
-  //Setting what can be seen
   if (count($qwheres)) {
-    if(!empty($where_types))
-        $qwhere = 'WHERE ('.$where_types.') AND '. join('AND ', $qwheres) .' ';
-    else
         $qwhere = 'WHERE '. join('AND ', $qwheres) .' ';
   }
 
