Merge pull request #673 from radiorabe/chore/remove-unused-support-setting
Remove outdated support docs
This commit is contained in:
commit
bd1636ece2
9 changed files with 0 additions and 445 deletions
|
@ -110,47 +110,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->_helper->json->sendJson(array("url" => $url));
|
||||
}
|
||||
|
||||
public function supportSettingAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->statusMsg = "";
|
||||
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
$form = new Application_Form_SupportSettings();
|
||||
if ($request->isPost()) {
|
||||
$values = $request->getPost();
|
||||
if ($form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
|
||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||
Application_Model_Preference::SetStationCity($values["City"]);
|
||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
}
|
||||
$this->view->statusMsg = "<div class='success'>"._("Support setting updated.")."</div>";
|
||||
}
|
||||
|
||||
$privacyChecked = false;
|
||||
if (Application_Model_Preference::GetPrivacyPolicyCheck() == 1) {
|
||||
$privacyChecked = true;
|
||||
}
|
||||
$this->view->privacyChecked = $privacyChecked;
|
||||
$this->view->section_title = _('Support Feedback');
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function directoryConfigAction()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_SupportSettings extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
||||
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||
);
|
||||
|
||||
//Station name
|
||||
$this->addElement('text', 'stationName', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Station Name'),
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array($notEmptyValidator),
|
||||
'value' => Application_Model_Preference::GetStationName(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
// 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);
|
||||
|
||||
//enable support feedback
|
||||
$this->addElement('checkbox', 'SupportFeedback', array(
|
||||
'label' => _('Send support feedback'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetSupportFeedback(),
|
||||
'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());
|
||||
if (Application_Model_Preference::GetSupportFeedback() == '0') {
|
||||
$checkboxPublicise->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($checkboxPublicise);
|
||||
|
||||
// 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);
|
||||
|
||||
// submit button
|
||||
$submit = new Zend_Form_Element_Submit("submit");
|
||||
$submit->class = 'btn right-floated';
|
||||
$submit->setIgnore(true)
|
||||
->setLabel(_("Save"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($submit);
|
||||
}
|
||||
|
||||
// overriding isValid function
|
||||
public function isValid ($data)
|
||||
{
|
||||
$isValid = parent::isValid($data);
|
||||
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,147 +0,0 @@
|
|||
<fieldset class="padded">
|
||||
<dl class="zend_form">
|
||||
<dd id="SupportFeedback-element" style="width:90%;">
|
||||
<div class="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)?>
|
||||
</div>
|
||||
<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>
|
||||
<dd id="publicize-element" style="width:90%;">
|
||||
<div class="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)
|
||||
?>
|
||||
</div>
|
||||
<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>
|
||||
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;">
|
||||
<?php echo _("(In order to promote your station, 'Send support feedback' must be enabled).")?><br /><br />
|
||||
</div>
|
||||
<dl id="public-info" style="display:<?php echo "none"?>;">
|
||||
<dt id="stationName-label" class="block-display">
|
||||
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
|
||||
<span class="info-text-small"><?php echo _("(Required)")?></span>:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="stationName-element" class="block-display">
|
||||
<?php echo $this->element->getElement('stationName') ?>
|
||||
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="Phone-label" class="block-display">
|
||||
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
||||
<span class="info-text-small"><?php echo _("(for verification purposes only, will not be published)")?></span>
|
||||
</dt>
|
||||
<dd id="Phone-element" class="block-display">
|
||||
<?php echo $this->element->getElement('Phone') ?>
|
||||
<?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" class="block-display">
|
||||
<label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label>
|
||||
<span class="info-text-small">
|
||||
<?php echo _("(for verification purposes only, will not be published)")?>
|
||||
</span>
|
||||
</dt>
|
||||
<dd id="Email-element" class="block-display">
|
||||
<?php echo $this->element->getElement('Email') ?>
|
||||
<?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" class="block-display">
|
||||
<label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="StationWebSite-element" class="block-display clearfix">
|
||||
<?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" class="block-display">
|
||||
<label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Country-element" class="block-display clearfix">
|
||||
<?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" class="block-display">
|
||||
<label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="City-element" class="block-display clearfix">
|
||||
<?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" class="block-display">
|
||||
<label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id="Description-element" class="block-display clearfix">
|
||||
<?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>
|
||||
</dl>
|
||||
</fieldset>
|
|
@ -1,13 +0,0 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences" id="support-feedback-view">
|
||||
<h2><?php echo $this->section_title?></h2>
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
<form method="post" action=<?php echo $baseUrl."Preference/support-setting"?> enctype="multipart/form-data" id="support-feedback-form">
|
||||
<div id="support-settings">
|
||||
<?php echo $this->statusMsg ?>
|
||||
<?php echo $this->form ?>
|
||||
</div>
|
||||
<div class="button-bar bottom" id="submit-element">
|
||||
<?php echo $this->form->getElement('submit')?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
|
@ -1,84 +0,0 @@
|
|||
function showErrorSections() {
|
||||
|
||||
if($("soundcloud-settings .errors").length > 0) {
|
||||
$("#soundcloud-settings").show();
|
||||
$(window).scrollTop($("soundcloud-settings .errors").position().top);
|
||||
}
|
||||
if($("#support-settings .errors").length > 0) {
|
||||
$("#support-settings").show();
|
||||
$(window).scrollTop($("#support-settings .errors").position().top);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var form = $("form");
|
||||
|
||||
$("#SupportFeedback").click( function(){
|
||||
var pub = $("#Publicise");
|
||||
if( !$(this).is(':checked') ){
|
||||
pub.removeAttr("checked");
|
||||
pub.attr("disabled", true);
|
||||
}else{
|
||||
pub.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
var promote = $("#Publicise");
|
||||
if(!$("#SupportFeedback").is(':checked')){
|
||||
promote.removeAttr("checked");
|
||||
promote.attr("disabled", true);
|
||||
}else{
|
||||
promote.removeAttr("disabled");
|
||||
}
|
||||
|
||||
promote.live('click', function(){
|
||||
if($(this).is(':checked')){
|
||||
$("#public-info").show();
|
||||
}else{
|
||||
$("#public-info").hide();
|
||||
}
|
||||
});
|
||||
if( promote.is(":checked")){
|
||||
$("#public-info").show();
|
||||
}
|
||||
|
||||
showErrorSections();
|
||||
|
||||
$('.toggle legend').click(function() {
|
||||
$('.toggle').toggleClass('closed');
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#Logo").change(function(ev){
|
||||
var content, res, logoEl;
|
||||
|
||||
content = $(this).val();
|
||||
res = content.match(/(jpg|jpeg|png|gif)$/gi);
|
||||
logoEl = $("#Logo-element");
|
||||
|
||||
//not an accepted image extension.
|
||||
if (!res) {
|
||||
var ul, li;
|
||||
|
||||
ul = logoEl.find('.errors');
|
||||
li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
|
||||
|
||||
//errors ul has already been created.
|
||||
if (ul.length > 0) {
|
||||
ul.empty()
|
||||
.append(li);
|
||||
}
|
||||
else {
|
||||
logoEl
|
||||
.append('<ul class="errors"></ul>')
|
||||
.find(".errors")
|
||||
.append(li);
|
||||
}
|
||||
|
||||
$(this).val("");
|
||||
}
|
||||
else {
|
||||
logoEl.find(".errors").remove();
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue