Kunena 7.0.2 Released

The Kunena team has announce the arrival of Kunena 7.0.2 [K 7.0.2] in stable which is now available for download as a native Joomla extension for J! 5.3.x/5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Question Add the ability to add classes to buttons in the Widget/Button factory.

More
9 years 8 months ago - 9 years 8 months ago #176570 by jhebbel
Was going to commit these suggestions myself to git, but there appears to be a bunch of other changes already in the works in the affected files.

Crypsisb3\layouts\widget\button\default.php
Modify desired template to add $btnclass:
Code:
\\ add this with the other variable definitions $btnclass = !empty($this->btnclass) ? ' '.$this->btnclass : ''; \\ change the button class to include the var <a <?php echo $id; ?> class="<?php echo $normal . $primary . $success . $right . $btnclass; ?>" href="<?php echo $this->url; ?>" rel="nofollow" title="<?php echo $title; ?>" name="<?php echo $this->name; ?>" <?php echo $modal; ?>> <?php if (!empty($icon)) : ?> <i class="<?php echo $icon;?>"></i> <?php endif; ?> <?php echo $label; ?> </a>

ComponentKunenaControllerMessageItemActionsDisplay
Add $btnclass to getButton function and extend the properties sent to the factory
Code:
public function getButton($url, $name, $scope, $type, $id = null, $normal = true, $icon = '', $btnclass = '') { return KunenaLayout::factory('Widget/Button') ->setProperties(array('url' => KunenaRoute::_($url), 'name' => $name, 'scope' => $scope, 'type' => $type, 'id' => $id, 'normal' => $normal, 'icon' => $icon, 'btnclass' => $btnclass)); }


This part is optional as you have expressed that you do not want to colorize the buttons such as delete, but users that do would simply only change this:
Code:
$this->messageButtons->set('delete', $this->getButton(sprintf($task, 'delete'), 'delete', 'message', 'moderation', null, $button, 'fa fa-trash'));
to this:
Code:
$this->messageButtons->set('delete', $this->getButton(sprintf($task, 'delete'), 'delete', 'message', 'moderation', null, $button, 'fa fa-trash', 'btn-danger'));
Last edit: 9 years 8 months ago by jhebbel.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #176571 by 810
i have improved the button now, they have now id's with the button names.

So if you want your changes, you only need to add this on your custom.less
Code:
#btn_report { background-color: #ec971f; } #btn_delete { background-color: #c9302c; }

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #176572 by sozzled

810 wrote: I have improved the button now. They have now IDs with the button names.

Good idea and it's certainly a lot easier than constructing CSS like
Code:
.btn-small[name~="delete"] { background-color: #c9302c; }
although
Code:
a.report { background-color: #ec971f; }
also works, too.

I like some of jhebbel's ideas.

If we could only extend the use of TITLE or ALT attributes to other buttons/widgets/glyphs within Crypsis, we would have a template that's actually accessible to visually-impaired forum users, eh?

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago - 9 years 8 months ago #176574 by jhebbel

810 wrote: i have improved the button now, they have now id's with the button names.

So if you want your changes, you only need to add this on your custom.less

Code:
#btn_report { background-color: #ec971f; } #btn_delete { background-color: #c9302c; }


Thats a good step, but my goal was to be able to implement bootstrap classes into the buttons without creating new css for them, both certain acheive the end result, but bootstrap ensures everything will be nice an uniform. Otherwise why even use BS.

Also, in your implementation, they should probibly be classes not IDs, as I believe the CSS spec states IDs *should* be unique.

This stuff is just my own implementation changes I am making

I notice that in RC 3 there are 2 delete buttons, one created if you are a mod and one created if you are the author, I combined these into 1 as 2 are not needed. Also brought the message buttons to a single line and got rid of the reply that was under each post (repetitive). I also broke out the actions dropdown for the topic.

This is starting to look a lot more like what I and my users have come accustomed to, still got a lot more work I want to do however and not enough time lol.

Last edit: 9 years 8 months ago by jhebbel.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #176578 by 810

I also broke out the actions dropdown for the topic


This is already a option: Edit template - basic settings - Show default actions = No

If you want to turn off groups

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago - 9 years 8 months ago #176579 by jhebbel

810 wrote:

I also broke out the actions dropdown for the topic


This is already a option: Edit template - basic settings - Show default actions = No

If you want to turn off groups


Unless its a bug, that only did it for the messages' dropdowns, my goal was to do it for the actions dropdown at the bottom of the topic aswell thus surfacing the "Reply Topic" button. I did however keep the Moderation for the topic in a dropdown as it is lesser used. Again, the second half of my post were just things I found aesthetically pleasing, some people may not want it the way I am doing it.
Last edit: 9 years 8 months ago by jhebbel.

Please Log in or Create an account to join the conversation.

Time to create page: 0.256 seconds