Skeleton player form/view/controller

This commit is contained in:
drigato 2015-02-12 14:08:06 -05:00
parent a1436bfebb
commit c261182c8f
6 changed files with 82 additions and 1 deletions
airtime_mvc/application

View File

@ -36,7 +36,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('rest:media'))
->add(new Zend_Acl_Resource('rest:show-image'))
->add(new Zend_Acl_Resource('billing'))
->add(new Zend_Acl_Resource('provisioning'));
->add(new Zend_Acl_Resource('provisioning'))
->add(new Zend_Acl_Resource('embeddableplayer'));
/** Creating permissions */
$ccAcl->allow('G', 'index')
@ -68,6 +69,7 @@ $ccAcl->allow('G', 'index')
->allow('A', 'user')
->allow('A', 'systemstatus')
->allow('A', 'preference')
->allow('A', 'embeddableplayer')
->allow('S', 'billing');

View File

@ -85,6 +85,13 @@ $pages = array(
'controller' => 'listenerstat',
'action' => 'index',
'resource' => 'listenerstat'
),
array(
'label' => _('Embeddable Player'),
'module' => 'default',
'controller' => 'embeddableplayer',
'action' => 'index',
'resource' => 'embeddableplayer'
)
)
),

View File

@ -0,0 +1,31 @@
<?php
class EmbeddablePlayerController extends Zend_Controller_Action
{
public function init()
{
}
public function indexAction()
{
$form = new Application_Form_EmbeddablePlayer();
$request = $this->getRequest();
if ($request->isPost()) {
$formValues = $request->getPost();
if ($form->isValid($formValues)) {
$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
} else {
}
$this->view->form = $form;
}
$this->view->form = $form;
}
}

View File

@ -0,0 +1,20 @@
<?php
class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
{
public function init()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/embeddableplayer.html'))
));
$displayTrackMetadata = new Zend_Form_Element_Checkbox('display_track_metadata');
$displayTrackMetadata->setValue(true);
$displayTrackMetadata->setLabel(_('Display track metadata?'));
$this->addElement($displayTrackMetadata);
$submit = new Zend_Form_Element_Submit('submit');
$this->addElement($submit);
}
}

View File

@ -0,0 +1,15 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
<h2 style="float:left"><?php echo _("Embeddable Player") ?></h2>
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="pref_form" enctype="multipart/form-data">
<?php echo $this->form->getElement('submit')->render() ?>
<div style="clear:both"></div>
<?php
echo $this->statusMsg;
echo $this->form;
?>
<br />
</form>
</div>

View File

@ -0,0 +1,6 @@
<fieldset class="padded">
<dl class="zend_form">
<?php echo $this->element->getElement('display_track_metadata'); ?>
</dl>
</fieldset>