SF.net SVN: phpwiki:[11099] trunk/lib/plugin/RecentCh anges.php

carstenklapp--- via phpwiki-checkins <[email protected]> Fri, 14 Feb 2025 05:20:25 +0000
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 11099
          http://sourceforge.net/p/phpwiki/code/11099
Author:   carstenklapp
Date:     2025-02-14 05:20:25 +0000 (Fri, 14 Feb 2025)
Log Message:
-----------
change to use theme buttons. updated for gettext

Modified Paths:
--------------
    trunk/lib/plugin/RecentChanges.php

Modified: trunk/lib/plugin/RecentChanges.php
===================================================================
--- trunk/lib/plugin/RecentChanges.php	2025-02-14 05:17:25 UTC (rev 11098)
+++ trunk/lib/plugin/RecentChanges.php	2025-02-14 05:20:25 UTC (rev 11099)
@@ -182,7 +182,10 @@
 
 class _RecentChanges_HtmlFormatter extends _RecentChanges_Formatter
 {
-    public function diffLink($rev)
+    /* Override this function in your theme/lib/RecentChanges.php
+       to omit the brackets or add other formatting in.
+     */
+       public function diffLink($rev)
     {
         global $WikiTheme;
         $button = $WikiTheme->makeButton(_("diff"), $this->diffURL($rev), 'wiki-rc-action');
@@ -386,13 +389,13 @@
             if ($timespan) {
                 if (intval($days) == 1) {
                     $desc = fmt(
-                        "The %d most recent %s during the past day are listed below.",
+                        _("The %d most recent %s during the past day are listed below."),
                         $limit,
                         $edits
                     );
                 } else {
                     $desc = fmt(
-                        "The %d most recent %s during the past %s days are listed below.",
+                        _("The %d most recent %s during the past %s days are listed below."),
                         $limit,
                         $edits,
                         $days
@@ -400,7 +403,7 @@
                 }
             } else {
                 $desc = fmt(
-                    "The %d most recent %s are listed below.",
+                    _("The %d most recent %s are listed below."),
                     $limit,
                     $edits
                 );
@@ -409,13 +412,13 @@
             if ($timespan) {
                 if (intval($days) == 1) {
                     $desc = fmt(
-                        "The %d oldest %s during the past day are listed below.",
+                        _("The %d oldest %s during the past day are listed below."),
                         $lmt,
                         $edits
                     );
                 } else {
                     $desc = fmt(
-                        "The %d oldest %s during the past %s days are listed below.",
+                        _("The %d oldest %s during the past %d days are listed below."),
                         $lmt,
                         $edits,
                         $days
@@ -423,7 +426,7 @@
                 }
             } else {
                 $desc = fmt(
-                    "The %d oldest %s are listed below.",
+                    _("The %d oldest %s are listed below."),
                     $lmt,
                     $edits
                 );
@@ -432,18 +435,18 @@
             if ($timespan) {
                 if (intval($days) == 1) {
                     $desc = fmt(
-                        "The most recent %s during the past day are listed below.",
+                        _("The most recent %s during the past day are listed below."),
                         $edits
                     );
                 } else {
                     $desc = fmt(
-                        "The most recent %s during the past %s days are listed below.",
+                        _("The most recent %s during the past %s days are listed below."),
                         $edits,
                         $days
                     );
                 }
             } else {
-                $desc = fmt("All %s are listed below.", $edits);
+                $desc = fmt(_("All %s are listed below."), $edits);
             }
         }
         return $desc;
@@ -1692,9 +1695,15 @@
             $label = sprintf(_("%s days"), abs($days_button));
         }
         $selected = HTML::td(array('class' => 'tdselected'), $label);
+
+        //Try to use theme buttons
+        global $WikiTheme;
+        $button = $WikiTheme->makeButton($label, $url, 'wiki-rc-action');
+        $button->setAttr('rel', 'nofollow');
+        //$button = HTML::a(array('href' => $url, 'class' => 'wiki-rc-action'), $label);//not themable
         $unselected = HTML::td(
             array('class' => 'tdunselected'),
-            HTML::a(array('href' => $url, 'class' => 'wiki-rc-action'), $label)
+            HTML("", $button, "") /*omit braces when using imgbutton*/
         );
         return ($days_button == $days) ? $selected : $unselected;
     }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.