style(legacy): force semicolon on same line (#1534)

This commit is contained in:
Jonas L 2022-01-23 19:15:55 +01:00 committed by GitHub
parent 522d989cab
commit 8569af9328
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 396 additions and 789 deletions

View file

@ -9,14 +9,12 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
$cb_airtime_auth = new Zend_Form_Element_Checkbox('cb_airtime_auth');
$cb_airtime_auth->setLabel(sprintf(_('Use %s Authentication:'), PRODUCT_NAME))
->setChecked(true)
->setRequired(false)
;
->setRequired(false);
$this->addElement($cb_airtime_auth);
$cb_custom_auth = new Zend_Form_Element_Checkbox('cb_custom_auth');
$cb_custom_auth->setLabel(_('Use Custom Authentication:'))
->setRequired(false)
;
->setRequired(false);
$this->addElement($cb_custom_auth);
//custom username
@ -27,8 +25,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
->setLabel(_('Custom Username'))
->setFilters(['StringTrim'])
->setValidators([
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
;
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
$this->addElement($custom_username);
//custom password
@ -40,8 +37,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
->setLabel(_('Custom Password'))
->setFilters(['StringTrim'])
->setValidators([
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
;
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
$this->addElement($custom_password);
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
@ -50,22 +46,19 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
$showSourceHost = new Zend_Form_Element_Text('show_source_host');
$showSourceHost->setAttrib('readonly', true)
->setLabel(_('Host:'))
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '')
;
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '');
$this->addElement($showSourceHost);
$showSourcePort = new Zend_Form_Element_Text('show_source_port');
$showSourcePort->setAttrib('readonly', true)
->setLabel(_('Port:'))
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '')
;
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '');
$this->addElement($showSourcePort);
$showSourceMount = new Zend_Form_Element_Text('show_source_mount');
$showSourceMount->setAttrib('readonly', true)
->setLabel(_('Mount:'))
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '')
;
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '');
$this->addElement($showSourceMount);
$this->setDecorators(

View file

@ -48,8 +48,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
->setMultiOptions(
[2 => _('day of the month'), 3 => _('day of the week')]
)
->setValue(2)
;
->setValue(2);
$this->addElement($repeatMonthlyType);
// Add end date element

View file

@ -77,8 +77,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
]]])
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->addFilter('ImageSize')
;
->addFilter('ImageSize');
$this->addElement($upload);
@ -99,8 +98,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
$csrf_element->setValue($csrf_namespace->authtoken)
->setRequired('true')
->removeDecorator('HtmlTag')
->removeDecorator('Label')
;
->removeDecorator('Label');
$this->addElement($csrf_element);
}

View file

@ -24,8 +24,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
'future' => _('In the Future:'),
])
->setValue('future')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
//$startDate->setAttrib('alt', 'date');
$this->addElement($startNow);
@ -39,8 +38,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([
$notEmptyValidator,
$dateValidator, ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startDate->setAttrib('alt', 'date');
$this->addElement($startDate);
@ -67,8 +65,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([
$notEmptyValidator,
$dateValidator, ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endDate->setAttrib('alt', 'date');
$this->addElement($endDate);
@ -81,8 +78,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([
$notEmptyValidator,
$regexValidator, ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endTime->setAttrib('alt', 'time');
$this->addElement($endTime);
@ -101,8 +97,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setMultiOptions(Application_Common_Timezone::getTimezones())
->setValue(Application_Model_Preference::GetUserTimezone())
->setAttrib('class', 'input_select add_show_input_select')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($timezone);
// Add repeats element

View file

@ -21,8 +21,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
$hosts->setLabel(_('DJs:'))
->setMultiOptions($options)
;
->setMultiOptions($options);
$this->addElement($hosts);
}

View file

@ -36,8 +36,7 @@ class Application_Form_AddTracktype extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 200]),
])
;
]);
$description->setAttrib('class', 'input_text');
$description->addFilter('StringTrim');
$this->addElement($description);

View file

