From: <var...@us...> - 2009-03-25 10:08:16
|
Revision: 6701 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6701&view=rev Author: vargenau Date: 2009-03-25 10:08:08 +0000 (Wed, 25 Mar 2009) Log Message: ----------- Use "th"; better variable naming; code factoring Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2009-03-25 09:56:20 UTC (rev 6700) +++ trunk/lib/plugin/AuthorHistory.php 2009-03-25 10:08:08 UTC (rev 6701) @@ -110,19 +110,19 @@ global $WikiTheme; // date & time formatting + $table = HTML::table(array('class'=> 'pagelist')); + $thead = HTML::thead(); + $tbody = HTML::tbody(); + if (! ($page == 'all')) { $p = $dbi->getPage($page); - $t = HTML::table(array('class'=> 'pagelist')); - $th = HTML::thead(); - $tb = HTML::tbody(); - - $th->pushContent(HTML::tr(HTML::td(array('align'=> 'right'), + $thead->pushContent(HTML::tr(HTML::th(array('align'=> 'right'), _("Version")), - $includeminor ? HTML::td(_("Minor")) : "", - HTML::td(_("Author")), - HTML::td(_("Summary")), - HTML::td(_("Modified")) + $includeminor ? HTML::th(_("Minor")) : "", + HTML::th(_("Author")), + HTML::th(_("Summary")), + HTML::th(_("Modified")) )); $allrevisions_iter = $p->getAllRevisions(); @@ -147,38 +147,28 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); - $tb->pushContent($tr); + $tbody->pushContent($tr); //$pagelist->addPage($rev->getPage()); } } $captext = fmt($includeminor ? "History of all major and minor edits by %s to page %s." : "History of all major edits by %s to page %s." , WikiLink($author, 'auto'), WikiLink($page, 'auto')); - $t->pushContent(HTML::caption($captext)); - $t->pushContent($th, $tb); } else { //search all pages for all edits by this author - ///////////////////////////////////////////////////////////// - - $t = HTML::table(array('class'=> 'pagelist')); - $th = HTML::thead(); - $tb = HTML::tbody(); - - $th->pushContent(HTML::tr(HTML::td(_("Page Name")), - HTML::td(array('align'=> 'right'), + $thead->pushContent(HTML::tr(HTML::th(_("Page Name")), + HTML::th(array('align'=> 'right'), _("Version")), - $includeminor ? HTML::td(_("Minor")) : "", - HTML::td(_("Summary")), - HTML::td(_("Modified")) + $includeminor ? HTML::th(_("Minor")) : "", + HTML::th(_("Summary")), + HTML::th(_("Modified")) )); - ///////////////////////////////////////////////////////////// $allpages_iter = $dbi->getAllPages($includedeleted); while ($p = $allpages_iter->next()) { - ///////////////////////////////////////////////////////////// $allrevisions_iter = $p->getAllRevisions(); while ($rev = $allrevisions_iter->next()) { @@ -202,25 +192,23 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); - $tb->pushContent($tr); + $tbody->pushContent($tr); //$pagelist->addPage($rev->getPage()); } } - - ///////////////////////////////////////////////////////////// - } $captext = fmt($includeminor ? "History of all major and minor modifications for any page edited by %s." : "History of major modifications for any page edited by %s." , WikiLink($author, 'auto')); - $t->pushContent(HTML::caption($captext)); - $t->pushContent($th, $tb); } + $table->pushContent(HTML::caption($captext)); + $table->pushContent($thead, $tbody); + // if (!$noheader) { // total minor, major edits. if include minoredits was specified // } - return $t; + return $table; // if (!$noheader) { // $pagelink = WikiLink($page, 'auto'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-10-06 13:59:58
|
Revision: 7186 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7186&view=rev Author: vargenau Date: 2009-10-06 13:59:44 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Remove useless comments Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2009-10-06 10:07:24 UTC (rev 7185) +++ trunk/lib/plugin/AuthorHistory.php 2009-10-06 13:59:44 UTC (rev 7186) @@ -56,13 +56,8 @@ WikiDB_PageRevisionIterator(&$wikidb, &$revisions) */ - -/** - */ require_once('lib/PageList.php'); -//include_once('lib/debug.php'); - class WikiPlugin_AuthorHistory extends WikiPlugin { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-04 13:46:30
|
Revision: 8868 http://sourceforge.net/p/phpwiki/code/8868 Author: vargenau Date: 2014-06-04 13:46:26 +0000 (Wed, 04 Jun 2014) Log Message: ----------- Use CSS Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2014-06-04 13:41:05 UTC (rev 8867) +++ trunk/lib/plugin/AuthorHistory.php 2014-06-04 13:46:26 UTC (rev 8868) @@ -105,7 +105,7 @@ if (!($page == 'all')) { $p = $dbi->getPage($page); - $thead->pushContent(HTML::tr(HTML::th(array('align' => 'right'), + $thead->pushContent(HTML::tr(HTML::th(array('class' => 'align-right'), _("Version")), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Author")), @@ -123,13 +123,13 @@ $difflink = Button(array('action' => 'diff', 'previous' => 'minor'), $rev->getversion(), $rev); - $tr = HTML::tr(HTML::td(array('align' => 'right'), + $tr = HTML::tr(HTML::td(array('class' => 'align-right'), $difflink, $nbsp), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", HTML::td($nbsp, WikiLink($rev->get('author'), 'if_known'), $nbsp), HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('align' => 'right'), + HTML::td(array('class' => 'align-right'), $WikiTheme->formatdatetime($rev->get('mtime'))) ); @@ -147,7 +147,7 @@ //search all pages for all edits by this author $thead->pushContent(HTML::tr(HTML::th(_("Page Name")), - HTML::th(array('align' => 'right'), + HTML::th(array('class' => 'align-right'), _("Version")), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Summary")), @@ -169,11 +169,11 @@ HTML::td($nbsp, ($isminor ? $rev->_pagename : WikiLink($rev->_pagename, 'auto')) ), - HTML::td(array('align' => 'right'), + HTML::td(array('class' => 'align-right'), $difflink, $nbsp), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('align' => 'right'), + HTML::td(array('class' => 'align-right'), $WikiTheme->formatdatetime($rev->get('mtime')), $nbsp) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 14:28:47
|
Revision: 10292 http://sourceforge.net/p/phpwiki/code/10292 Author: vargenau Date: 2021-06-17 14:28:47 +0000 (Thu, 17 Jun 2021) Log Message: ----------- No sprintf needed Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2021-06-17 13:29:29 UTC (rev 10291) +++ trunk/lib/plugin/AuthorHistory.php 2021-06-17 14:28:47 UTC (rev 10292) @@ -58,7 +58,7 @@ function getDescription() { - return sprintf(_("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user.")); + return _("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user."); } function getDefaultArguments() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-02-22 12:38:20
|
Revision: 10250 http://sourceforge.net/p/phpwiki/code/10250 Author: vargenau Date: 2021-02-22 12:38:19 +0000 (Mon, 22 Feb 2021) Log Message: ----------- plugin AuthorHistory: better test boolean arguments "noheader", "includeminor" and "includedeleted" Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2021-02-22 12:28:09 UTC (rev 10249) +++ trunk/lib/plugin/AuthorHistory.php 2021-02-22 12:38:19 UTC (rev 10250) @@ -30,13 +30,13 @@ try this in a page called AuthorHistory: -<?plugin AuthorHistory page=username includeminor=true ?> +<<AuthorHistory page=username includeminor=true >> ---- -<?plugin AuthorHistory page=all ?> +<<AuthorHistory page=all >> try this in a subpage of your UserName: (UserName/AuthorHistory) -<?plugin AuthorHistory page=all includeminor=true ?> +<<AuthorHistory page=all includeminor=true >> * Display a list of revision edits by one particular user, for the * current page, a specified page, or all pages. @@ -49,13 +49,6 @@ */ -/* - reference - _PageHistory_PageRevisionIter - WikiDB_PageIterator(&$wikidb, &$pages - WikiDB_PageRevisionIterator(&$wikidb, &$revisions) -*/ - require_once 'lib/PageList.php'; class WikiPlugin_AuthorHistory @@ -96,6 +89,31 @@ { $this->_args = $this->getArgs($argstr, $request); extract($this->_args); + + if (($noheader == '0') || ($noheader == 'false')) { + $noheader = false; + } elseif (($noheader == '1') || ($noheader == 'true')) { + $noheader = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noheader")); + } + + if (($includeminor == '0') || ($includeminor == 'false')) { + $includeminor = false; + } elseif (($includeminor == '1') || ($includeminor == 'true')) { + $includeminor = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includeminor")); + } + + if (($includedeleted == '0') || ($includedeleted == 'false')) { + $includedeleted = false; + } elseif (($includedeleted == '1') || ($includedeleted == 'true')) { + $includedeleted = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includedeleted")); + } + if ($page && $page == 'username') //FIXME: use [username]!!!!! $page = $author; if (!$page || !$author) //user not signed in or no author specified This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-10 16:05:13
|
Revision: 10551 http://sourceforge.net/p/phpwiki/code/10551 Author: vargenau Date: 2021-09-10 16:05:12 +0000 (Fri, 10 Sep 2021) Log Message: ----------- lib/plugin/AuthorHistory.php: display error message when user not signed in and no author is specified. Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2021-09-10 13:14:12 UTC (rev 10550) +++ trunk/lib/plugin/AuthorHistory.php 2021-09-10 16:05:12 UTC (rev 10551) @@ -114,11 +114,11 @@ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includedeleted")); } + if (!$author) { // user not signed in and no author specified + return HTML::p(array('class' => 'error'), _("You are not signed in and no author is specified.")); + } if ($page && $page == 'username') //FIXME: use [username]!!!!! $page = $author; - if (!$page || !$author) //user not signed in or no author specified - return ''; - //$pagelist = new PageList($info, $exclude); $nbsp = HTML::raw(' '); @@ -162,16 +162,16 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); $tbody->pushContent($tr); - //$pagelist->addPage($rev->getPage()); } } - $captext = fmt($includeminor ? "History of all major and minor edits by %s to page %s." : "History of all major edits by %s to page %s.", - WikiLink($author, 'auto'), - WikiLink($page, 'auto')); + $captext = fmt($includeminor + ? "History of all major and minor edits by %s to page %s." + : "History of all major edits by %s to page %s.", + WikiLink($author, 'auto'), + WikiLink($page, 'auto')); } else { //search all pages for all edits by this author - $thead->pushContent(HTML::tr(HTML::th(_("Page Name")), HTML::th(array('class' => 'align-right'), _("Version")), @@ -206,38 +206,19 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); $tbody->pushContent($tr); - //$pagelist->addPage($rev->getPage()); } } } - $captext = fmt($includeminor ? "History of all major and minor modifications for any page edited by %s." : "History of major modifications for any page edited by %s.", - WikiLink($author, 'auto')); + $captext = fmt($includeminor + ? "History of all major and minor modifications for any page edited by %s." + : "History of major modifications for any page edited by %s.", + WikiLink($author, 'auto')); } $table->pushContent(HTML::caption($captext)); $table->pushContent($thead, $tbody); - // if (!$noheader) { - // total minor, major edits. if include minoredits was specified - // } return $table; - - // if (!$noheader) { - // $pagelink = WikiLink($page, 'auto'); - // - // if ($pagelist->isEmpty()) - // return HTML::p(fmt("No pages link to %s.", $pagelink)); - // - // if ($pagelist->getTotal() == 1) - // $pagelist->setCaption(fmt("One page links to %s:", - // $pagelink)); - // else - // $pagelist->setCaption(fmt("%s pages link to %s:", - // $pagelist->getTotal(), $pagelink)); - // } - // - // return $pagelist; } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |