Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#94 new plugin: PopUpPlugin

1.3.x
closed
Reini Urban
None
5
2012-10-11
2004-10-27
Nicolas Noble
No

I created a plugin for PhpWiki, which can create
clickable popup links in a phpwiki page. I am actually
using it with a (fixed) version of UploadPlugin, in
order to offer an "upload" link from within the
EditPage template.

I've attached the whole plugin within the patch.

Discussion

  • Nicolas Noble
    Nicolas Noble
    2004-10-27

    PopUp Plugin's code.

     
    Attachments
  • Reini Urban
    Reini Urban
    2004-11-24

    Logged In: YES
    user_id=13755

    Nice.
    Can I see your modified upload plugin?

    PopUp will be added to CVS, just the default link is
    questionable.

    Some commonly used helptext or a list of plugins or
    categories to insert into the current page would be fine.

     
  • Logged In: NO

    Sure... only problem is I am patching phpwiki very often so
    it matches my needs, so, I maybe have to sort out things.
    Well, first, this is the patch against UpLoad.php:

    diff -u -r1.17 UpLoad.php
    --- lib/plugin/UpLoad.php 9 Nov 2004 08:15:50 -0000
    1.17
    +++ lib/plugin/UpLoad.php 24 Nov 2004 19:30:40 -0000
    @@ -108,6 +108,9 @@
    $contents->pushContent(HTML::input(array('type' =>
    'hidden',
    'name' =>
    'MAX_FILE_SIZE',
    'value' =>
    MAX_UPLOAD_SIZE)));
    + $contents->pushContent(HTML::input(array('type' =>
    'hidden',
    + 'name' =>
    'pagename',
    + 'value' =>
    $basepage)));
    $contents->pushContent(HTML::input(array('name' =>
    'userfile',
    'type' =>
    'file',
    'size' =>
    '50')));
    @@ -180,7 +183,7 @@
    $current =
    $pagehandle->getCurrentRevision();
    $version = $current->getVersion();
    $text = $current->getPackedContent();
    - $newtext = $text . "\n
    [Upload:$userfile_name]";
    + $newtext = $text . "\n

    Upload:$userfile_name";
    $meta = $current->data;
    $meta['summary'] =
    sprintf(
    ("uploaded %s"),$userfile_name);
    $pagehandle->save($newtext,
    $version + 1, $meta);
    @@ -207,7 +210,7 @@
    global $WikiTheme;
    $user = $GLOBALS['request']->user;
    if (!is_writable($upload_log)) {
    - $message->pushContent(
    ("Error: the upload log
    is not writable"));
    + $message->pushContent(_("Error: the upload log
    $upload_log is not writable"));
    $message->pushContent(HTML::br());
    }
    elseif (!$log_handle = fopen ($upload_log, "a")) {

    and I think I had an issue elsewhere, that I fixed using
    this ugly hack:

    diff -u -r1.217 stdlib.php
    --- lib/stdlib.php 16 Nov 2004 17:31:03 -0000 1.217
    +++ lib/stdlib.php 24 Nov 2004 19:30:38 -0000
    @@ -169,7 +169,8 @@
    if (!empty($GLOBALS['WikiTheme']->HTML_DUMP_SUFFIX))
    $url .= $GLOBALS['WikiTheme']->HTML_DUMP_SUFFIX;
    if ($args)
    - $url .= "?$args";
    + if ($args != "action=browse")
    + $url .= "?$args";
    }
    else {
    $url = $get_abs_url ? SERVER_URL . SCRIPT_NAME :
    basename(SCRIPT_NAME);

    Anyway, you can see it working live at my wiki at
    http://wiki.nobis-crew.org - you have an upload link at
    bottom of each edit page, using the following code inside
    the TextFormattingRules page:

     
  • Reini Urban
    Reini Urban
    2004-11-28

    Logged In: YES
    user_id=13755

    Added to CVS. Thanks.