Jump to content

Adminbar


apeisa

Recommended Posts

Thanks for these updates. We'd talked about getting AdminBar bundled into the core distribution and I still want to do that. If you still want to lets try and get it in before 2.2. I just need to update the Modules system to deal with duplicates in case someone upgrades a system that already has /site/modules/AdminBar/ installed.

Link to comment
Share on other sites

No worries about that Ryan. I think it might be good idea to wait a little before trying to put this into core distribution. I want to make this easily extendable so that other developers can add their own "bells and whistles" into Adminbar or maybe even release modules that support / use AdminBar. It is pretty easy already, but will test this more and with good time.

Also committed few updates:

  • Possibility to customize look and feel (=css) by adding AdminBarCustom.css to module folder.
  • added logout link and removed gear icon from admin button
  • If you delete page, it redirects to the parent page of removed page and shows better notification "My Poor Page moved to the trash"
  • Instead of always showing "Add page" it shows "New press-release" if press-release is only allowed child template. (changed "add" to "new" because pagelist uses that term. So it is "New page" or "New templatename"
Link to comment
Share on other sites

You see the edit button? Custom edit button from your template or adminbar edit button?

Custom user roles do need AdminBar permission to see and use adminbar. If you don't see that permission, please unistall & install adminbar.

Link to comment
Share on other sites

I can't deinstall the module, how can I fix that?

Notice: Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/PagesType.php on line 71

Notice: Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/PagesType.php on line 146

TemplateFile: Unable to delete pages of type ''
#0 [internal function]: PagesType->___delete(Object(NullPage))
#1 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#2 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('delete', Array)
#3 [internal function]: Wire->__call('delete', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/AdminBar/AdminBar.module(318): Permissions->delete(Object(NullPage))
#5 [internal function]: AdminBar->___uninstall()
#6 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#7 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('uninstall', Array)
#8 [internal function]: Wire->__call('uninstall', Array)
#9 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Modules.php(455): AdminBar->uninstall()
#10 [internal function]: Modules->___uninstall('AdminBar')
#11 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#12 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('uninstall', Array)
#13 [internal function]: Wire->__call('uninstall', Array)
#14 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/modules/Process/ProcessModule/ProcessModule.module(241): Modules->uninstall('AdminBar')
#15 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/modules/Process/ProcessModule/ProcessModule.module(184): ProcessModule->renderEdit('AdminBar', Array)
#16 [internal function]: ProcessModule->___executeEdit()
#17 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#18 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('executeEdit', Array)
#19 [internal function]: Wire->__call('executeEdit', Array)
#20 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/ProcessController.php(194): ProcessModule->executeEdit()
#21 [internal function]: ProcessController->___execute()
#22 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#23 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('execute', Array)
#24 [internal function]: Wire->__call('execute', Array)
#25 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/admin.php(45): ProcessController->execute()
#26 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/templates-admin/controller.php(13): require('/Applications/X...')
#27 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/templates/admin.php(13): require('/Applications/X...')
#28 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/TemplateFile.php(88): require('/Applications/X...')
#29 [internal function]: TemplateFile->___render()
#30 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#31 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('render', Array)
#32 [internal function]: Wire->__call('render', Array)
#33 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/modules/PageRender.module(194): TemplateFile->render()
#34 [internal function]: PageRender->___renderPage(Object(HookEvent))
#35 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#36 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('renderPage', Array)
#37 [internal function]: Wire->__call('renderPage', Array)
#38 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(289): PageRender->renderPage(Object(HookEvent))
#39 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('render', Array)
#40 [internal function]: Wire->__call('render', Array)
#41 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/modules/Process/ProcessPageView.module(73): Page->render()
#42 [internal function]: ProcessPageView->___execute()
#43 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(267): call_user_func_array(Array, Array)
#44 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/wire/core/Wire.php(229): Wire->runHooks('execute', Array)
#45 [internal function]: Wire->__call('execute', Array)
#46 /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/index.php(181): ProcessPageView->execute()
#47 {main}

Link to comment
Share on other sites

Good to know, thanks Soma.

For everyone else who might download the AdminBarNew: if you want others than superuser to see AdminBar, then you need to a) uninstall + install Adminbar or b) add new permission "adminbar" and give it those roles that you want to see adminbar. Installing adminbar does add that role automatically for you.

There is one annoying issue left in IE: it throws "Load jQuery first" alert when you have tinyMCE fields in your template and you close the edit view (using slide/modal). Working on this...

Link to comment
Share on other sites

Just updated branches that master is now for 2.1 and AB20 is for 2.0. AdminBarNew is no longer.

So if you cloned this from github, you probably want to do something like this:

git checkout master
git pull origin master

(or just remove whole folder and clone it again)

If you have downloaded and unzipped, then just download again, but now from master branch.

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

Thanks Andrew - definitely looks neat. Although not sure how good fit that is for "inline editor", since that requires textareas - where Mercury and Aloha do work with any element.

Not sure when and what I will develop for Adminbar next. So far it has served our client needs pretty well.

Link to comment
Share on other sites

  • 1 month later...

Does AdminBar support editing of pages different than currently visible in the browser? In other words.. If the visible page exist elsewhere in the PW but it is included and rendered based on a one or more segments.. is it possible to pass the real page->id to the AdminBar for editing instead of the page->id of the page with segments? Of course.. it will be great if after Save it returns to the initially displayed page with segments. :) Is it possible and/or easy to implement?

Thanks!

Link to comment
Share on other sites

I think that could be a good addition. There need's to be someway to tell AdminBar, that "editablePage" is different from "currentPage". Can you tell me more about the context you have this request? Using urlSegments probably?

Link to comment
Share on other sites

I mean urlSegments, sorry.

You understood me correctly. I was thinking if we could use a two session variables like "editablePage" and "redirectAfterSave" and to check if they exists before opening the AdminBar and after page save. I am not sure about any other way except session variables, probably you will have a better idea?

About the example context....

Lets assume we are storing our products pages in Home >> Products as children.

Also... we have categories stored in Home >> Categories and each Product page has a few Categories attached.

If we are browsing the www.example.com/categories/category_name/product_name/ we will see the product details page but actually if we open AdminBar we will edit www.example.com/categories/category_name/ if "/product_name/" is urlSegment1.

I am not sure if it is the best example, it is not the real one, but I am sure you understood me correctly.

What do you think? Should we use session variables or there is another way to pass php variables internally?

Link to comment
Share on other sites

I got it. Probably we can just add them as values for $page object, like this:

$page->abEditablePage = $pages->get($product_id);

$page->abRedirectPage = $page; // Not sure if this is ever required, we want always return to same url we were before editin?g

I'll hope to take a look with this sooner or later. Of course if you (or anyone else) likes to try hacking this you are more than welcome!

Link to comment
Share on other sites

  • 3 months later...
  • 11 months later...

No problem here with the scrolling on Mac with Chrome.

I recently discovered a different issue, however. On a couple of my sites I am using SSL (https) for some pages, or for all of the admin pages. I find that if there is a mismatch where the live page is regular http and the admin page is https (or the reverse of this also, I think), then clicking "edit" on the adminbar will result in an "Unknown Page" error.

It was just recently that I was able to narrow this issue down to only sites that use SSL. Hopefully this can be fixed!

Link to comment
Share on other sites

Hmm... not sure how to fix that. How have you setup your ssl? Or I mean where you define that admin is always SSL and public is not?

We have always setup so that logged in users are https, so it will load just fine.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...