CC-4090: Make code style PSR compliant - part 4
-forms directory
This commit is contained in:
parent
481616a0d6
commit
b2327472e8
29 changed files with 505 additions and 519 deletions
|
@ -30,19 +30,18 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function checkReliantFields($formData) {
|
||||
|
||||
public function checkReliantFields($formData)
|
||||
{
|
||||
$noError = true;
|
||||
|
||||
for ($i=1; $i<=10; $i++) {
|
||||
|
@ -60,7 +59,6 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
|
||||
if (trim($time) == "") {
|
||||
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
@ -94,4 +92,3 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
return $noError;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function isValid($data){
|
||||
public function isValid($data)
|
||||
{
|
||||
$isValid = parent::isValid($data);
|
||||
|
||||
if ($data['cb_custom_auth'] == 1) {
|
||||
|
@ -68,6 +69,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
$isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,16 +18,14 @@ class Application_Form_AddShowRR extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,19 +35,18 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function checkReliantFields($formData) {
|
||||
|
||||
public function checkReliantFields($formData)
|
||||
{
|
||||
$noError = true;
|
||||
|
||||
for ($i=1; $i<=10; $i++) {
|
||||
|
@ -65,7 +64,6 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
|
||||
if (trim($time) == "") {
|
||||
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
@ -103,4 +101,3 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
return $noError;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,19 +56,18 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function checkReliantFields($formData) {
|
||||
|
||||
public function checkReliantFields($formData)
|
||||
{
|
||||
if (!$formData['add_show_no_end']) {
|
||||
$start_timestamp = $formData['add_show_start_date'];
|
||||
$end_timestamp = $formData['add_show_end_date'];
|
||||
|
@ -78,6 +77,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
|||
|
||||
if ($end_epoch < $start_epoch) {
|
||||
$this->getElement('add_show_end_date')->setErrors(array('End date must be after start date'));
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -86,4 +86,3 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
array('stringLength', false, array(6, 6))
|
||||
));
|
||||
|
||||
|
||||
// Add show color input
|
||||
$this->addElement('text', 'add_show_color', array(
|
||||
'label' => 'Text Colour:',
|
||||
|
@ -45,16 +44,14 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -66,15 +66,13 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
|||
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
|
||||
}
|
||||
|
||||
public function checkReliantFields($formData, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) {
|
||||
public function checkReliantFields($formData, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null)
|
||||
{
|
||||
$valid = true;
|
||||
|
||||
$hours;
|
||||
|
@ -136,8 +137,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m'));
|
||||
$valid = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
|
@ -263,34 +263,31 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
return $valid;
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function disableRepeatCheckbox(){
|
||||
public function disableRepeatCheckbox()
|
||||
{
|
||||
$element = $this->getElement('add_show_repeats');
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
|
||||
public function disableStartDateAndTime(){
|
||||
public function disableStartDateAndTime()
|
||||
{
|
||||
$elements = array($this->getElement('add_show_start_date'), $this->getElement('add_show_start_time'));
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,15 +27,13 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
|
|||
$this->addElement($hosts);
|
||||
}
|
||||
|
||||
public function disable(){
|
||||
public function disable()
|
||||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,13 +92,14 @@ class Application_Form_AddUser extends Zend_Form
|
|||
$this->addElement($submit);
|
||||
}
|
||||
|
||||
public function validateLogin($data){
|
||||
|
||||
public function validateLogin($data)
|
||||
{
|
||||
if (strlen($data['user_id']) == 0) {
|
||||
$count = CcSubjsQuery::create()->filterByDbLogin($data['login'])->count();
|
||||
|
||||
if ($count != 0) {
|
||||
$this->getElement('login')->setErrors(array("Login name is not unique."));
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -106,4 +107,3 @@ class Application_Form_AddUser extends Zend_Form
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,4 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,4 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$this->addElement($week_start_day);
|
||||
}
|
||||
|
||||
private function getTimezones(){
|
||||
private function getTimezones()
|
||||
{
|
||||
$regions = array(
|
||||
'Africa' => DateTimeZone::AFRICA,
|
||||
'America' => DateTimeZone::AMERICA,
|
||||
|
@ -96,8 +97,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
return $tzlist;
|
||||
}
|
||||
|
||||
|
||||
private function getWeekStartDays() {
|
||||
private function getWeekStartDays()
|
||||
{
|
||||
$days = array(
|
||||
'Sunday',
|
||||
'Monday',
|
||||
|
@ -107,7 +108,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
'Friday',
|
||||
'Saturday'
|
||||
);
|
||||
|
||||
return $days;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,17 +123,16 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
// demo only code
|
||||
if (!$isStreamConfigable) {
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||
{
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib("disabled", "disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateVariables(){
|
||||
public function updateVariables()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
@ -146,7 +145,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function isValid($data){
|
||||
public function isValid($data)
|
||||
{
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isValid = parent::isValid($data);
|
||||
if (!$isSaas) {
|
||||
|
@ -190,6 +190,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@ class Application_Form_Login extends Zend_Form
|
|||
|
||||
}
|
||||
|
||||
public function addRecaptcha(){
|
||||
public function addRecaptcha()
|
||||
{
|
||||
$pubKey = '6Ld4JsISAAAAAIxUKT4IjjOGi3DHqdoH2zk6WkYG';
|
||||
$privKey = '6Ld4JsISAAAAAJynYlXdrE4hfTReTSxYFe5szdyv';
|
||||
|
||||
|
@ -84,6 +85,4 @@ class Application_Form_Login extends Zend_Form
|
|||
$this->addElement($captcha);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
|||
$isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,4 @@ class Application_Form_ScheduleShow extends Zend_Form
|
|||
/* Form Elements & Other Definitions Here ... */
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
||||
|
||||
// add a select to choose a show.
|
||||
$showSelect = new Zend_Form_Element_Select("sb_show_filter");
|
||||
$showSelect->setLabel("Show:");
|
||||
|
@ -84,8 +83,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
|
||||
private function getShowNames() {
|
||||
|
||||
private function getShowNames()
|
||||
{
|
||||
$showNames = array("0" => "-------------------------");
|
||||
|
||||
$shows = CcShowQuery::create()
|
||||
|
|
|
@ -84,8 +84,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
"items" => "items"
|
||||
);
|
||||
|
||||
public function init(){
|
||||
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
public function startForm($p_blockId, $p_isValid = false)
|
||||
|
@ -98,7 +98,6 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$blockType = 1;
|
||||
}
|
||||
|
||||
|
||||
$spType = new Zend_Form_Element_Radio('sp_type');
|
||||
$spType->setLabel('Set smart block type:')
|
||||
->setDecorators(array('viewHelper'))
|
||||
|
@ -267,7 +266,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
function preValidation($params) {
|
||||
public function preValidation($params)
|
||||
{
|
||||
$data = Application_Model_Block::organizeSmartPlyalistCriteria($params['data']);
|
||||
// add elelments that needs to be added
|
||||
// set multioption for modifier according to creiteria_field
|
||||
|
@ -368,10 +368,12 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
|
||||
$this->populate($formData);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function isValid($params){
|
||||
public function isValid($params)
|
||||
{
|
||||
$isValid = true;
|
||||
$data = $this->preValidation($params);
|
||||
$criteria2PeerMap = array(
|
||||
|
@ -512,6 +514,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}//end foreach
|
||||
}//for loop
|
||||
}//if
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,6 +149,4 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
|||
$this->addElement($select);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,11 +9,13 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
|
||||
}
|
||||
|
||||
public function setSetting($setting){
|
||||
public function setSetting($setting)
|
||||
{
|
||||
$this->setting = $setting;
|
||||
}
|
||||
|
||||
public function startFrom() {
|
||||
public function startFrom()
|
||||
{
|
||||
$setting = $this->setting;
|
||||
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
|
||||
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
|
||||
|
@ -58,7 +60,8 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
$this->addElement($stream_format);
|
||||
}
|
||||
|
||||
public function isValid($data){
|
||||
public function isValid($data)
|
||||
{
|
||||
if (isset($data['output_sound_device'])) {
|
||||
$d = array();
|
||||
$d["output_sound_device"] = $data['output_sound_device'];
|
||||
|
@ -70,6 +73,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
$this->populate($d);
|
||||
}
|
||||
$isValid = parent::isValid($data);
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
||||
class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||
{
|
||||
private $prefix;
|
||||
private $setting;
|
||||
private $stream_types;
|
||||
|
@ -10,23 +11,28 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
|||
|
||||
}
|
||||
|
||||
public function setPrefix($prefix){
|
||||
public function setPrefix($prefix)
|
||||
{
|
||||
$this->prefix = $prefix;
|
||||
}
|
||||
|
||||
public function setSetting($setting){
|
||||
public function setSetting($setting)
|
||||
{
|
||||
$this->setting = $setting;
|
||||
}
|
||||
|
||||
public function setStreamTypes($stream_types){
|
||||
public function setStreamTypes($stream_types)
|
||||
{
|
||||
$this->stream_types = $stream_types;
|
||||
}
|
||||
|
||||
public function setStreamBitrates($stream_bitrates){
|
||||
public function setStreamBitrates($stream_bitrates)
|
||||
{
|
||||
$this->stream_bitrates = $stream_bitrates;
|
||||
}
|
||||
|
||||
public function startForm(){
|
||||
public function startForm()
|
||||
{
|
||||
$prefix = "s".$this->prefix;
|
||||
$stream_number = $this->prefix;
|
||||
$setting = $this->setting;
|
||||
|
@ -36,10 +42,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
|||
$this->setIsArray(true);
|
||||
$this->setElementsBelongTo($prefix."_data");
|
||||
|
||||
$disable_all = false;
|
||||
if(Application_Model_Preference::GetEnableStreamConf() == "false"){
|
||||
$disable_all = true;
|
||||
}
|
||||
$disable_all = Application_Model_Preference::GetEnableStreamConf() == "false";
|
||||
|
||||
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||
$enable->setLabel('Enabled:')
|
||||
|
@ -185,7 +188,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
|||
));
|
||||
}
|
||||
|
||||
public function isValid ($data){
|
||||
public function isValid ($data)
|
||||
{
|
||||
$f_data = $data['s'.$this->prefix."_data"];
|
||||
$isValid = parent::isValid($f_data);
|
||||
if ($f_data['enable'] == 1) {
|
||||
|
@ -207,6 +211,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,20 +32,20 @@ class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
|
|||
));
|
||||
}
|
||||
|
||||
public function verifyChosenFolder($p_form_element_id) {
|
||||
|
||||
public function verifyChosenFolder($p_form_element_id)
|
||||
{
|
||||
$element = $this->getElement($p_form_element_id);
|
||||
|
||||
if (!is_dir($element->getValue())) {
|
||||
$element->setErrors(array('Not a valid Directory'));
|
||||
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$element->setValue("");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
|
||||
class Zend_Filter_ImageSize implements Zend_Filter_Interface {
|
||||
public function filter($value) {
|
||||
class Zend_Filter_ImageSize implements Zend_Filter_Interface
|
||||
{
|
||||
public function filter($value)
|
||||
{
|
||||
if (!file_exists($value)) {
|
||||
throw new Zend_Filter_Exception('Image does not exist: ' . $value);
|
||||
}
|
||||
|
@ -38,5 +40,3 @@ class Zend_Filter_ImageSize implements Zend_Filter_Interface {
|
|||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
/**
|
||||
* Check if a field is empty but only when specific fields have specific values
|
||||
*/
|
||||
class ConditionalNotEmpty extends Zend_Validate_Abstract {
|
||||
|
||||
class ConditionalNotEmpty extends Zend_Validate_Abstract
|
||||
{
|
||||
const KEY_IS_EMPTY = 'keyIsEmpty';
|
||||
|
||||
protected $_messageTemplates = array(
|
||||
|
@ -55,8 +55,7 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract {
|
|||
}
|
||||
|
||||
$this->_error(self::KEY_IS_EMPTY);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
class PasswordNotEmpty extends ConditionalNotEmpty {
|
||||
class PasswordNotEmpty extends ConditionalNotEmpty
|
||||
{
|
||||
public function isValid($value, $context = null)
|
||||
{
|
||||
$result = parent::isValid($value, $context);
|
||||
|
@ -11,8 +12,7 @@ class PasswordNotEmpty extends ConditionalNotEmpty {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue