2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_Preferences extends Zend_Form
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->setDecorators([
|
|
|
|
['ViewScript', ['viewScript' => 'form/preferences.phtml']],
|
|
|
|
]);
|
2012-07-11 00:55:44 +02:00
|
|
|
|
2011-04-03 23:34:44 +02:00
|
|
|
$general_pref = new Application_Form_GeneralPreferences();
|
2014-10-01 21:36:17 +02:00
|
|
|
|
2015-05-21 16:17:05 +02:00
|
|
|
// $this->addElement('hash', 'csrf', array(
|
|
|
|
// 'salt' => 'unique',
|
|
|
|
// 'decorators' => array(
|
|
|
|
// 'ViewHelper'
|
|
|
|
// )
|
|
|
|
// ));
|
|
|
|
|
|
|
|
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
|
|
|
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
|
|
|
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
|
|
|
|
$this->addElement($csrf_element);
|
2014-10-01 21:36:17 +02:00
|
|
|
|
2011-04-03 23:34:44 +02:00
|
|
|
$this->addSubForm($general_pref, 'preferences_general');
|
2012-07-11 00:55:44 +02:00
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// tunein form
|
2015-05-13 22:05:37 +02:00
|
|
|
$tuneinPreferences = new Application_Form_TuneInPreferences();
|
|
|
|
$this->addSubForm($tuneinPreferences, 'preferences_tunein');
|
|
|
|
|
2015-05-13 21:55:36 +02:00
|
|
|
$danger_pref = new Application_Form_DangerousPreferences();
|
|
|
|
$this->addSubForm($danger_pref, 'preferences_danger');
|
|
|
|
|
2015-01-15 22:28:18 +01:00
|
|
|
$submit = new Zend_Form_Element_Submit('submit');
|
|
|
|
$submit->setLabel(_('Save'));
|
2022-03-14 11:15:04 +01:00
|
|
|
// $submit->removeDecorator('Label');
|
2021-10-11 16:10:47 +02:00
|
|
|
$submit->setAttribs(['class' => 'btn right-floated']);
|
2015-01-15 22:28:18 +01:00
|
|
|
$submit->removeDecorator('DtDdWrapper');
|
|
|
|
|
|
|
|
$this->addElement($submit);
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
|
|
|
}
|