@ -18,8 +18,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startDate->setAttrib('alt', 'date');
$this->addElement($startDate);
@ -33,8 +32,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startTime->setAttrib('alt', 'time');
$this->addElement($startTime);
@ -48,8 +46,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endDate->setAttrib('alt', 'date');
$this->addElement($endDate);
@ -63,8 +60,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endTime->setAttrib('alt', 'time');
$this->addElement($endTime);
}

View file

@ -25,8 +25,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$artwork->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 2048]),
])
;
]);
$file_id->addDecorator('HtmlTag', ['tag' => 'div', 'style' => 'display:none']);
$file_id->removeDecorator('Label');
$file_id->setAttrib('class', 'artwork');
@ -55,8 +54,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($track_title);
// Add artist field
@ -66,8 +64,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($artist_name);
// Add album field
@ -77,8 +74,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($album_title);
// Add album field
@ -121,8 +117,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($description);
// Add track number field
@ -130,8 +125,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$track_number->class = 'input_text';
$track_number->setLabel('Track Number:')
->setFilters(['StringTrim'])
->setValidators([new Zend_Validate_Int()])
;
->setValidators([new Zend_Validate_Int()]);
$this->addElement($track_number);
// Add genre field
@ -141,8 +135,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 64]),
])
;
]);
$this->addElement($genre);
// Add year field
@ -155,8 +148,7 @@ class Application_Form_EditAudioMD extends Zend_Form
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM-DD'),
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM'),
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY'),
])
;
]);
$this->addElement($year);
// Add label field
@ -166,8 +158,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($label);
// Add composer field
@ -177,8 +168,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($composer);
// Add conductor field
@ -188,8 +178,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($conductor);
// Add mood field
@ -199,8 +188,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 64]),
])
;
]);
$this->addElement($mood);
// Add bmp field
@ -210,8 +198,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['min' => 0, 'max' => 8]),
new Zend_Validate_Digits(), ])
;
new Zend_Validate_Digits(), ]);
$this->addElement($bpm);
// Add copyright field
@ -221,8 +208,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($copyright);
// Add isrc number field
@ -232,8 +218,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($isrc_number);
// Add website field
@ -243,8 +228,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($info_url);
// Add language field
@ -254,8 +238,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim'])
->setValidators([
new Zend_Validate_StringLength(['max' => 512]),
])
;
]);
$this->addElement($language);
$validCuePattern = '/^(?:[0-9]{1,2}:)?(?:[0-9]{1,2}:)?[0-9]{1,6}(\.\d{1,6})?$/';

View file

