2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_Preferences extends Zend_Form
|
|
|
|
{
|
2012-06-11 18:53:09 +02:00
|
|
|
private $isSaas;
|
2011-02-03 23:51:35 +01:00
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
2011-04-04 00:04:14 +02:00
|
|
|
$this->setAction('/Preference');
|
|
|
|
$this->setMethod('post');
|
2012-06-11 18:53:09 +02:00
|
|
|
|
|
|
|
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
|
|
|
$this->isSaas = $isSaas;
|
|
|
|
|
2011-04-03 23:34:44 +02:00
|
|
|
$this->setDecorators(array(
|
2012-06-11 18:53:09 +02:00
|
|
|
array('ViewScript', array('viewScript' => 'form/preferences.phtml', "isSaas" => $this->isSaas))
|
2011-03-18 22:15:12 +01:00
|
|
|
));
|
2011-11-07 23:43:38 +01:00
|
|
|
|
2011-04-03 23:34:44 +02:00
|
|
|
$general_pref = new Application_Form_GeneralPreferences();
|
|
|
|
$this->addSubForm($general_pref, 'preferences_general');
|
2012-02-06 23:51:02 +01:00
|
|
|
|
2012-06-11 18:53:09 +02:00
|
|
|
if (!$isSaas) {
|
|
|
|
$email_pref = new Application_Form_EmailServerPreferences();
|
|
|
|
$this->addSubForm($email_pref, 'preferences_email_server');
|
|
|
|
}
|
|
|
|
|
2011-04-03 23:34:44 +02:00
|
|
|
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
|
|
|
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
2011-04-02 22:33:45 +02:00
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$this->addElement('submit', 'submit', array(
|
2011-04-03 23:34:44 +02:00
|
|
|
'class' => 'ui-button ui-state-default right-floated',
|
2011-02-03 23:51:35 +01:00
|
|
|
'ignore' => true,
|
2011-11-07 23:43:38 +01:00
|
|
|
'label' => 'Save',
|
2011-04-03 23:34:44 +02:00
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
2011-06-21 10:24:02 +02:00
|
|
|
));
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
|
|
|
}
|