SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 244 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

In this example, we retrieve the parameters from the POST
array (assuming that the form is submitted using the POST method), add them to the
user's existing parameters, rebind them to the user object, and save the changes:
// get the user object and the post array.
$user =& JFactory::getUser();
$post = JRequest::get('post');
// get the existing parameters
$params = $user->getParameters();
// add the parameters from the form submission
$params->bind($post['myparams']);
// update and save the user
$user->set('params', $params->toString());
$user->save();
The last option we will explore is modifying the users.xml file. To do this, we will
utilize the JSimpleXML parser. For a complete description of the JSimpleXML parser,
please refer to Chapter 10.
Extension Design
[ 182 ]
The first thing we need to do is get hold of the XML file and parse the contents:
// get a parser
$parser =& JFactory::getXMLParser('Simple');
// define the path to the XML file
$pathToXML_File = JPATH_ADMINISTRATOR.DS.'components'.


Pages:
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6