@ -136,8 +136,7 @@ class Application_Form_EditUser extends Zend_Form
$count = CcSubjsQuery::create()
->filterByDbLogin($p_login)
->filterByDbId($p_userId, Criteria::NOT_EQUAL)
->count()
;
->count();
if ($count != 0) {
$this->getElement('cu_login')->setErrors([_('Login name is not unique.')]);

View file

@ -46,8 +46,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->setMaxFileSize(1000000)
->addFilter('ImageSize')
;
->addFilter('ImageSize');
$stationLogoUpload->setAttrib('accept', 'image/*');
$this->addElement($stationLogoUpload);

View file

@ -16,15 +16,13 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
// automatic trasition on source disconnection
$auto_transition = new Zend_Form_Element_Checkbox('auto_transition');
$auto_transition->setLabel(_('Auto Switch Off:'))
->setValue(Application_Model_Preference::GetAutoTransition())
;
->setValue(Application_Model_Preference::GetAutoTransition());
$this->addElement($auto_transition);
// automatic switch on upon source connection
$auto_switch = new Zend_Form_Element_Checkbox('auto_switch');
$auto_switch->setLabel(_('Auto Switch On:'))
->setValue(Application_Model_Preference::GetAutoSwitch())
;
->setValue(Application_Model_Preference::GetAutoSwitch());
$this->addElement($auto_switch);
// Default transition fade
@ -33,8 +31,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setFilters(['StringTrim'])
->addValidator('regex', false, ['/^\d*(\.\d+)?$/',
'messages' => _('Please enter a time in seconds (eg. 0.5)'), ])
->setValue($defaultFade)
;
->setValue($defaultFade);
$this->addElement($transition_fade);
//Master username
@ -43,8 +40,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setAllowEmpty(true)
->setLabel(_('Username:'))
->setFilters(['StringTrim'])
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername())
;
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername());
$this->addElement($master_username);
//Master password
@ -59,8 +55,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setAllowEmpty(true)
->setValue(Application_Model_Preference::GetLiveStreamMasterPassword())
->setLabel(_('Password:'))
->setFilters(['StringTrim'])
;
->setFilters(['StringTrim']);
$this->addElement($master_password);
$masterSourceParams = parse_url(Application_Model_Preference::GetMasterDJSourceConnectionURL());
@ -69,8 +64,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$masterSourceHost = new Zend_Form_Element_Text('master_source_host');
$masterSourceHost->setLabel(_('Master Source Host:'))
->setAttrib('readonly', true)
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL())
;
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL());
$this->addElement($masterSourceHost);
//liquidsoap harbor.input port
@ -82,8 +76,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$masterSourcePort->setLabel(_('Master Source Port:'))
->setValue($m_port)
->setValidators([$betweenValidator])
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
;
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]);
$this->addElement($masterSourcePort);
@ -92,8 +85,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$masterSourceMount->setLabel(_('Master Source Mount:'))
->setValue($m_mount)
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
;
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
$this->addElement($masterSourceMount);
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
@ -102,8 +94,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$showSourceHost = new Zend_Form_Element_Text('show_source_host');
$showSourceHost->setLabel(_('Show Source Host:'))
->setAttrib('readonly', true)
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL())
;
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL());
$this->addElement($showSourceHost);
//liquidsoap harbor.input port
@ -113,8 +104,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$showSourcePort->setLabel(_('Show Source Port:'))
->setValue($l_port)
->setValidators([$betweenValidator])
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
;
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]);
$this->addElement($showSourcePort);
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
@ -122,8 +112,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$showSourceMount->setLabel(_('Show Source Mount:'))
->setValue($l_mount)
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
;
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
$this->addElement($showSourceMount);
}

View file

@ -44,8 +44,7 @@ class Application_Form_Login extends Zend_Form
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '')
->addFilter('StringTrim')
->setDecorators(['ViewHelper'])
->setValidators(['NotEmpty'])
;
->setValidators(['NotEmpty']);
$this->addElement($username);
// Add password element

View file

@ -44,8 +44,7 @@ class Application_Form_PasswordRestore extends Zend_Form
$cancel->setLabel(_('Back'))
->setIgnore(true)
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($cancel);
}
}

View file

@ -67,8 +67,7 @@ class Application_Form_Player extends Zend_Form_SubForm
$embedSrc->setAttrib('readonly', 'readonly');
$embedSrc->setAttrib('class', 'embed-player-text-box');
$embedSrc->setAttrib('cols', '40')
->setAttrib('rows', '4')
;
->setAttrib('rows', '4');
$embedSrc->setLabel(_('Embeddable code:'));
$embedSrc->setDescription(_("Copy this code and paste it into your website's HTML to embed the player in your site."));
$embedSrc->setValue('<iframe frameborder="0" width="280" height="216" src="' . Application_Common_HTTPHelper::getStationUrl() . 'embed/player?stream=auto&title=Now Playing"></iframe>');

View file

