| Topic: | Graphical submit buttons with pnForm |
|---|---|
|
ntward
Freshman
Posts: 37 Posted: |
For GUI consistency I'm sure people will want to use those nice new graphical buttons in their .8 modules. Here is a plugin that should do the trick. Note: Although it works for my purposes, it may contain bugs. It is basically a munge of the pnRender plugins function.pnbutton.php and function.pnformbutton.php Code removed, see later posts. I hope that someone else finds this useful. Cheers edited by: ntward, Feb 21, 2007 - 10:08 AM |
|
AmmoDump
Team Member
Posts: 3024 Posted: |
Nice. You should package it and release it in the 'plugins' section. -- David Pahl Zikula Support Team |
|
ntward
Freshman
Posts: 37 Posted: |
Ah, I hadn't seen the plugins section. Oops. Okay, we'll see. Cheers |
|
JørnWildt
Helper
Posts: 245 Posted: |
Please note that pnForms already contains a pnFormImageButton |
|
ntward
Freshman
Posts: 37 Posted: |
So it does, the SVN version I was using at the time didn't. However, their style isn't consistent with the other graphical buttons. Does pnForms have anything similar to the selector_category plugin? I've made something similar but... edited by: ntward, Feb 10, 2007 - 01:42 PM |
|
JørnWildt
Helper
Posts: 245 Posted: |
QuoteDoes pnForms have anything similar to the selector_category plugin? I've made something similar but... No, unfortunately not, it should have although. |
|
ntward
Freshman
Posts: 37 Posted: |
Should I put it in the feature requests? As the above code was shocking, the following is simpler: Just replae the line Code$result = "<input type=\"image\" name=\"$fullName\" title=\"$text\" alt=\"$text\" value=\"$text\" src=\"$imageUrl\"$onclickHtml{$attributes}/>"; with Code$result = "<button type=\"$type\" name=\"$fullName\" title=\"$text\" $onclickHtml{$attributes}><img src=\"$imageUrl\" alt=\"$text\" /></button>"; and replace the function decode() with Codereturn $result; } function decode(&$render) { $fullName = $this->id . '_' . $this->commandName; if (isset($_POST[$fullName])) { $args = array('commandName' => $this->commandName, 'commandArgument' => $this->commandArgument); if (!empty($this->onCommand)) if ($render->pnFormRaiseEvent($this->onCommand, $args) === false) return false; } return true; } } Although this won't give you click coords. Perhaps this could also be included as a seperate plugin? pnForms is really good, thank a lot! |
|
JørnWildt
Helper
Posts: 245 Posted: |
As you say yourself then you won't get click coords - which can be important for someone. So I would say you should add it as a feature request - then we can make a specialized plugin or parameterize the original pnFormButton. I think the pnFormImageButton should stay as it is. |
|
ntward
Freshman
Posts: 37 Posted: |
Hi Jørn, Have added the category selector to the feature requests. The image button was a bit of a wild goose chase really - I've finally got CSS to work so that they look the same - I had previously been thrown by one of the comments in the plugin. Anyway, it's all sorted |
|
bones12
Freshman
Posts: 3 Posted: |
hi,
@Jørn is there a progress in work with the pnformplugin for categories?? Our CalendarModule need it very much. mfg bones |
|
JørnWildt
Helper
Posts: 245 Posted: |
No progress so far (but if you keep popping up with a reminder I probably will fix it ... some day) |
|
bones12
Freshman
Posts: 3 Posted: |
Jorn, first a big fat please, second a reason. We are working on a calendar for PN. Take a look http://www.firmennetz-usedom.de here. And third all ohter Developer would also have a thank you for you. Is it bad english?? Do you understand me?? |
|
JørnWildt
Helper
Posts: 245 Posted: |
@bones12: sorry, I have to prioritize my time, I just don't have 48 hours a day. So right now it's Mediashare and PN .8 core *bugfixes* |
|
bones12
Freshman
Posts: 3 Posted: |
ok thanks, i make a popup reminder in 4 weeks mfg bones |