SF.net SVN: phpwiki:[10891] trunk/lib/plugin/UserPreferences.php

vargenau--- via phpwiki-checkins <[email protected]> Wed, 12 Jan 2022 17:08:23 +0000
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10891
          http://sourceforge.net/p/phpwiki/code/10891
Author:   vargenau
Date:     2022-01-12 17:08:23 +0000 (Wed, 12 Jan 2022)
Log Message:
-----------
UserPreferences plugin has no arguements

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

Modified: trunk/lib/plugin/UserPreferences.php
===================================================================
--- trunk/lib/plugin/UserPreferences.php	2022-01-12 16:14:08 UTC (rev 10890)
+++ trunk/lib/plugin/UserPreferences.php	2022-01-12 17:08:23 UTC (rev 10891)
@@ -28,9 +28,6 @@
  * This must be used in the page "UserPreferences".
  * Prefs are stored in metadata in the current session,
  *  within the user's home page or in a database.
- *
- * WikiTheme extension: WikiThemes are able to extend the predefined list
- * of preferences.
  */
 
 class WikiPlugin_UserPreferences
@@ -45,24 +42,7 @@
 
     function getDefaultArguments()
     {
-        global $request;
-        $user = $request->getUser();
-        if (isset($user->_prefs) and
-            isset($user->_prefs->_prefs) and
-                isset($user->_prefs->_method)
-        ) {
-            $pref =& $user->_prefs;
-        } else {
-            $pref = $user->getPreferences();
-        }
-        $prefs = array();
-        if ($pref) {
-            // We need a hash of pref => default_value
-            foreach ($pref->_prefs as $name => $obj) {
-                $prefs[$name] = $obj->default_value;
-            }
-        }
-        return $prefs;
+        return array();
     }
 
     /**
@@ -94,13 +74,11 @@
             $no_args = $this->getDefaultArguments();
             $no_args['errmsg'] = HTML::p(array('class' => 'error'),
                 _("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved."));
-            $no_args['isForm'] = false;
             return Template('userprefs', $no_args);
         }
         $userid = $user->UserName();
         if ($user->isAuthenticated() and !empty($userid)) {
             $pref = &$request->_prefs;
-            $args['isForm'] = true;
 
             if ($request->isPost()) {
                 $errmsg = '';

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