Subversion Repositories owmoduleforms

Compare Revisions

Ignore whitespace Rev 31 → Rev 32

/trunk/classes/formelements/owformfieldset.php
3,6 → 3,8
class owFormFieldset extends owFormContainer
{
 
var $type='fieldset';
public function __construct($options=array())
{
parent::__construct($options);
/trunk/classes/formelements/owforminput.php
5,6 → 5,7
var $http;
var $options;
var $value;
var $type = 'input';
 
public function __construct($options=array())
{
17,11 → 18,11
$html_common_input_attributes = array(
'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onmousedown', 'onmousemove', 'onmouseout',
'onmouseover', 'onmouseup', 'onkeydown', 'onkeypress', 'onkeyup', 'onselect','disabled', 'size', 'name'
);
);
 
$this->available_html_attributes = array_merge($this->available_html_attributes, $html_common_input_attributes);
$this->http = eZHTTPTool::instance();
$this->value = $this->getOption('default');
$this->available_html_attributes = array_merge($this->available_html_attributes, $html_common_input_attributes);
$this->http = eZHTTPTool::instance();
$this->value = $this->getOption('default');
}
 
public function checkRequired()
/trunk/classes/formelements/owformmarkup.php
2,7 → 2,7
 
class owFormMarkup extends owFormElement
{
 
var $type='markup';
}
 
?>
/trunk/classes/formelements/owformsubmit.php
2,12 → 2,13
 
class owFormSubmit extends owFormInput
{
 
var $type='submit';
public function __construct($options=array())
{
$this->setDefaultOption($options, 'name', 'submit');
$this->setDefaultOption($options, 'class', 'button');
$this->setDefaultOption($options, 'template_name', 'submit_confirm.tpl');
$this->setDefaultOption($options, 'template_path', 'owmoduleforms/submit_confirm.tpl');
$this->setDefaultOption($options, 'variables', array('confirm_message' => 'Form successfully submitted!'));
parent::__construct($options);
}
17,14 → 18,8
return array_key_exists($this->getName(), $_REQUEST) ? $this : false;
}
 
public function renderSubmit($form)
public function setVariablesToTemplate($form, $tpl)
{
$tpl = $form->getFormTemplate();
$variables = $this->getOption('variables');
foreach ($variables as $variable_name => $variable_value)
{
$tpl->setVariable($variable_name, $variable_value);
}
$submitted_data = array();
foreach($form->getSubmittedData() as $element)
{
34,12 → 29,23
'type' => get_class($element),
'value' => $element->getValue(),
);
 
}
$tpl->setVariable('submitted_data', $submitted_data);
return $tpl->fetch('design:owmoduleforms/'.$this->getOption('template_name'));
}
 
public function renderSubmit($form)
{
$tpl = $form->getFormTemplate();
$variables = $this->getOption('variables');
foreach ($variables as $variable_name => $variable_value)
{
$tpl->setVariable($variable_name, $variable_value);
}
$this->setVariablesToTemplate($form, $tpl);
return $tpl->fetch('design:'.$this->getOption('template_path'));
}
 
public function submit($form)
{
$form->validate($form->getHttpFormMethod());
/trunk/classes/formelements/owformcontainer.php
3,6 → 3,7
class owFormContainer extends owFormElement
{
var $form_elements;
var $type='container';
 
public function __construct($options=array())
{
/trunk/classes/formelements/owformimage.php
3,6 → 3,8
class owFormImage extends owFormInput
{
 
var $type='image';
public function __construct($options=array())
{
$this->checkForRequiredOption('src', $options);
/trunk/classes/formelements/owforminputbutton.php
2,7 → 2,7
 
class owFormInputButton extends owFormInput
{
 
var $type='button';
}
 
?>
/trunk/classes/formelements/owformhidden.php
3,6 → 3,8
class owFormHidden extends owFormInput
{
 
var $type='hidden';
public function __construct($options=array())
{
parent::__construct($options);
/trunk/classes/formelements/owformdatetime.php
2,6 → 2,7
 
class owFormDatetime extends owFormFieldset
{
var $type='datetime';
public function __construct($options=array())
{