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
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Graphical submit buttons with pnForm
-
- Rank: Registered User
- Registered: Jan 28, 2007
- Last visit: Apr 16, 2009
- Posts: 43
-
- Rank: Team Member
- Registered: Dec 07, 2003
- Last visit: May 09, 2010
- Posts: 2703
Nice. You should package it and release it in the 'plugins' section.
--
David Pahl
Zikula Support Team -
- Rank: Registered User
- Registered: Jan 28, 2007
- Last visit: Apr 16, 2009
- Posts: 43
Ah, I hadn't seen the plugins section. Oops.
Okay, we'll see.
Cheers -
- Rank: Softmore
- Registered: Jul 02, 2002
- Last visit: Oct 21, 2009
- Posts: 240
-
- Rank: Registered User
- Registered: Jan 28, 2007
- Last visit: Apr 16, 2009
- Posts: 43
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: Softmore
- Registered: Jul 02, 2002
- Last visit: Oct 21, 2009
- Posts: 240
Quote
Does pnForms have anything similar to the selector_category plugin? I've made something similar but...
No, unfortunately not, it should have although. -
- Rank: Registered User
- Registered: Jan 28, 2007
- Last visit: Apr 16, 2009
- Posts: 43
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: Softmore
- Registered: Jul 02, 2002
- Last visit: Oct 21, 2009
- Posts: 240
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: Registered User
- Registered: Jan 28, 2007
- Last visit: Apr 16, 2009
- Posts: 43
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: Softmore
- Registered: Jul 02, 2002
- Last visit: Oct 21, 2009
- Posts: 240
No progress so far (but if you keep popping up with a reminder I probably will fix it ... some day)
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 20, 2007
- 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: Softmore
- Registered: Jul 02, 2002
- Last visit: Oct 21, 2009
- Posts: 240
@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*
- Moderated by:
- Support
