From: <var...@us...> - 2008-10-16 09:03:11
|
Revision: 6305 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6305&view=rev Author: vargenau Date: 2008-10-16 09:02:10 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Update poll Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2008-10-16 08:43:27 UTC (rev 6304) +++ trunk/lib/plugin/WikiPoll.php 2008-10-16 09:02:10 UTC (rev 6305) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /* Copyright 2004 $ThePhpWikiProgrammingTeam + Copyright 2008 Marc-Etienne Vargenau, Alcatel-lucent This file is part of PhpWiki. @@ -33,10 +34,10 @@ question[4]="What wiki engine do you like most?" answer[4][1]="c2Wiki" answer[4][2]="MoinMoin" answer[4][3]="PhpWiki" answer[4][4]="usemod" answer[4][5]="Twiki" answer[4][5]="guiki" - answer[4][6]="Other" + answer[4][6]="Mediawiki" answer[4][7]="Other" question[5]="Which PhpWiki version do you use?" - answer[5][1]="1.2.x" answer[5][2]="1.3. 1-2" answer[5][3]="1.3.3-4" - answer[5][4]="1.3.5-8" + answer[5][1]="1.2.x" answer[5][2]="1.3.1-12" answer[5][3]="1.3.13" + answer[5][4]="1.3.14" ?> * * Administration: @@ -329,45 +330,6 @@ }; -// $Log: not supported by cvs2svn $ -// Revision 1.9 2004/06/16 10:38:59 rurban -// Disallow refernces in calls if the declaration is a reference -// ("allow_call_time_pass_reference clean"). -// PhpWiki is now allow_call_time_pass_reference = Off clean, -// but several external libraries may not. -// In detail these libs look to be affected (not tested): -// * Pear_DB odbc -// * adodb oracle -// -// Revision 1.8 2004/06/14 11:31:39 rurban -// renamed global $Theme to $WikiTheme (gforge nameclash) -// inherit PageList default options from PageList -// default sortby=pagename -// use options in PageList_Selectable (limit, sortby, ...) -// added action revert, with button at action=diff -// added option regex to WikiAdminSearchReplace -// -// Revision 1.7 2004/05/01 15:59:29 rurban -// more php-4.0.6 compatibility: superglobals -// -// Revision 1.6 2004/03/01 18:08:53 rurban -// oops, checked in the debug version. revert to IP check on -// -// Revision 1.5 2004/03/01 16:11:13 rurban -// graphical enhancement -// -// Revision 1.4 2004/02/26 01:42:27 rurban -// don't cache this at all -// -// Revision 1.3 2004/02/24 03:54:46 rurban -// lock page, more questions, new require_least arg -// -// Revision 1.2 2004/02/24 03:21:46 rurban -// enabled require_all check in WikiPoll -// better handling of <20 min visiting client: display results so far -// -// - // For emacs users // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2008-10-16 10:11:13
|
Revision: 6306 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6306&view=rev Author: vargenau Date: 2008-10-16 09:17:59 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Valid HTML code Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2008-10-16 09:02:10 UTC (rev 6305) +++ trunk/lib/plugin/WikiPoll.php 2008-10-16 09:17:59 UTC (rev 6306) @@ -171,7 +171,7 @@ unset($poll['ip'][$ip]); } $html = HTML::form(array('action' => $request->getPostURL(), - 'method' => 'POST')); + 'method' => 'post')); if ($request->isPost()) { // checkme: check if all answers are answered This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-08-19 16:17:12
|
Revision: 7067 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7067&view=rev Author: vargenau Date: 2009-08-19 16:17:03 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Valid XHTML code Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2009-08-08 18:13:23 UTC (rev 7066) +++ trunk/lib/plugin/WikiPoll.php 2009-08-19 16:17:03 UTC (rev 7067) @@ -266,7 +266,7 @@ 'name' => "answer[$i]", 'value' => $a)); if ($result >= 0) - $checkbox->setAttr('checked',1); + $checkbox->setAttr('checked', "checked"); if (!$readonly) list($percent,$count,$all) = $this->storeResult($page, $i, $result ? 1 : 0); else @@ -290,7 +290,7 @@ 'name' => "answer[$i]", 'value' => $j)); if ($result == $j) - $radio->setAttr('checked',1); + $radio->setAttr('checked', "checked"); $row->pushContent(HTML::tr(HTML::td($radio), HTML::td($a[$j]), HTML::td($this->bar($percent)), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2019-04-26 14:54:04
|
Revision: 10125 http://sourceforge.net/p/phpwiki/code/10125 Author: vargenau Date: 2019-04-26 14:54:02 +0000 (Fri, 26 Apr 2019) Log Message: ----------- Use warning banner Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2019-04-26 14:14:17 UTC (rev 10124) +++ trunk/lib/plugin/WikiPoll.php 2019-04-26 14:54:02 UTC (rev 10125) @@ -155,7 +155,8 @@ $disable_submit = false; if (isset($poll['ip'][$ip]) and ((time() - $poll['ip'][$ip]) < 20 * 60)) { //view at least the result or disable the Go button - $html = HTML(HTML::strong( + $html = HTML::div(); + $html->pushContent(HTML::div(array('class' => 'warning'), _("Sorry! You must wait at least 20 minutes until you can vote again!"))); $html->pushContent($this->doPoll($page, $request, $request->getArg('answer'), true)); return $html; @@ -183,7 +184,8 @@ // update statistics and present them the user return $this->doPoll($page, $request, $request->getArg('answer')); } else { - $html->pushContent(HTML::p(HTML::strong(_("Not enough questions answered!")))); + $html->pushContent(HTML::div(array('class' => 'warning'), _("Not enough questions answered!"))); + } } @@ -216,7 +218,7 @@ $html->pushContent(HTML::p(HTML::strong($q)), $row); } } - if (!$disable_submit) + if (!$disable_submit) { $html->pushContent(HTML::p( HTML::input(array('type' => 'submit', 'name' => "WikiPoll", @@ -224,9 +226,10 @@ HTML::input(array('type' => 'reset', 'name' => "reset", 'value' => _("Reset"))))); - else - $html->pushContent(HTML::p(), HTML::strong( + } else { + $html->pushContent(HTML::div(array('class' => 'warning'), _("Sorry! You must wait at least 20 minutes until you can vote again!"))); + } return $html; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-10-13 08:14:27
|
Revision: 10631 http://sourceforge.net/p/phpwiki/code/10631 Author: vargenau Date: 2021-10-13 08:14:24 +0000 (Wed, 13 Oct 2021) Log Message: ----------- lib/plugin/WikiPoll.php: better warning message; add spacing between buttons Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2021-10-13 07:46:45 UTC (rev 10630) +++ trunk/lib/plugin/WikiPoll.php 2021-10-13 08:14:24 UTC (rev 10631) @@ -182,7 +182,10 @@ // update statistics and present them the user return $this->doPoll($page, $request, $request->getArg('answer')); } else { - $html->pushContent(HTML::div(array('class' => 'warning'), _("Not enough questions answered!"))); + $html->pushContent(HTML::div(array('class' => 'warning'), + _("Not enough questions answered!") . " " + . sprintf(_("You must answer at least %d questions."), + $args['require_least']))); } } @@ -223,6 +226,7 @@ HTML::input(array('type' => 'submit', 'name' => "WikiPoll", 'value' => _("OK"))), + HTML::raw(' '), HTML::input(array('type' => 'reset', 'name' => "reset", 'value' => _("Reset"))))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-01 09:25:39
|
Revision: 9059 http://sourceforge.net/p/phpwiki/code/9059 Author: vargenau Date: 2014-09-01 09:25:35 +0000 (Mon, 01 Sep 2014) Log Message: ----------- Fix wiki test, broken test caused by wiki refactoring Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2014-08-27 16:18:17 UTC (rev 9058) +++ trunk/lib/plugin/WikiPoll.php 2014-09-01 09:25:35 UTC (rev 9059) @@ -72,8 +72,9 @@ function getArgs($argstr, $request = false, $defaults = array()) { - if ($defaults === false) + if (empty($defaults)) { $defaults = $this->getDefaultArguments(); + } //Fixme: on POST argstr is empty $args = array(); list ($argstr_args, $argstr_defaults) = $this->parseArgStr($argstr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-09 17:39:45
|
Revision: 9293 http://sourceforge.net/p/phpwiki/code/9293 Author: vargenau Date: 2014-11-09 17:39:41 +0000 (Sun, 09 Nov 2014) Log Message: ----------- Type compatibility Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2014-11-09 17:36:49 UTC (rev 9292) +++ trunk/lib/plugin/WikiPoll.php 2014-11-09 17:39:41 UTC (rev 9293) @@ -76,7 +76,7 @@ * @param array $defaults * @return array */ - function getArgs($argstr, $request = false, $defaults = array()) + function getArgs($argstr, $request = null, $defaults = array()) { if (empty($defaults)) { $defaults = $this->getDefaultArguments(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2019-05-02 16:21:51
|
Revision: 10126 http://sourceforge.net/p/phpwiki/code/10126 Author: vargenau Date: 2019-05-02 16:21:49 +0000 (Thu, 02 May 2019) Log Message: ----------- Add <label> Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2019-04-26 14:54:02 UTC (rev 10125) +++ trunk/lib/plugin/WikiPoll.php 2019-05-02 16:21:49 UTC (rev 10126) @@ -212,8 +212,10 @@ $row->pushContent(HTML::div( HTML::input(array('type' => 'radio', 'name' => "answer[$i]", - 'value' => $j)), - HTML::raw(" "), $a[$j])); + 'value' => $j, + 'id' => "answer[$i]-$j")), + HTML::raw(" "), + HTML::label(array('for' => "answer[$i]-$j"), $a[$j]))); } $html->pushContent(HTML::p(HTML::strong($q)), $row); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-10-13 07:46:46
|
Revision: 10630 http://sourceforge.net/p/phpwiki/code/10630 Author: vargenau Date: 2021-10-13 07:46:45 +0000 (Wed, 13 Oct 2021) Log Message: ----------- lib/plugin/WikiPoll.php:avoid failure with admin argument Modified Paths: -------------- trunk/lib/plugin/WikiPoll.php Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2021-10-12 17:14:07 UTC (rev 10629) +++ trunk/lib/plugin/WikiPoll.php 2021-10-13 07:46:45 UTC (rev 10630) @@ -46,9 +46,9 @@ function getDefaultArguments() { return array('page' => '[pagename]', - 'admin' => false, - 'require_all' => 1, // 1 if all questions must be answered - 'require_least' => 0, // how many at least + 'admin' => false, // boolean: view and reset statistics + 'require_all' => true, // boolean: if all questions must be answered + 'require_least' => 0, // how many at least ); } @@ -142,8 +142,7 @@ if (!$args['page']) { return $this->error(sprintf(_("A required argument “%s” is missing."), 'page')); } - if (!empty($args['admin']) and $request->_user->isAdmin()) { - // reset statistics + if (!empty($args['admin'])) { return $this->doPollAdmin($dbi, $request, $page); } extract($this->_args); @@ -155,7 +154,7 @@ if (isset($poll['ip'][$ip]) and ((time() - $poll['ip'][$ip]) < 20 * 60)) { //view at least the result or disable the Go button $html = HTML::div(); - $html->pushContent(HTML::div(array('class' => 'warning'), + $html->pushContent(HTML::p(array('class' => 'warning'), _("Sorry! You must wait at least 20 minutes until you can vote again!"))); $html->pushContent($this->doPoll($page, $request, $request->getArg('answer'), true)); return $html; @@ -334,4 +333,14 @@ return array($percent, $poll['data']['count'][$i][$j], $poll['data']['all'][$i]); } + // view and reset statistics + private function doPollAdmin($dbi, $request, $page) + { + if ($request->_user->isAdmin()) { + return HTML::p(array('class' => 'error'), _("Sorry, poll administration not yet implemented")); + } else { + return HTML::p(array('class' => 'error'), + _("You must be an administrator to reset statistics.")); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |