Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Graphical submit buttons with pnForm
  • Posted: 29.01.2007, 04:48
     
    ntward
    rank:
    Freshman 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
  • Posted: 29.01.2007, 06:04
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    Nice. You should package it and release it in the 'plugins' section.

    --
    David Pahl
    Zikula Support Team
  • Posted: 29.01.2007, 18:41
     
    ntward
    rank:
    Freshman Freshman
    registered:
     January 2007
    Status:
    offline
    last visit:
    16.07.08
    Posts:
    37
    Ah, I hadn't seen the plugins section. Oops.

    Okay, we'll see.

    Cheers
  • Posted: 07.02.2007, 13:40
     
    JørnWildt
    rank:
    Helper Helper
    registered:
     July 2002
    Status:
    offline
    last visit:
    07.09.08
    Posts:
    245
    Please note that pnForms already contains a pnFormImageButton icon_cool
  • Posted: 09.02.2007, 17:41
     
    ntward
    rank:
    Freshman 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
  • Posted: 10.02.2007, 22:28
     
    JørnWildt
    rank:
    Helper Helper
    registered:
     July 2002
    Status:
    offline
    last visit:
    07.09.08
    Posts:
    245

    Quote

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


    No, unfortunately not, it should have although.
  • Posted: 21.02.2007, 15:07
     
    ntward
    rank:
    Freshman 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!
  • Posted: 21.02.2007, 20:03
     
    JørnWildt
    rank:
    Helper 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.
  • Posted: 22.02.2007, 17:37
     
    ntward
    rank:
    Freshman 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 icon_smile
  • Posted: 20.06.2007, 18:00
     
    bones12
    rank:
    Freshman Freshman
    registered:
     June 2007
    Status:
    offline
    last visit:
    21.06.07
    Posts:
    3
    hi, @Jørn is there a progress in work with the pnformplugin for categories?? Our CalendarModule need it very much.

    mfg bones
  • Posted: 21.06.2007, 01:30
     
    JørnWildt
    rank:
    Helper Helper
    registered:
     July 2002
    Status:
    offline
    last visit:
    07.09.08
    Posts:
    245
    No progress so far (but if you keep popping up with a reminder I probably will fix it ... some day) icon_smile
  • Posted: 21.06.2007, 02:12
     
    bones12
    rank:
    Freshman 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?? icon_biggrin icon_biggrin
  • Posted: 21.06.2007, 17:03
     
    JørnWildt
    rank:
    Helper 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*
  • Posted: 21.06.2007, 17:48
     
    bones12
    rank:
    Freshman Freshman
    registered:
     June 2007
    Status:
    offline
    last visit:
    21.06.07
    Posts:
    3
    ok thanks, i make a popup reminder in 4 weeks icon_cool

    mfg bones

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula