Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2011-11-10 15:35:52 -05:00
commit 56a6da51a9
16 changed files with 278 additions and 68 deletions

View file

@ -81,7 +81,7 @@ class Application_Form_AddUser extends Zend_Form
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('class', 'ui-button ui-state-default right-floated');
$submit->setIgnore(true);
$submit->setLabel('Submit');
$submit->setLabel('Save');
$this->addElement($submit);
}

View file

@ -16,7 +16,7 @@ class Application_Form_AdvancedSearch extends Zend_Form
// Add the submit button
$this->addElement('button', 'search_submit', array(
'ignore' => true,
'label' => 'Submit',
'label' => 'Save',
'order' => '-1'
));
$this->getElement('search_submit')->removeDecorator('DtDdWrapper');

View file

@ -134,7 +134,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$this->addElement('submit', 'submit', array(
'ignore' => true,
'class' => 'ui-button ui-state-default',
'label' => 'Submit',
'label' => 'Save',
'decorators' => array(
'ViewHelper'
)

View file

@ -24,7 +24,7 @@ class Application_Form_PlaylistMetadata extends Zend_Form{
// Add the comment element
$this->addElement('button', 'new_playlist_submit', array(
'label' => 'Submit',
'label' => 'Save',
'ignore' => true
));
}

View file

@ -1,5 +1,7 @@
<?php
require_once 'customfilters/ImageSize.php';
class Application_Form_RegisterAirtime extends Zend_Form
{
@ -102,12 +104,8 @@ class Application_Form_RegisterAirtime extends Zend_Form
->setRequired(false)
->setDecorators(array('File'))
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,png,gif')
->addValidator('ImageSize', false, array(
'minwidth' => 200,
'minheight' => 200,
'maxwidth' => 600,
'maxheight' => 600));
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->addFilter('ImageSize');
$this->addElement($upload);
//enable support feedback

View file

@ -1,5 +1,7 @@
<?php
require_once 'customfilters/ImageSize.php';
class Application_Form_SupportSettings extends Zend_Form
{
@ -99,12 +101,8 @@ class Application_Form_SupportSettings extends Zend_Form
->setRequired(false)
->setDecorators(array('File'))
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,png,gif')
->addValidator('ImageSize', false, array(
'minwidth' => 200,
'minheight' => 200,
'maxwidth' => 600,
'maxheight' => 600));
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->addFilter('ImageSize');
$upload->setAttrib('accept', 'image/jpeg,image/gif,image/png,image/jpg');
$this->addElement($upload);
@ -153,7 +151,7 @@ class Application_Form_SupportSettings extends Zend_Form
$submit = new Zend_Form_Element_Submit("submit");
$submit->class = 'ui-button ui-state-default right-floated';
$submit->setIgnore(true)
->setLabel("Submit")
->setLabel("Save")
->setDecorators(array('ViewHelper'));
$this->addElement($submit);
}

View file

@ -0,0 +1,42 @@
<?php
class Zend_Filter_ImageSize implements Zend_Filter_Interface {
public function filter($value) {
if(!file_exists($value)) {
throw new Zend_Filter_Exception('Image does not exist: ' . $value);
}
$image = imageCreateFromString(file_get_contents($value));
if(false === $image) {
throw new Zend_Filter_Exception('Can\'t load image: ' . $value);
}
// find ratio to scale down to
// TODO: pass 600 as parameter in the future
$origWidth = imagesx($image);
$origHeight = imagesy($image);
$ratio = max($origWidth, $origHeight) / 600;
if($ratio < 1) {
return;
}
// create a scaled down image
$newWidth = round($origWidth / $ratio);
$newHeight = round($origHeight / $ratio);
$resized = imagecreatetruecolor($newWidth, $newHeight);
imagecopyresampled($resized, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);
// determine type and store to disk
$explodeResult = explode(".", $value);
$type = $explodeResult[count($explodeResult) - 1];
$writeFunc = 'image' . $type;
if($type == 'jpeg' || $type == 'jpg') {
imagejpeg($resized, $value, 100);
} else {
$writeFunc($resized, $value);
}
}
}
?>

View file

@ -144,7 +144,7 @@
<?php }?>
<?php echo $this->element->getElement('Logo') ?>
<p class="info-text">Min. size: 200x200 Max. size: 600x600</p>
<p class="info-text">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): ?>

View file

@ -138,7 +138,7 @@
<?php }?>
<?php echo $this->element->getElement('Logo') ?>
<div class="info-text"><p>Min. size: 200x200 Max. size: 600x600</p></div>
<div class="info-text"><p>Note: Anything larger than 600x600 will be resized.</p></div>
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -241,7 +241,7 @@ select {
color:#a5a5a5;
}
.listen-control-block a {
.listen-control-block a, .listen-control-button {
font-size:11px;
text-transform:uppercase;
padding:0;
@ -251,9 +251,13 @@ select {
font-weight:bold;
margin-top:34px;
display:block;
text-align:center;
}
.listen-control-block a span {
.listen-control-button {
margin-top:6px;
}
.listen-control-block a span, .listen-control-button span {
background-color: #6e6e6e;
background: -moz-linear-gradient(top, #868686 0, #6e6e6e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #868686), color-stop(100%, #6e6e6e));
@ -265,10 +269,13 @@ select {
text-shadow: #555555 0px -1px;
display:block;
}
.listen-control-block a:hover {
.listen-control-button span {
padding:2px 10px;
}
.listen-control-block a:hover, .listen-control-button:hover {
border:1px solid #000;
}
.listen-control-block a:hover span {
.listen-control-block a:hover span, .listen-control-button:hover span {
background-color: #292929;
background: -moz-linear-gradient(top, #3b3b3b 0, #292929 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3b3b3b), color-stop(100%, #292929));
@ -1212,7 +1219,8 @@ button, input {
.button-bar-top .input_text {
height:25px;
margin-right:6px
margin-right:6px;
padding: 0 3px;
}
.button-bar-top .input_text.hasDatepicker, .input_text.hasDatepicker {
background-image:url(images/input_with_calendar_bg.png);
@ -1618,6 +1626,10 @@ div.success{
width: 500px;
}
.preferences .padded {
margin-top: 5px; /* Firefox needs this */
}
dt.block-display, dd.block-display {
display: block;
float: none;
@ -1944,7 +1956,16 @@ dd .info-text-small {
/*width:98.5%;*/
min-width:152px;
}
.stream-config .display_field dd input[type="text"], .stream-config .display_field dd textarea {
min-width:99%;
padding: 4px 3px;
}
.stream-config .display_field dd textarea {
min-height:60px;
}
.simple-formblock .display_field dd {
min-width:68%;
}
.stream-config dd input[id$=port] {
width:152px;
}
@ -2300,4 +2321,55 @@ tfoot tr th {
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 2px 2px inset;
}
#stream_url {font-size:12px; line-height: 170%;}
.stream-setting-content fieldset {border-width:0 1px 1px 1px;}
.stream-setting-content fieldset {border-width:0 1px 1px 1px;}
.stream-setting-content fieldset {
border-width: 0 1px 1px;
}
.stream-setting-content fieldset.display_field {
border: 1px solid #8F8F8F;
padding: 10px;
}
.stream-setting-content fieldset.display_field.closed {
border-width: 1px 0 0;
}
/*---//////////////////// STREAM SETTINGS STATUS ////////////////////---*/
.stream-status {
border: 1px solid;
padding:2px 10px 4px 22px;
margin:2px 1px 10px 0px;
width: auto;
}
.stream-status h3 {
font-size: 12px;
font-weight: bold;
line-height: 12px;
padding:0;
margin:5px 4px 2px 4px;
}
.stream-status p {
padding:0;
margin:2px 3px 1px 4px;
color:#4F4F4F;
font-size: 11px;
}
.stream-config dd.stream-status {
padding:2px 10px 4px 22px;
margin:4px 0 10px 14px;
width: 65%;
}
.status-good {
background:#e3ffc9 url(images/stream_status.png) no-repeat 5px 5px;
border-color:#54b300;
}
.status-good h3 {
color:#54b300;
}
.status-error {
background:#ffeded url(images/stream_status.png) no-repeat 5px -128px;
border-color:#f90000;
}
.status-error h3 {
color:#DA0101;
}