Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
1245a13259
|
@ -310,13 +310,9 @@ class ScheduleController extends Zend_Controller_Action
|
|||
return;
|
||||
}
|
||||
|
||||
$start = explode(" ", $start_timestamp);
|
||||
$end = explode(" ", $end_timestamp);
|
||||
$startTime = explode(":", $start[1]);
|
||||
$endTime = explode(":", $end[1]);
|
||||
$dateInfo_s = getDate(strtotime($start_timestamp));
|
||||
$dateInfo_e = getDate(strtotime($end_timestamp));
|
||||
|
||||
$dateInfo_s = getDate(strtotime(Application_Model_DateHelper::ConvertToLocalDateTimeString($start_timestamp)));
|
||||
$dateInfo_e = getDate(strtotime(Application_Model_DateHelper::ConvertToLocalDateTimeString($end_timestamp)));
|
||||
|
||||
$this->view->showContent = $show->getShowContent();
|
||||
$this->view->timeFilled = $show->getTimeScheduled();
|
||||
$this->view->showName = $show->getName();
|
||||
|
@ -329,8 +325,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->e_wday = $dateInfo_e['weekday'];
|
||||
$this->view->e_month = $dateInfo_e['month'];
|
||||
$this->view->e_day = $dateInfo_e['mday'];
|
||||
$this->view->startTime = sprintf("%d:%02d", $startTime[0], $startTime[1]);
|
||||
$this->view->endTime = sprintf("%d:%02d", $endTime[0], $endTime[1]);
|
||||
$this->view->startTime = sprintf("%02d:%02d", $dateInfo_s['hours'], $dateInfo_s['minutes']);
|
||||
$this->view->endTime = sprintf("%02d:%02d", $dateInfo_e['hours'], $dateInfo_e['minutes']);
|
||||
|
||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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'
|
||||
)
|
||||
|
|
|
@ -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
|
||||
));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -7,7 +7,7 @@ class Application_Model_Preference
|
|||
global $CC_CONFIG, $CC_DBC;
|
||||
|
||||
//called from a daemon process
|
||||
if(!Zend_Auth::getInstance()->hasIdentity()) {
|
||||
if(!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) {
|
||||
$id = NULL;
|
||||
}
|
||||
else {
|
||||
|
@ -369,11 +369,16 @@ class Application_Model_Preference
|
|||
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Application_Model_Schedule::getSchduledPlaylistCount();
|
||||
$outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(date("Y-m-d H:i:s"));
|
||||
$outputArray['UNIQUE_ID'] = self::GetUniqueId();
|
||||
$outputArray['SAAS'] = self::GetPlanLevel();
|
||||
$outputArray['INSTALL_METHOD'] = self::GetInstallMethod();
|
||||
|
||||
$outputArray = array_merge($systemInfoArray, $outputArray);
|
||||
|
||||
$outputString = "\n";
|
||||
foreach($outputArray as $key => $out){
|
||||
if($key == 'SAAS' && ($out != '' || $out != 'disabled')){
|
||||
continue;
|
||||
}
|
||||
if($out != ''){
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
}
|
||||
|
@ -386,6 +391,20 @@ class Application_Model_Preference
|
|||
return $outputString;
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetInstallMethod(){
|
||||
$easy_install = file_exists('/usr/bin/airtime-easy-install');
|
||||
$debian_install = file_exists('/var/lib/dpkg/info/airtime.config');
|
||||
if($debian_install){
|
||||
if($easy_install){
|
||||
return "easy_install";
|
||||
}else{
|
||||
return "debian_install";
|
||||
}
|
||||
}else{
|
||||
return "manual_install";
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetRemindMeDate($now){
|
||||
$weekAfter = mktime(0, 0, 0, date("m") , date("d")+7, date("Y"));
|
||||
|
@ -446,7 +465,11 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function GetPlanLevel(){
|
||||
return self::GetValue("plan_level");
|
||||
$plan = self::GetValue("plan_level");
|
||||
if(trim($plan) == ''){
|
||||
$plan = 'disabled';
|
||||
}
|
||||
return $plan;
|
||||
}
|
||||
|
||||
public static function SetTrialEndingDate($date){
|
||||
|
|
|
@ -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): ?>
|
||||
|
|
|
@ -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): ?>
|
||||
|
|
|
@ -1618,6 +1618,10 @@ div.success{
|
|||
width: 500px;
|
||||
}
|
||||
|
||||
.preferences .padded {
|
||||
margin-top: 5px; /* Firefox needs this */
|
||||
}
|
||||
|
||||
dt.block-display, dd.block-display {
|
||||
display: block;
|
||||
float: none;
|
||||
|
|
|
@ -274,7 +274,8 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
# check if file exist
|
||||
# When whole directory is copied to the organized dir,
|
||||
# inotify doesn't fire IN_CLOSE_WRITE, hench we need special way of
|
||||
# handling those cases.
|
||||
# handling those cases. We are manully calling handle_created_file
|
||||
# function.
|
||||
if os.path.exists(k):
|
||||
# check if file is open
|
||||
command = "lsof "+k
|
||||
|
|
Loading…
Reference in New Issue