Support forums : Branches

dashboard plugin hooks

Discussion about existing branches and the directions they need to go in, or, for branches that are going to happen. "Quickies" is wide open. "Branches" is more focused.

Moderator: Dracones

Re: dashboard plugin hooks

Postby EdB » Wed Nov 02, 2011 4:27 pm

EdB wrote:_adminUI_general.class.php, comment out "require $templates_path.'_toolbar.inc.php';" and you're done.


Just bumped into a problem that one should be aware of. I commented out the line in my template's html_header file so I would not get a navbar on the public side. Problem is some of what I wanted to do in public depended on $current_User->Group, which for some reason is NULL for a logged in person when on the public side without a navbar.

Damn. That means either fixing that detail or tweaking the style sheet to deal with the 22 pixel shift when logged in. I went with code the first time because tweaking style sheets isn't my thing, but I've not got much interest in un-raveling the mysteries of $Group with or without a navbar.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: dashboard plugin hooks

Postby leeturner » Wed Nov 02, 2011 9:02 pm

Another example of the other app not understanding 'separation of concerns'.

Are you just wanting the toolbar to disappear on the public side when logged in ?

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: dashboard plugin hooks

Postby EdB » Wed Nov 02, 2011 11:34 pm

That was what I wanted to do, so I commented it out in the header file. And made it do the "you are not logged in" div. Positioning a background image with pixels, then positioning text to only cover the transparent parts of the image is the reason. I then noticed that a plugin was unable to identify current_user->Group->ID, and pre_dump( current_User ) showed me a group of NULL.

On a hunch it was leftovers from that other app I put the navbar back in and it fixed itself.

Therefore for both our futures, we should find a way to have a navbar not be seen when you're logged in AND have it still do whatever else it does. I've got this feeling more than just Group is jacked up but that could be paranoia eh? Anyway it might be something simple but I didn't look at all - I went in and did a "if logged_in() have a special bit of CSS" to push the image and text back down by 22 more pixels.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: dashboard plugin hooks

Postby leeturner » Thu Nov 17, 2011 6:43 pm

Before I post an update in launchpad I thought I would check here first. I have just downloaded the branch and tried it out and this is what I get:

Screen shot 2011-11-17 at 17.39.40.png
Screen shot 2011-11-17 at 17.39.40.png (185.03 KiB) Viewed 6249 times


First question - Should the DashbaordAdminMain be over in the sidebar ?

Also it fails when a blog is not selected:

Code: Select all
[17-Nov-2011 17:42:33] PHP Fatal error:  AdminUI_general::require() [<a href='function.require'>function.require</a>]: Failed opening required '/Applications/MAMP/htdocs/dashboard_plugin_hooks/qp_inc/collections/views/_blog_list.view.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/dashboard_plugin_hooks/qp_view_admin/_adminUI_general.class.php on line 502


Really like the warning about the install folder being there.

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: dashboard plugin hooks

Postby EdB » Thu Nov 17, 2011 7:23 pm

I'd say DAM should be on main not sidebar. Dunno why that would be on sidebar when there is also a DAS hook.

Does it fail with the test plugin installed and no blog selected, or just with no blog selected? In other words is this a plugin failure or a system failure?

The warning is in there? hmmm... I better look and see what I did. The way I run it, if /qp_install/index.php is found it gives a warning on dashboard and the write page. If that file is found and allow_db_reset is set to 1 it gives a bigger warning on dashboard and does a die() on the write page. The thing is since nobody wanted to check for the file instead of the sledgehammer approach to looking for the folder in general and I don't recall the warning being part of adding hooks I probably got more in there than QP wants. The specific file being the wrong thing.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: dashboard plugin hooks

Postby leeturner » Thu Nov 17, 2011 7:42 pm

EdB wrote:Does it fail with the test plugin installed and no blog selected, or just with no blog selected? In other words is this a plugin failure or a system failure?


It fails when the plugin is not installed also.

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: dashboard plugin hooks

Postby EdB » Mon Nov 21, 2011 4:53 pm

Just pushed a fix for this one. Problem was due to I've changed "collection" back to "blog" (and "chapter" back to "category") so it was looking for a file that doesn't exist in Quam Plures.

Will figure out why the hook is in a stupid place and fix that one next.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: dashboard plugin hooks

Postby leeturner » Mon Nov 21, 2011 6:01 pm

Cool. I'll re test when all is done.

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: dashboard plugin hooks

Postby EdB » Mon Nov 21, 2011 6:17 pm

This wasn't as easy as it should have been :( I got rid of calling a hook that got used when no blog was selected "Global" because to me global implies that it is not conditional.

  • DashboardBlogMain = main column, blog selected, after canned content
  • DashboardBlogSide = sidebar, blog selected, after canned content
  • DashboardNoBlogMain = main column, no blog, after canned content (blog table)
  • DashboardNoBlogSide = sidebar, no blog, after canned content
    DashboardAdminSide = sidebar, with or without a blog selected, "$current_User->check_perm( 'options', 'edit' )" must be true.

Off topic Gotta find a thread Lee was in recently concerning an old Yabs plugin and the "notes" field cuz I had me a great thought :)


Anyway I just committed these changes AFTER testing with and without a blog selected, and with and without test plugin installed.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Previous

Return to Branches

Who is online

Users browsing this forum: No registered users and 1 guest

cron