- Moderated by:
- Support Team
-
- rank:
-
Freshman
- registered:
- January 2007
- Status:
- offline
- last visit:
- 16.07.08
- Posts:
- 37
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 -
- rank:
-
Freshman
- registered:
- January 2007
- Status:
- offline
- last visit:
- 16.07.08
- Posts:
- 37
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 -
- rank:
-
Freshman
- registered:
- January 2007
- Status:
- offline
- last visit:
- 16.07.08
- Posts:
- 37
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
Code
return $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! -
- rank:
-
Helper
- registered:
- July 2002
- Status:
- offline
- last visit:
- 07.09.08
- Posts:
- 245
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. -
- rank:
-
Freshman
- registered:
- January 2007
- Status:
- offline
- last visit:
- 16.07.08
- Posts:
- 37
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
-
- rank:
-
Freshman
- registered:
- June 2007
- Status:
- offline
- last visit:
- 21.06.07
- Posts:
- 3
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??
-
- rank:
-
Helper
- registered:
- July 2002
- Status:
- offline
- last visit:
- 07.09.08
- Posts:
- 245
@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*
