Source for file templates.php
Documentation is available at templates.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
$state->set('params', $params);
* Method to get the record form.
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @return JForm A JForm object on success, false on failure
public function getForm($data =
array(), $loadData =
true)
$form =
$this->loadForm('com_config.templates', 'templates', array('control' =>
'jform', 'load_data' =>
$loadData));
$form =
new JForm('com_config.templates');
// Load the data into the form
* Method to preprocess the form
* @param JForm $form A form object.
* @param mixed $data The data expected for the form.
* @param string $group Plugin group to load
* @throws Exception if there is an error in the form event.
protected function preprocessForm(JForm $form, $data, $group =
'content')
// Load the core and/or local language file(s).
$lang->load('tpl_' .
$template, JPATH_BASE, null, false, true)
||
$lang->load('tpl_' .
$template, JPATH_BASE .
'/templates/' .
$template, null, false, true);
// Look for com_config.xml, which contains fileds to display
// If com_config.xml not found, fall back to templateDetails.xml
// Get the template form.
if (!$form->loadFile($formFile, false, '//config'))
throw
new Exception(JText::_('JERROR_LOADFILE_FAILED'));
// Attempt to load the xml file.
throw
new Exception(JText::_('JERROR_LOADFILE_FAILED'));
// Trigger the default form events.
Documentation generated on Tue, 19 Nov 2013 15:15:37 +0100 by phpDocumentor 1.4.3