@ -20,8 +20,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startDate->setAttrib('alt', 'date');
$this->addElement($startDate);
@ -35,8 +34,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startTime->setAttrib('alt', 'time');
$this->addElement($startTime);
@ -50,8 +48,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endDate->setAttrib('alt', 'date');
$this->addElement($endDate);
@ -65,8 +62,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endTime->setAttrib('alt', 'time');
$this->addElement($endTime);
@ -81,8 +77,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
if ($user->getType() === 'H') {
$myShows = new Zend_Form_Element_Checkbox('sb_my_shows');
$myShows->setLabel(_('All My Shows:'))
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($myShows);
}
}
@ -98,8 +93,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
$shows = CcShowQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->orderByDbName()
->find()
;
->find();
foreach ($shows as $show) {
$showNames[$show->getDbId()] = $show->getDbName();

View file

@ -18,8 +18,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startDate->setAttrib('alt', 'date');
$this->addElement($startDate);
@ -33,8 +32,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$startTime->setAttrib('alt', 'time');
$this->addElement($startTime);
@ -48,8 +46,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
->setValidators([
'NotEmpty',
['date', false, ['YYYY-MM-DD']], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endDate->setAttrib('alt', 'date');
$this->addElement($endDate);
@ -63,8 +60,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
'NotEmpty',
['date', false, ['HH:mm']],
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$endTime->setAttrib('alt', 'time');
$this->addElement($endTime);
}

View file

@ -271,8 +271,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
'dynamic' => _('Dynamic'),
'static' => _('Static'),
])
->setValue($blockType)
;
->setValue($blockType);
$this->addElement($spType);
$bl = new Application_Model_Block($p_blockId);
@ -338,8 +337,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteria->setAttrib('class', 'input_select sp_input_select' . $invisible)
->setValue('Select criteria')
->setDecorators(['viewHelper'])
->setMultiOptions($this->getCriteriaOptions())
;
->setMultiOptions($this->getCriteriaOptions());
// if this isn't the first criteria and there isn't an entry for it already disable it
if ($i != 0 && !isset($criteriaKeys[$i])) {
$criteria->setAttrib('disabled', 'disabled');
@ -359,8 +357,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $i . '_' . $j);
$criteriaModifers->setValue('Select modifier')
->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if ($i != 0 && !isset($criteriaKeys[$i])) {
$criteriaModifers->setAttrib('disabled', 'disabled');
}
@ -445,8 +442,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// DATETIME SELECT
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $i . '_' . $j);
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if (isset($criteriaKeys[$i]) && $relativeDateTime) {
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
} else {
@ -473,8 +469,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// EXTRA
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $i . '_' . $j);
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])) {
// need to check if this is a relative date time value
if (isset($criteriaType) && $criteriaType == 'd' && $modifierTest == 'between') {
@ -492,8 +487,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $i . '_' . $j);
$criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
&& $modifierTest == 'between') {
@ -516,8 +510,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
$repeatTracks->setDecorators(['viewHelper'])
->setLabel(_('Allow Repeated Tracks:'))
;
->setLabel(_('Allow Repeated Tracks:'));
if (isset($storedCrit['repeat_tracks'])) {
$repeatTracks->setChecked($storedCrit['repeat_tracks']['value'] == 1 ? true : false);
}
@ -525,8 +518,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$overflowTracks = new Zend_Form_Element_Checkbox('sp_overflow_tracks');
$overflowTracks->setDecorators(['viewHelper'])
->setLabel(_('Allow last track to exceed time limit:'))
;
->setLabel(_('Allow last track to exceed time limit:'));
if (isset($storedCrit['overflow_tracks'])) {
$overflowTracks->setChecked($storedCrit['overflow_tracks']['value'] == 1);
}
@ -536,8 +528,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$sort->setAttrib('class', 'sp_input_select')
->setDecorators(['viewHelper'])
->setLabel(_('Sort Tracks:'))
->setMultiOptions($this->getSortOptions())
;
->setMultiOptions($this->getSortOptions());
if (isset($storedCrit['sort'])) {
$sort->setValue($storedCrit['sort']['value']);
}
@ -546,8 +537,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limit = new Zend_Form_Element_Select('sp_limit_options');
$limit->setAttrib('class', 'sp_input_select')
->setDecorators(['viewHelper'])
->setMultiOptions($this->getLimitOptions())
;
->setMultiOptions($this->getLimitOptions());
if (isset($storedCrit['limit'])) {
$limit->setValue($storedCrit['limit']['modifier']);
}
@ -556,8 +546,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limitValue = new Zend_Form_Element_Text('sp_limit_value');
$limitValue->setAttrib('class', 'sp_input_text_limit')
->setLabel(_('Limit to:'))
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
$this->addElement($limitValue);
if (isset($storedCrit['limit'])) {
$limitValue->setValue($storedCrit['limit']['value']);
@ -663,8 +652,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteria->setAttrib('class', 'input_select sp_input_select sp-invisible')
->setValue('Select criteria')
->setDecorators(['viewHelper'])
->setMultiOptions($this->getCriteriaOptions())
;
->setMultiOptions($this->getCriteriaOptions());
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
$criteria->setValue($this->getCriteriaOptions($modInfo['sp_criteria_field']));
@ -674,8 +662,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $critKey . '_' . $modKey);
$criteriaModifers->setValue('Select modifier')
->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if ($criteriaType == 's') {
$criteriaModifers->setMultiOptions($this->getStringCriteriaOptions());
@ -694,16 +681,14 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// VALUE
$criteriaValue = new Zend_Form_Element_Text('sp_criteria_value_' . $critKey . '_' . $modKey);
$criteriaValue->setAttrib('class', 'input_text sp_input_text')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
$criteriaValue->setValue($modInfo['sp_criteria_value']);
$this->addElement($criteriaValue);
// DATETIME UNIT SELECT
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $critKey . '_' . $modKey);
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if ($this->enableDateTimeUnit($criteriaValue->getValue())) {
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
$criteriaDatetimeSelect->setAttrib('disabled', null);
@ -715,8 +700,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// EXTRA
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $critKey . '_' . $modKey);
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if (isset($modInfo['sp_criteria_extra'])) {
$criteriaExtra->setValue($modInfo['sp_criteria_extra']);
$criteriaValue->setAttrib('class', 'input_text sp_extra_input_text');
@ -729,8 +713,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $critKey . '_' . $modKey);
$criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper'])
;
->setDecorators(['viewHelper']);
if ($criteriaValue->getValue() == 'between') {
$criteriaExtraDatetimeSelect->setAttrib('enabled', 'enabled');
$criteriaExtraDatetimeSelect->setAttrib('disabled', null);

View file

@ -13,8 +13,7 @@ class Application_Form_StationPodcast extends Zend_Form
$csrf_element->setValue($csrf_namespace->authtoken)
->setRequired('true')
->removeDecorator('HtmlTag')
->removeDecorator('Label')
;
->removeDecorator('Label');
$this->addElement($csrf_element);
}
}

