Fork me on GitHub

Graphical submit buttons with pnForm  Bottom

  • 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
  • Nice. You should package it and release it in the 'plugins' section.

    --
    David Pahl
    Zikula Support Team
  • Ah, I hadn't seen the plugins section. Oops.

    Okay, we'll see.

    Cheers
  • Please note that pnForms already contains a pnFormImageButton icon_cool
  • 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
  • Quote

    Does pnForms have anything similar to the selector_category plugin? I've made something similar but...


    No, unfortunately not, it should have although.
  • 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!
  • 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.
  • 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 icon_smile
  • hi, @Jørn is there a progress in work with the pnformplugin for categories?? Our CalendarModule need it very much.

    mfg bones
  • No progress so far (but if you keep popping up with a reminder I probably will fix it ... some day) icon_smile
  • 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?? icon_biggrin icon_biggrin
  • @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*
  • ok thanks, i make a popup reminder in 4 weeks icon_cool

    mfg bones

This list is based on users active over the last 60 minutes.