Merge lp:~quam-plures-core/quam-plures/qp_menu_items_no_blog into lp:quam-plures

Proposed by Lee Turner
Status: Merged
Merged at revision: 7578
Proposed branch: lp:~quam-plures-core/quam-plures/qp_menu_items_no_blog
Merge into: lp:quam-plures
Diff against target: 55 lines (+22/-2)
1 file modified
qp_inc/_core/__core.init.php (+22/-2)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/qp_menu_items_no_blog
Reviewer Review Type Date Requested Status
Yabs (community) Approve
Review via email: mp+44868@code.launchpad.net

Description of the change

http://forums.quamplures.net/viewtopic.php?f=16&t=641

This branch makes the blog specific items on the file menu and the 'blog settings' menu disabled when no blog is selected.

To post a comment you must log in.
Revision history for this message
Yabs (yabs) wrote :

Looks like it should work ;)

¥

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qp_inc/_core/__core.init.php'
2--- qp_inc/_core/__core.init.php 2010-09-04 20:01:31 +0000
3+++ qp_inc/_core/__core.init.php 2010-12-29 19:51:12 +0000
4@@ -165,8 +165,8 @@
5 // BLOG SETTINGS LINK
6 'blog_settings' => array(
7 'text' => T_('Blog settings'),
8- 'title' => T_('Blog settings, lists blogs'),
9- 'href' => $admin_url.'?ctrl=collections',
10+ 'title' => T_('No blog is currently selected'),
11+ 'disabled' => true,
12 ),
13 // GLOBAL SETTINGS LINK
14 'global_sets' => array(
15@@ -271,6 +271,8 @@
16 { // current user has some perms in a blog
17 $entries['blog_settings']['text'] = T_('Blog settings').' ◊';
18 $entries['blog_settings']['title'] = T_('Blog settings, lists blogs');
19+ $entries['blog_settings']['href'] = $admin_url.'?ctrl=collections';
20+ $entries['blog_settings']['disabled'] = false;
21 $entries['blog_settings']['entries'] = array(
22 'bloglabel' => array(
23 'text' => '<strong>'.sprintf( /* %s is blog shortname */ T_('Settings for %s'), $shortname ).'</strong>',
24@@ -431,6 +433,15 @@
25 'text' => T_('View BLOG Files').'&hellip;',
26 'href' => $admin_url.'?ctrl=files&amp;root=collection_'.$blog_id,
27 );
28+ if( empty($Blog) )
29+ {
30+ $entries['file_manager']['entries']['fm_view_blog'] = array(
31+ 'text' => T_('View BLOG Files').'&hellip;',
32+ 'href' => '',
33+ 'title' => T_('No blog is currently selected'),
34+ 'disabled' => true,
35+ );
36+ }
37 }
38 if( $Settings->get( 'fm_enable_roots_user' ) )
39 { // we have user files
40@@ -466,6 +477,15 @@
41 'text' => T_('Upload BLOG Files').'&hellip;',
42 'href' => $admin_url.'?ctrl=upload&amp;root=collection_'.$blog_id,
43 );
44+ if( empty($Blog) )
45+ {
46+ $entries['file_manager']['entries']['fm_add_blog'] = array(
47+ 'text' => T_('View BLOG Files').'&hellip;',
48+ 'href' => '',
49+ 'title' => T_('No blog is currently selected'),
50+ 'disabled' => true,
51+ );
52+ }
53 }
54 if( $Settings->get( 'fm_enable_roots_user' ) )
55 { // we have user files

Subscribers

People subscribed via source and target branches