Actions

API15

JUser/getParameters

From Joomla! Documentation

< API15:JUser
Revision as of 17:17, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Method to get the user parameters

[Edit Descripton]

Description:JUser/getParameters

Syntax

& getParameters($loadsetupfile=false, $path=null)
Parameter Name Default Value Description
$loadsetupfile false If true, loads the parameters setup file. Default is false.
$path null Set the parameters setup file base path to be used to load the user parameters.

Returns

object The user parameters object

Defined in

libraries/joomla/user/user.php

Importing

jimport( 'joomla.user.user' );

Source Body

function &getParameters($loadsetupfile = false, $path = null)
{
        static $parampath;
 
        // Set a custom parampath if defined
        if( isset($path) ) {
                $parampath = $path;
        }
 
        // Set the default parampath if not set already
        if( !isset($parampath) ) {
                $parampath = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_users'.DS.'models';
        }
 
        if($loadsetupfile)
        {
                $type = str_replace(' ', '_', strtolower($this->usertype));
 
                $file = $parampath.DS.$type.'.xml';
                if(!file_exists($file)) {
                        $file = $parampath.DS.'user.xml';
                }
 
                $this->_params->loadSetupFile($file);
        }
        return $this->_params;
}

[Edit See Also] SeeAlso:JUser/getParameters

Examples

<CodeExamplesForm />