Backend toolbar

13 years 5 months ago #146211 by KatoKalin
Backend toolbar was created by KatoKalin
I am trying to add buttons to the backend toolbar, similiar to the buttons 'New', 'Edit', 'Mass Mail' etc.

I did find a 'custom function' which seemt to do exactly what I need:
[code:1]* Writes a custom option and task button for the button bar
* @param string The task to perform (picked up by the switch($task) blocks
* @param string The image to display
* @param string The image to display when moused over
* @param string The alt text for the icon image
* @param boolean True if required to check that a standard list item is checked
*/
function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true, $prefix='' ) {
if ($listSelect) {
$onClick = "if (document.adminForm.boxchecked.value == 0){
alert('" . addslashes( sprintf( CBTxt::T('Please make a selection from the list to %s'), $alt) )."');
}else {
".$prefix."submitbutton('$task');
}";
} else {
$onClick = $prefix . "submitbutton('$task')";
}
// if ( $icon ) {
$icon = preg_replace( '/\.[^.]*$/', '', $icon );
echo cbMenuBarBase::_output( $onClick, $icon, $alt );
// }
}
[/code:1]

But I could not find a trigger for utilizing this function in any way. Before searching endlessly I am wondering if it is even possible without core hacking. Maybe somebody has a hint for me or a code example.

Please Log in to join the conversation.

13 years 5 months ago #146277 by krileon
Replied by krileon on topic Re:Backend toolbar

But I could not find a trigger for utilizing this function in any way. Before searching endlessly I am wondering if it is even possible without core hacking. Maybe somebody has a hint for me or a code example.

To use CBs menu functions you need to include CBs toolbar file. Once done you can use it's functions. There's no triggers or APIs for this that I am aware of. Our documentation subscriber incubator projects are examples of how to use CBs menu functions outside of core CB and in a CB plugin.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 5 months ago #146449 by KatoKalin
Replied by KatoKalin on topic Re:Backend toolbar
Thanks for your info. I think that helped to grasp that concept. However that strengthened my impression that this is only for the creation of new plugins.
I cannot imagine to simply add new buttons to the exising CB core component, mainly the user manager.
What I would like to achieve are additional buttons in the CB User Manager toolbar. I wonder if there is a way to create a plugin which simply does that without hacking the core.

Please Log in to join the conversation.

13 years 5 months ago #146486 by krileon
Replied by krileon on topic Re:Backend toolbar

What I would like to achieve are additional buttons in the CB User Manager toolbar.

As far as I can tell there's no triggers to do this. You'd need to make core edits to CBs toolbar files. They're clearly marked with "toolbar" in 1 place or another within CBs backend file structure. Believe there's about 3 of them, but 1 is just a router. 1 handles the tasks and 1 handles the rendering. Sorry I can't help you with core edits.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 5 months ago #146662 by KatoKalin
Replied by KatoKalin on topic Re:Backend toolbar
Ok. Thanks.
Maybe you have another idea to achieve what I am looking for?
Manually approving members can be a pain in a large community. I was looking for a mass solution:
Checking the check box of the users which should be approved and then clicking 'Approve' once only.
Otherwise it is a pain as the complete page refreshes everytime after approving or disapproving a user.

So what I am looking for is a mass action for approving/rejecting users. I thought this would fit perfectly into the toolbar. But maybe you have another idea to achieve this without hacking the core?

Please Log in to join the conversation.

13 years 4 months ago #146766 by krileon
Replied by krileon on topic Re:Backend toolbar
Changing just the toolbar wouldn't accomplish what you're wanting. The approval function is designed to handle a single user_id instead of an array of IDs, which is what a checkbox based form POST would send. Don't believe you can accomplish this without core hacks. You could make a new plugin that'll handle approval outside of User Management, but aside from that not sure what to suggest.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.170 seconds