2011-01-21 00:30:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_AddShowWho extends Zend_Form_SubForm
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
// Add hosts autocomplete
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->addElement('text', 'add_show_hosts_autocomplete', [
|
|
|
|
'label' => _('Search Users:'),
|
|
|
|
'class' => 'input_text ui-autocomplete-input',
|
|
|
|
'required' => false,
|
|
|
|
]);
|
2011-01-21 00:30:53 +01:00
|
|
|
|
2021-10-11 16:10:47 +02:00
|
|
|
$options = [];
|
2012-07-11 00:55:44 +02:00
|
|
|
$hosts = Application_Model_User::getHosts();
|
2011-01-21 00:30:53 +01:00
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
foreach ($hosts as $host) {
|
|
|
|
$options[$host['index']] = $host['label'];
|
|
|
|
}
|
2011-01-21 00:30:53 +01:00
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// Add hosts selection
|
2012-07-11 00:55:44 +02:00
|
|
|
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
|
2012-11-15 16:59:06 +01:00
|
|
|
$hosts->setLabel(_('DJs:'))
|
2022-01-23 19:15:55 +01:00
|
|
|
->setMultiOptions($options);
|
2011-01-21 00:30:53 +01:00
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
$this->addElement($hosts);
|
2011-01-21 00:30:53 +01:00
|
|
|
}
|
|
|
|
|
2012-08-29 05:04:55 +02:00
|
|
|
public function disable()
|
|
|
|
{
|
2012-03-30 21:11:24 +02:00
|
|
|
$elements = $this->getElements();
|
2012-08-29 05:04:55 +02:00
|
|
|
foreach ($elements as $element) {
|
|
|
|
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
2021-10-11 16:10:47 +02:00
|
|
|
$element->setAttrib('disabled', 'disabled');
|
2012-03-30 21:11:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-01-21 00:30:53 +01:00
|
|
|
}
|