View file

@ -25,8 +25,7 @@ class Application_Form_StreamSetting extends Zend_Form
$output_sound_device->setLabel(_('Hardware Audio Output:'))
->setRequired(false)
->setValue(($setting['output_sound_device'] == 'true') ? 1 : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($output_sound_device);
$output_sound_device_type = new Zend_Form_Element_Select('output_sound_device_type');
@ -39,16 +38,14 @@ class Application_Form_StreamSetting extends Zend_Form
'Pulseaudio' => _('Pulseaudio'),
'Jack' => _('Jack'), ])
->setValue(isset($setting['output_sound_device_type']) ? $setting['output_sound_device_type'] : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($output_sound_device_type);
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
$icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata'))
->setRequired(false)
->setValue(($setting['icecast_vorbis_metadata'] == 'true') ? 1 : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
if (Application_Model_Preference::GetEnableStreamConf() == 'false') {
$icecast_vorbis_metadata->setAttrib('readonly', true);
}
@ -66,23 +63,20 @@ class Application_Form_StreamSetting extends Zend_Form
$offAirMeta = new Zend_Form_Element_Text('offAirMeta');
$offAirMeta->setLabel(_('Off Air Metadata'))
->setValue(Application_Model_StreamSetting::getOffAirMeta())
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($offAirMeta);
$enable_replay_gain = new Zend_Form_Element_Checkbox('enableReplayGain');
$enable_replay_gain->setLabel(_('Enable Replay Gain'))
->setValue(Application_Model_Preference::GetEnableReplayGain())
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($enable_replay_gain);
$replay_gain = new Zend_Form_Element_Hidden('replayGainModifier');
$replay_gain->setLabel(_('Replay Gain Modifier'))
->setValue(Application_Model_Preference::getReplayGainModifier())
->setAttribs(['style' => 'border: 0; color: #f6931f; font-weight: bold;'])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($replay_gain);
$custom = Application_Model_Preference::getUsingCustomStreamSettings();

View file

@ -51,8 +51,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$enable = new Zend_Form_Element_Checkbox('enable');
$enable->setLabel(_('Enabled:'))
->setValue($setting[$prefix . '_enable'] == 'true' ? 1 : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($enable);
static::$customizable[] = $enable->getName();
@ -67,8 +66,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$type->setLabel(_('Stream Type:'))
->setMultiOptions($stream_types)
->setValue(isset($setting[$prefix . '_type']) ? $setting[$prefix . '_type'] : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($type);
static::$customizable[] = $type->getName();
@ -76,8 +74,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$bitrate->setLabel(_('Bit Rate:'))
->setMultiOptions($stream_bitrates)
->setValue(isset($setting[$prefix . '_bitrate']) ? $setting[$prefix . '_bitrate'] : 0)
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($bitrate);
static::$customizable[] = $bitrate->getName();
@ -86,16 +83,14 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast'])
->setValue($useDefaults ? $streamDefaults['output'] :
(isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($output);
$channels = new Zend_Form_Element_Select('channels');
$channels->setLabel(_('Channels:'))
->setMultiOptions(['mono' => _('1 - Mono'), 'stereo' => _('2 - Stereo')])
->setValue(isset($setting[$prefix . '_channels']) ? $setting[$prefix . '_channels'] : 'stereo')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($channels);
static::$customizable[] = $channels->getName();
@ -105,8 +100,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
->setValidators([
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$host->setAttrib('alt', 'domain');
$this->addElement($host);
@ -116,8 +110,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])])
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($port);
$pass = new Zend_Form_Element_Text('pass');
@ -126,16 +119,14 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : ''))
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$pass->setAttrib('alt', 'regular_text');
$this->addElement($pass);
$genre = new Zend_Form_Element_Text('genre');
$genre->setLabel(_('Genre'))
->setValue(isset($setting[$prefix . '_genre']) ? $setting[$prefix . '_genre'] : '')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($genre);
$url = new Zend_Form_Element_Text('url');
@ -143,23 +134,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->setValue(isset($setting[$prefix . '_url']) ? $setting[$prefix . '_url'] : '')
->setValidators([
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$url->setAttrib('alt', 'url');
$this->addElement($url);
$name = new Zend_Form_Element_Text('name');
$name->setLabel(_('Name'))
->setValue(isset($setting[$prefix . '_name']) ? $setting[$prefix . '_name'] : '')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($name);
$description = new Zend_Form_Element_Text('description');
$description->setLabel(_('Description'))
->setValue(isset($setting[$prefix . '_description']) ? $setting[$prefix . '_description'] : '')
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$this->addElement($description);
$mount = new Zend_Form_Element_Text('mount');
@ -168,8 +156,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : ''))
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$mount->setAttrib('alt', 'regular_text');
$this->addElement($mount);
@ -179,8 +166,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$user->setAttrib('alt', 'regular_text');
$this->addElement($user);
@ -189,8 +175,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$adminUser->setAttrib('alt', 'regular_text');
$this->addElement($adminUser);
@ -199,8 +184,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
->setValidators([
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
->setDecorators(['ViewHelper'])
;
->setDecorators(['ViewHelper']);
$adminPass->setAttrib('alt', 'regular_text');
$this->addElement($adminPass);