bookmarks change view mode

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy 2013-03-08 10:17:19 +01:00
parent 06a4d254c2
commit f207e56b2d
2 changed files with 13 additions and 7 deletions

View File

@ -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().
*/

View File

@ -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) {