diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2017-08-20 16:03:48 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2017-08-20 16:03:48 +0000 |
commit | ca49335826eb4dae32e0bb280f9a36fea0de71e0 (patch) | |
tree | aff5b3837077d7d926e1bd6b57d2d5848ba1722c /scripts/forms.php | |
parent | 67e4f9657c47480b6118db92b51bdcfd0228b9ae (diff) | |
download | pmwiki.svn-ca49335826eb4dae32e0bb280f9a36fea0de71e0.tar.bz2 |
Update all files for PHP 7.2, still compatible with PHP 5
git-svn-id: svn://pmwiki.org/pmwiki/trunk@3317 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts/forms.php')
-rw-r--r-- | scripts/forms.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/scripts/forms.php b/scripts/forms.php index 05819477..d8bfeff0 100644 --- a/scripts/forms.php +++ b/scripts/forms.php @@ -1,5 +1,5 @@ <?php if (!defined('PmWiki')) exit(); -/* Copyright 2005-2015 Patrick R. Michaud (pmichaud@pobox.com) +/* Copyright 2005-2017 Patrick R. Michaud (pmichaud@pobox.com) This file is part of PmWiki; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -64,14 +64,27 @@ SDVA($InputTags['default'], array(':fn' => 'InputDefault')); SDVA($InputTags['defaults'], array(':fn' => 'InputDefault')); ## (:input ...:) directives -Markup_e('input', 'directives', +Markup('input', 'directives', '/\\(:input\\s+(\\w+)(.*?):\\)/i', - "InputMarkup(\$pagename, \$m[1], \$m[2])"); + "MarkupInputForms"); ## (:input select:) has its own markup processing -Markup_e('input-select', '<input', +Markup('input-select', '<input', '/\\(:input\\s+select\\s.*?:\\)(?:\\s*\\(:input\\s+select\\s.*?:\\))*/i', - "InputSelect(\$pagename, 'select', \$m[0])"); + "MarkupInputForms"); + +function MarkupInputForms($m) { + extract($GLOBALS["MarkupToHTML"]); # get $pagename, $markupid + switch ($markupid) { + case 'input': + return InputMarkup($pagename, $m[1], $m[2]); + case 'input-select': + return InputSelect($pagename, 'select', $m[0]); + case 'e_preview': + return isset($GLOBALS['FmtV']['$PreviewText']) + ? Keep($GLOBALS['FmtV']['$PreviewText']): ''; + } +} ## The 'input+sp' rule combines multiple (:input select ... :) ## into a single markup line (to avoid split line effects) @@ -310,9 +323,8 @@ if (@$_REQUEST['editform']) { $Conditions['e_preview'] = '(boolean)$_REQUEST["preview"]'; # (:e_preview:) displays the preview of formatted text. -Markup_e('e_preview', 'directives', - '/^\\(:e_preview:\\)/', - "isset(\$GLOBALS['FmtV']['\$PreviewText']) ? Keep(\$GLOBALS['FmtV']['\$PreviewText']): ''"); +Markup('e_preview', 'directives', + '/^\\(:e_preview:\\)/', "MarkupInputForms"); # If we didn't load guiedit.php, then set (:e_guibuttons:) to # simply be empty. |