Commit bc51cc30 authored by profix898's avatar profix898

- task: always add "Your Album" link (#269398)

parent f574876f
......@@ -13,13 +13,6 @@ define('GALLERY_SEARCH_SIZE_DEFAULT', 150);
define('GALLERY_FILTER_MAXSIZE_DEFAULT', 150);
define('GALLERY_FILTER_EXACTSIZE_DEFAULT', '');
/**
* Implementation of hook_perm().
*/
function gallery_perm() {
return array('administer gallery settings', 'access gallery');
}
/**
* Implementation of hook_theme().
*/
......@@ -56,6 +49,13 @@ function gallery_theme() {
);
}
/**
* Implementation of hook_perm().
*/
function gallery_perm() {
return array('administer gallery settings', 'access gallery');
}
/**
* Implementation of hook_init().
*/
......
......@@ -38,7 +38,8 @@ function gallery_menu_gallery_init_alter($params, $context) {
*/
function gallery_menu_menu() {
$items = array();
if (variable_get('gallery_valid', 0) && variable_get('gallery_menu_useralbum', 0)) {
$useralbum_exists = (gallery_single_plugin_status('useralbum') == GALLERY_PLUGIN_ENABLED);
if (variable_get('gallery_valid', 0) && $useralbum_exists) {
$items['useralbum'] = array(
'title' => 'Your Album',
'description' => 'Go to your Gallery2 useralbum.',
......@@ -288,14 +289,6 @@ function _gallery_menu_settings() {
'#options' => _gallery_range_array(1, MENU_MAX_PARTS),
'#description' => 'Depth of album hierarchy to include.'
);
$useralbum = (gallery_single_plugin_status('useralbum') == GALLERY_PLUGIN_ENABLED);
$form['menu']['gallery_menu_useralbum'] = array(
'#type' => 'checkbox',
'#title' => t('Add menu item for \'UserAlbum\''),
'#default_value' => $useralbum ? variable_get('gallery_menu_useralbum', 0) : FALSE,
'#description' => t('Adds a menu link to the navigation menu that points to a user\'s useralbum.'),
'#disabled' => !$useralbum
);
$form['menu']['rebuild_btn'] = array(
'#type' => 'submit',
'#value' => t('Rebuild menu'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment