SF.net SVN: phpwiki:[11039] trunk/themes/fusionforge/templates/ userprefs.tmpl

vargenau--- via phpwiki-checkins <[email protected]> Fri, 07 Jul 2023 13:06:08 +0000
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 11039
          http://sourceforge.net/p/phpwiki/code/11039
Author:   vargenau
Date:     2023-07-07 13:06:08 +0000 (Fri, 07 Jul 2023)
Log Message:
-----------
themes/fusionforge/templates/userprefs.tmpl: remove $isForm as in other themes

Modified Paths:
--------------
    trunk/themes/fusionforge/templates/userprefs.tmpl

Modified: trunk/themes/fusionforge/templates/userprefs.tmpl
===================================================================
--- trunk/themes/fusionforge/templates/userprefs.tmpl	2023-03-31 15:18:31 UTC (rev 11038)
+++ trunk/themes/fusionforge/templates/userprefs.tmpl	2023-07-07 13:06:08 UTC (rev 11039)
@@ -1,10 +1,6 @@
 <?php
-// Todo: Move the logic and code to the plugin
-// This is very experimental and the read-only part an ugly hack so far.
-foreach (explode(',', 'errmsg,isForm') as $var) {
-    if (empty($$var)) {
-        $$var = false;
-    }
+if (empty($errmsg)) {
+    $errmsg = '';
 }
 
 $plugin = $request->getArg('pagename');
@@ -17,18 +13,13 @@
 }
 $offset = $pref->get('timeOffset');
 $serverTime = $time - $offset * 3600;
-if ($isForm) {
-    $timeOffsetInput = HTML::input(array('type' => "text",
-                                         'id' => 'timeOffsetInput',
-                                         'size' => 6,
-                                         'maxlength' => 6,
-                                         'name' => "pref[timeOffset]",
-                                         'class' => "numeric",
-                                         'value' => $offset));
-} else {
-    $timeOffsetInput = $pref->get('timeOffset');
-}
-
+$timeOffsetInput = HTML::input(array('type' => "text",
+                                     'id' => 'timeOffsetInput',
+                                     'size' => 6,
+                                     'maxlength' => 6,
+                                     'name' => "pref[timeOffset]",
+                                     'class' => "numeric",
+                                     'value' => $offset));
 $OwnModificationsCB = HTML::input(array('type' => 'checkbox',
                                      'id' => 'ownModifications',
                                      'name' => 'pref[ownModifications]',
@@ -146,9 +137,7 @@
 <?php echo fmt("User preferences for user %s", WikiLink($user->UserName())) ?>
 </h2>
 
-<?php if ($isForm) { ?>
 <form action="<?php echo $request->getPostURL() ?>" method="post">
-<?php } ?>
 
 <fieldset style="margin-bottom: 1em;">
 <legend><strong><?php echo _("User preferences for this project") ?></strong></legend>
@@ -161,7 +150,6 @@
   </td></tr>
 
   <tr>
-    <?php if ($isForm) { ?>
       <td>
         <label for="notifyPages">
         <textarea id="notifyPages" name="pref[notifyPages]" cols="40" rows="6"><?php echo $pref->get('notifyPages') ?></textarea>
@@ -168,9 +156,6 @@
         </label>
       </td>
       <td><p class="hint"><?php echo _("Enter pages separated by space or comma. Wildcards (fileglobbing) allowed.") ?></p></td>
-    <?php } else { ?>
-      <td colspan="2"><?php echo $pref->get('notifyPages') ?></td>
-    <?php } ?>
    </tr>
 
 </table>
@@ -361,28 +346,16 @@
   <tr><td colspan="2"><h3><?php echo _("Edit Area Size") ?></h3></td></tr>
 
   <tr><td>
-    <?php if ($isForm) { ?>
     <label for="height">
-    <?php } ?>
     <?php echo _("Height") . _(":") ?>
-    <?php if ($isForm) { ?>
     </label>
      <input id="height" type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric"
             value="<?php echo $pref->get('editHeight') ?>" />
-    <?php } else { ?>
-      <?php echo $pref->get('editHeight') ?>
-    <?php } ?>
-    <?php if ($isForm) { ?>
     <label for="width">
-    <?php } ?>
     <?php echo _("Width") . _(":") ?>
-    <?php if ($isForm) { ?>
     </label>
      <input id="width" type="text" name="pref[editWidth]" size="4" maxlength="4" class="numeric"
             value="<?php echo $pref->get('editWidth') ?>" />
-    <?php } else { ?>
-      <?php echo $pref->get('editWidth') ?>
-    <?php } ?>
     </td>
     <td><p class="hint">
       <?php echo _("Note that many browsers will automatically adjust the width of the editing area so that it fills the browser window.  In this case, the width preference will be ignored.") ?></p>
@@ -421,7 +394,6 @@
 </table>
 </fieldset>
 
-<?php if ($isForm) { ?>
 <p>
   <?php echo Button("submit:", _("Update Preferences"), 'wikiadmin') ?>
   <?php echo Button("submit:delete", _("Reset Preferences"), 'wikiadmin') ?>
@@ -429,4 +401,3 @@
   <?php echo HiddenInputs($request->getArgs(), false, array('pref')) ?>
 </p>
 </form>
-<?php } ?>

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