SAAS-939: Add option to preferences to display login button on radio page

This commit is contained in:
drigato 2015-07-09 14:38:44 -04:00
parent 9ec75f7179
commit 0601bd675e
6 changed files with 32 additions and 4 deletions

View File

@ -27,6 +27,8 @@ class IndexController extends Zend_Controller_Action
$this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl();
$this->view->displayLoginButton = Application_Model_Preference::getRadioPageDisplayLoginButton();
}
public function mainAction()

View File

@ -47,6 +47,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetDefaultLocale($values["locale"]);
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();

View File

@ -136,6 +136,17 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$week_start_day->setMultiOptions($this->getWeekStartDays());
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
$this->addElement($week_start_day);
$radioPageLoginButton = new Zend_Form_Element_Checkbox("radioPageLoginButton");
$radioPageLoginButton->setDecorators(array(
'ViewHelper',
'Errors',
'Label'
));
$radioPageLoginButton->addDecorator('Label', array("class" => "enable-tunein"));
$radioPageLoginButton->setLabel(_("Display login button on your Radio Page?"));
$radioPageLoginButton->setValue(Application_Model_Preference::getRadioPageDisplayLoginButton());
$this->addElement($radioPageLoginButton);
}
private function getWeekStartDays()

View File

@ -1512,4 +1512,13 @@ class Application_Model_Preference
self::setValue("task_manager_lock", $value);
}
public static function getRadioPageDisplayLoginButton()
{
return self::getValue("radio_page_display_login_button");
}
public static function setRadioPageDisplayLoginButton($value)
{
self::setValue("radio_page_display_login_button", $value);
}
}

View File

@ -37,5 +37,8 @@
<?php echo $this->element->getElement('thirdPartyApi')->render() ?>
<?php echo $this->element->getElement('radioPageLoginButton')->renderViewHelper() ?>
<?php echo $this->element->getElement('radioPageLoginButton')->renderLabel() ?>
</dl>
</fieldset>

View File

@ -24,12 +24,14 @@ document.getElementById(id).width= (newwidth) + "px";
echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?>
<div class="login-btn">
<a href="/login" target="_parent">
<?php if ($this->displayLoginButton) {
echo "<div class='login-btn'>
<a href='/login' target='_parent'>
<span>Login</span>
<span class="login-img"></span>
<span class='login-img'></span>
</a>
</div>
</div>";
}?>
<div id="tab-1" class="schedule tab_content current">
<iframe onLoad="autoResize('schedule_iframe');" id="schedule_iframe" height="300px" scrolling="yes" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe>