Browse Source

bookmarks change view mode

Signed-off-by: bachy <git@g-u-i.net>
bachy 12 years ago
parent
commit
f207e56b2d
2 changed files with 13 additions and 7 deletions
  1. 5 2
      materio_flag.module
  2. 8 5
      materio_flag.pages.inc

+ 5 - 2
materio_flag.module

@@ -99,14 +99,17 @@ function materio_flag_menu() {
 
    $items['materioflag/ajax/list/%'] = $base+array(
     'page callback' => 'materio_flag_ajax_list',
-    'access arguments' => array('create flag lists'),
-    'access callback' => 'user_access',
+    'access callback' => 'materio_access_ajax_flags',
     'page arguments' => array(3, 4),
   );
 
   return $items;
 }
 
+function materio_access_ajax_flags(){
+  return ( user_access('create flag lists') || user_access('flag bookmarks') );
+}
+
 /**
  * Implements hook_menu_alter().
  */

+ 8 - 5
materio_flag.pages.inc

@@ -422,10 +422,13 @@ function materio_flag_ajax_list($fid, $page = 0){
   $debug = false;
 
   $_GET['page'] = $page;
-
-  $list_path = 'lists';
-
-  $path = $list_path.'/'.$fid;
+  if($fid = 1){
+    $list_path = $path = 'bookmarks';
+  }else{
+    $list_path = 'lists';
+    $path = $list_path.'/'.$fid;  
+  }
+  
 
   // check if request is ajax, if not rediret to search_api_page page with right keys
   if (!$debug && (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest')) {
@@ -459,7 +462,7 @@ function materio_flag_ajax_list($fid, $page = 0){
   menu_set_active_item($path);
   $return = menu_execute_active_handler($path, FALSE);
 
-  // dsm($return, '$return');
+  dsm($return, '$return');
   
   if (is_int($return)) {
     switch ($return) {