♻️ remove dead form
This commit is contained in:
parent
e232469551
commit
55c194a5d9
|
@ -1,176 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once 'customfilters/ImageSize.php';
|
||||
|
||||
class Application_Form_RegisterAirtime extends Zend_Form
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'showbuilder');
|
||||
$this->setMethod('post');
|
||||
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
|
||||
$privacyChecked = false;
|
||||
if (Application_Model_Preference::GetPrivacyPolicyCheck() == 1) {
|
||||
$privacyChecked = true;
|
||||
}
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' =>
|
||||
'form/register-dialog.phtml', 'privacyChecked'=>$privacyChecked)),
|
||||
|
||||
array('File', array('viewScript' => 'form/register-dialog.phtml',
|
||||
'placement' => false)))
|
||||
);
|
||||
|
||||
// Station Name
|
||||
$stnName = new Zend_Form_Element_Text("stnName");
|
||||
$stnName->setLabel(_("Station Name"))
|
||||
->setRequired(true)
|
||||
->setValue(Application_Model_Preference::GetStationName())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($stnName);
|
||||
|
||||
// Phone number
|
||||
$this->addElement('text', 'Phone', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Phone:'),
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => Application_Model_Preference::GetPhone(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
//Email
|
||||
$this->addElement('text', 'Email', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Email:'),
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => Application_Model_Preference::GetEmail(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// Station Web Site
|
||||
$this->addElement('text', 'StationWebSite', array(
|
||||
'label' => _('Station Web Site:'),
|
||||
'required' => false,
|
||||
'class' => 'input_text',
|
||||
'value' => Application_Model_Preference::GetStationWebSite(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// county list dropdown
|
||||
$this->addElement('select', 'Country', array(
|
||||
'label' => _('Country:'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetStationCountry(),
|
||||
'multiOptions' => $country_list,
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// Station city
|
||||
$this->addElement('text', 'City', array(
|
||||
'label' => _('City:'),
|
||||
'required' => false,
|
||||
'class' => 'input_text',
|
||||
'value' => Application_Model_Preference::GetStationCity(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// Station Description
|
||||
$description = new Zend_Form_Element_Textarea('Description');
|
||||
$description->class = 'input_text_area';
|
||||
$description->setLabel(_('Station Description:'))
|
||||
->setRequired(false)
|
||||
->setValue(Application_Model_Preference::GetStationDescription())
|
||||
->setDecorators(array('ViewHelper'))
|
||||
->setAttrib('ROWS','2')
|
||||
->setAttrib('COLS','58');
|
||||
$this->addElement($description);
|
||||
|
||||
// Station Logo
|
||||
$upload = new Zend_Form_Element_File('Logo');
|
||||
$upload->setLabel(_('Station Logo:'))
|
||||
->setRequired(false)
|
||||
->setDecorators(array('File'))
|
||||
->addValidator('Count', false, 1)
|
||||
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||
->addFilter('ImageSize');
|
||||
$this->addElement($upload);
|
||||
|
||||
//enable support feedback
|
||||
$this->addElement('checkbox', 'SupportFeedback', array(
|
||||
'label' => _('Send support feedback'),
|
||||
'required' => false,
|
||||
'value' => 1,
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// checkbox for publicise
|
||||
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
||||
$checkboxPublicise->setLabel(sprintf(_('Promote my station on %s'), COMPANY_SITE))
|
||||
->setRequired(false)
|
||||
->setDecorators(array('ViewHelper'))
|
||||
->setValue(Application_Model_Preference::GetPublicise());
|
||||
$this->addElement($checkboxPublicise);
|
||||
|
||||
// text area for sending detail
|
||||
$this->addElement('textarea', 'SendInfo', array(
|
||||
'class' => 'sending_textarea',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'readonly' => true,
|
||||
'rows' => 5,
|
||||
'cols' => 61,
|
||||
'value' => Application_Model_Preference::GetSystemInfo(false, true),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$privacyPolicyAnchorOpen = "<a id='link_to_privacy' href='" . PRIVACY_POLICY_URL
|
||||
. "' onclick='window.open(this.href); return false;'>";
|
||||
// checkbox for privacy policy
|
||||
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||
$checkboxPrivacy->setLabel(
|
||||
sprintf(_('By checking this box, I agree to %s\'s %sprivacy policy%s.'),
|
||||
COMPANY_NAME,
|
||||
$privacyPolicyAnchorOpen,
|
||||
"</a>"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($checkboxPrivacy);
|
||||
}
|
||||
|
||||
// overriding isValid function
|
||||
public function isValid ($data)
|
||||
{
|
||||
$isValid = parent::isValid($data);
|
||||
if ($data['Publicise'] != 1) {
|
||||
$isValid = true;
|
||||
}
|
||||
if (isset($data["Privacy"])) {
|
||||
$checkPrivacy = $this->getElement('Privacy');
|
||||
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
||||
$checkPrivacy->addError(_("You have to agree to privacy policy."));
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
|
@ -1,184 +0,0 @@
|
|||
<div id="register_popup" class="dialogPopup register-dialog" title="<?php echo _("Register Airtime") ?>" style="display: none;">
|
||||
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<dl class="zend_form">
|
||||
<dt class="block-display info-text">
|
||||
<?php echo sprintf(_("Help improve %s by letting us know how you're using it. This information"
|
||||
." will be collected regularly in order to enhance your user experience.<br />"
|
||||
."Click the box below and we'll make sure the features you use are constantly improving."),
|
||||
PRODUCT_NAME)?>
|
||||
</dt>
|
||||
<dd id="SupportFeedback-element" class="block-display">
|
||||
<label class="optional" for="SupportFeedback">
|
||||
<?php echo $this->element->getElement('SupportFeedback') ?>
|
||||
<strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt class="block-display info-text">
|
||||
<?php
|
||||
$whosUsingAnchor = "<a id='link_to_whos_using' href='" . WHOS_USING_URL . "' onclick='window.open(this.href); return false'>"
|
||||
. COMPANY_SITE
|
||||
. "</a>";
|
||||
echo sprintf(_("Click the box below to promote your station on %s."), $whosUsingAnchor)
|
||||
?>
|
||||
</dt>
|
||||
<dd id="publicize-element" class="block-display">
|
||||
<label class="optional" for="Publicise">
|
||||
<?php echo $this->element->getElement('Publicise') ?>
|
||||
<strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('Publicise')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl id="public-info" style="display:none;">
|
||||
<dt id="stnName-label">
|
||||
<label class="optional" for="stnName"><?php echo $this->element->getElement('stnName')->getLabel() ?>
|
||||
<span class="info-text-small"><?php echo _("(Required)")?></span> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="stnName-element">
|
||||
<?php echo $this->element->getElement('stnName') ?>
|
||||
<?php if($this->element->getElement('stnName')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('stnName')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Phone-label">
|
||||
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Phone-element">
|
||||
<?php echo $this->element->getElement('Phone') ?>
|
||||
<span class="info-text-small"><?php echo _("(for verification purposes only, will not be published)")?></span>
|
||||
<?php if($this->element->getElement('Phone')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Phone')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Email-label">
|
||||
<label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Email-element">
|
||||
<?php echo $this->element->getElement('Email') ?>
|
||||
<span class="info-text-small"><?php echo _("(for verification purposes only, will not be published)")?></span>
|
||||
<?php if($this->element->getElement('Email')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="StationWebSite-label">
|
||||
<label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="StationWebSite-element">
|
||||
<?php echo $this->element->getElement('StationWebSite') ?>
|
||||
<?php if($this->element->getElement('StationWebSite')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('StationWebSite')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Country-label">
|
||||
<label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Country-element">
|
||||
<?php echo $this->element->getElement('Country') ?>
|
||||
<?php if($this->element->getElement('Country')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Country')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="City-label">
|
||||
<label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="City-element">
|
||||
<?php echo $this->element->getElement('City') ?>
|
||||
<?php if($this->element->getElement('City')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('City')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Description-label">
|
||||
<label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Description-element">
|
||||
<?php echo $this->element->getElement('Description') ?>
|
||||
<?php if($this->element->getElement('Description')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Description')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Logo-label" class="block-display">
|
||||
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
|
||||
</dt>
|
||||
|
||||
<dd id="Logo-element">
|
||||
<?php if($this->element->getView()->logoImg){?>
|
||||
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
|
||||
<?php }?>
|
||||
|
||||
<?php echo $this->element->getElement('Logo') ?>
|
||||
<p class="info-text"><?php echo _("Note: Anything larger than 600x600 will be resized.")?></p>
|
||||
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
<div id="show_what_sending" style="display: block;">
|
||||
<fieldset class="display_field toggle closed">
|
||||
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span><?php echo _("Show me what I am sending ") ?></legend>
|
||||
<dl>
|
||||
<?php echo $this->element->getElement('SendInfo') ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
<?php if(!$this->privacyChecked){?>
|
||||
<label class="optional" for="Privacy">
|
||||
<?php echo $this->element->getElement('Privacy') ?>
|
||||
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||
</label>
|
||||
<?php }else{?>
|
||||
<a id="link_to_terms_and_condition" href="<?php echo TERMS_AND_CONDITIONS_URL ?>" onclick="window.open(this.href); return false;"><?php echo _("Terms and Conditions") ?></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
Loading…
Reference in New Issue