SAAS-1019: Re-work Navigation Menu

Created Widget sub menu and moved widgets into separate controller
actions
This commit is contained in:
drigato 2015-08-17 16:15:26 -04:00
parent 3aee9a49bc
commit e5f5ff4c88
7 changed files with 72 additions and 52 deletions

View file

@ -83,7 +83,21 @@ $pages = array(
'label' => _('Widgets'),
'module' => 'default',
'controller' => 'embeddablewidgets',
'action' => 'index'
'action' => 'player',
'pages' => array(
array(
'label' => _('Player'),
'module' => 'default',
'controller' => 'embeddablewidgets',
'action' => 'player',
),
array(
'label' => _('Weekly Schedule'),
'module' => 'default',
'controller' => 'embeddablewidgets',
'action' => 'schedule',
)
)
),
array(
'label' => _('Help'),

View file

@ -8,8 +8,11 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
}
public function indexAction()
public function playerAction()
{
$this->_helper->layout->setLayout("page-sub-menu");
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
@ -27,6 +30,14 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
2. Enable the Public Airtime API under System -> Preferences");
}
}
public function scheduleAction()
{
$this->_helper->layout->setLayout("page-sub-menu");
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
if (!$apiEnabled) {
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>

View file

@ -120,10 +120,11 @@
<div class="wrapper" id="content">
<div id="sub-menu">
<?php echo $this->layout()->parent_page; ?>
<?php //parent_page is passed in from controller
echo $this->layout()->parent_page; ?>
<hr>
<?php
$page = $this->navigation()->findOneBy('label',$this->layout()->parent_page);
$page = $this->navigation()->findOneBy('label', $this->layout()->parent_page);
echo $this->navigation()->menu()->renderMenu($page);
?>
</div>

View file

@ -1,47 +0,0 @@
<div id="widget-menu" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<h2><?php echo _("Embeddable Widgets"); ?></h2>
<a href="#player-widget">Player</a>
<a href="#weekly-schedule-widget">Weekly Schedule</a>
</div>
<div id="player-widget" class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="player_form" enctype="multipart/form-data">
<h2 style="float:left"><?php echo _("Player") ?></h2>
<div style="clear:both"></div>
<?php echo $this->player_error_msg; ?>
<?php echo $this->player_form; ?>
</form>
</div>
<br>
<div id="weekly-schedule-widget" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<h2 style="float:left"><?php echo _("Weekly Schedule") ?></h2>
<div style="clear:both"></div>
<div id="weekly-schedule-widget-error">
<?php echo $this->weekly_schedule_error_msg; ?>
</div>
<fieldset class="padded">
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
<label><?php echo _("Preview:") ?></label>
<div class="schedule_iframe_wrapper">
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe>
</div>
<div style="clear:both"></div>
<label>Embeddable Code:</label>
<textarea style="width:100%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
</textarea>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
Adjust the height and width attributes to your desired size.
</div>
</fieldset>
</div>

View file

@ -0,0 +1,12 @@
<div id="player-widget" class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="player_form" enctype="multipart/form-data">
<h2 style="float:left"><?php echo _("Player") ?></h2>
<div style="clear:both"></div>
<?php echo $this->player_error_msg; ?>
<?php echo $this->player_form; ?>
</form>
</div>

View file

@ -0,0 +1,29 @@
<div id="weekly-schedule-widget" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<h2 style="float:left"><?php echo _("Weekly Schedule") ?></h2>
<div style="clear:both"></div>
<div id="weekly-schedule-widget-error">
<?php echo $this->weekly_schedule_error_msg; ?>
</div>
<fieldset class="padded">
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
<label><?php echo _("Preview:") ?></label>
<div class="schedule_iframe_wrapper">
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
</div>
<div style="clear:both"></div>
<label>Embeddable Code:</label>
<textarea style="width:98%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
</textarea>
<div>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
Adjust the height and width attributes to your desired size.
</div>
</div>
</fieldset>
</div>

View file

@ -3385,7 +3385,7 @@ dd .stream-status {
#weekly-schedule-widget {
margin: 0 auto;
margin-bottom: 20px;
width: 50%;
width: 60%;
}
#widget-menu {