update
- added materio_user.module (add permission to view the profile page) - materio_serach_api.pages : limit actu items for anonymous - materio_search_api_ajax.pages & materio_flag.pages : redirect to real page if current page not corresponding on ajax request (solve the view mode block visibility on user edit profile page) - materio_flag : added edit lists functionalities ++ get_list_page_title func Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
@@ -57,7 +57,27 @@ function materio_flag_menu() {
|
||||
'page arguments' => array(3),
|
||||
);
|
||||
|
||||
$items['materioflag/editlistform/%/%'] = $base+array(
|
||||
'access arguments' => array('create flag lists'),
|
||||
'access callback' => 'user_access',
|
||||
'page callback' => 'materio_flag_editlist_form',
|
||||
'page arguments' => array(2,3),
|
||||
);
|
||||
|
||||
$items['materioflag/editlist/%/%'] = $base+array(
|
||||
'access arguments' => array('create flag lists'),
|
||||
'access callback' => 'user_access',
|
||||
'page callback' => 'materio_flag_edit_list',
|
||||
'page arguments' => array(2,3),
|
||||
);
|
||||
|
||||
$items['materioflag/deletelist/%'] = $base+array(
|
||||
'access arguments' => array('create flag lists'),
|
||||
'access callback' => 'user_access',
|
||||
'page callback' => 'materio_flag_delete_list',
|
||||
'page arguments' => array(2,3),
|
||||
);
|
||||
|
||||
$items['materioflag/nodelinks'] = $base+array(
|
||||
'access arguments' => array('create flag lists'),
|
||||
'access callback' => 'user_access',
|
||||
@@ -66,7 +86,7 @@ function materio_flag_menu() {
|
||||
);
|
||||
|
||||
$items['lists/%'] = $base+array(
|
||||
'access arguments' => array('create flag lists'),
|
||||
'access arguments' => array('view flag lists'),
|
||||
'access callback' => 'user_access',
|
||||
'page callback' => 'materio_flag_user_lists',
|
||||
'page arguments' => array(1),
|
||||
@@ -82,6 +102,18 @@ function materio_flag_menu() {
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_menu_alter().
|
||||
*/
|
||||
function materio_flag_menu_alter(&$items) {
|
||||
// Example - disable the page at node/add
|
||||
/*
|
||||
*$items['node/add']['access callback'] = FALSE;
|
||||
*/
|
||||
// disable tabs on user page
|
||||
$items['user/%user/flags/lists']['access callback'] = false;
|
||||
$items['user/%user/flags/lists/%']['access callback'] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_block_info().
|
||||
@@ -162,12 +194,13 @@ function materio_flag_block_view($delta = '') {
|
||||
}
|
||||
|
||||
if(isset($lists)){
|
||||
$block['subject'] = t('My !listname'.'s', array('!listname'=>t(variable_get('flag_lists_name', 'list'))));
|
||||
// $block['subject'] = t('My !listname'.'s', array('!listname'=>t(variable_get('flag_lists_name', 'list'))));
|
||||
$block['subject'] = t('My '.variable_get('flag_lists_name', 'list').'s');
|
||||
$block['content'] = theme('materio_flag_mylists_block', array("lists"=>$lists, "viewmode"=>"bookmark"));
|
||||
// $block['content'] = theme('flag_lists_user_page', array('uid' => $user->uid));
|
||||
}else{
|
||||
|
||||
$block['subject'] = t('My !listname'.'s', array('!listname'=>variable_get('flag_lists_name', 'list')));
|
||||
$block['subject'] = t('My '. variable_get('flag_lists_name', 'list') .'s');
|
||||
$block['content'] = t('No !listname yet. Add !listname on clicking on results star', array('!listname'=>variable_get('flag_lists_name', 'list')));
|
||||
}
|
||||
drupal_add_js(drupal_get_path('module', 'materio_flag').'/js/materio_flag-ck.js');
|
||||
@@ -183,7 +216,8 @@ function materio_flag_block_view($delta = '') {
|
||||
$flags[$name] = $flag;
|
||||
}
|
||||
|
||||
$block['subject'] = t('My !listname'.'s', array('!listname'=>variable_get('flag_lists_name', 'list')));
|
||||
// $block['subject'] = t('My !listname'.'s', array('!listname'=>variable_get('flag_lists_name', 'list')));
|
||||
$block['subject'] = t('My '.variable_get('flag_lists_name', 'list').'s');
|
||||
$block['content'] = theme('materio_flag_mylists_nav_block', array("flags"=>$flags));
|
||||
// $block['content'] = theme('flag_lists_user_page', array('uid' => $user->uid));
|
||||
}
|
||||
@@ -349,6 +383,25 @@ function materio_flag_get_entity_links($entity, $type, $view_mode = null){
|
||||
return;
|
||||
}
|
||||
|
||||
function _materio_flag_get_listpagetitle($flag){
|
||||
$cont = '<i class="icon-materio-folder"></i>';
|
||||
$cont .= '<span class="'.$flag->name.'">'.check_plain($flag->title).'</span>';
|
||||
|
||||
if(flag_lists_is_owner('edit', $flag->fid)){
|
||||
|
||||
$cont .= l('<i class="icon-wrench"></i>',
|
||||
'flags/lists/edit/'.$flag->fid,
|
||||
array(
|
||||
'html'=>true,
|
||||
'attributes'=>array('class'=>array('edit-list', $flag->name)),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $cont;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
|
||||
Reference in New Issue
Block a user