From cf654f1a452b10975813457206b0261f2dcc580e Mon Sep 17 00:00:00 2001 From: james Date: Wed, 15 Jun 2011 12:06:50 -0400 Subject: [PATCH] CC-1724:phone-home-statistics Rebase from devel into this branch --- .../controllers/LoginController.php | 5 +- .../controllers/NowplayingController.php | 8 + .../controllers/PreferenceController.php | 52 +++++- .../application/forms/RegisterAirtime.php | 128 +++++++++----- .../application/forms/SupportPreferences.php | 90 ++++++++-- airtime_mvc/application/models/Playlist.php | 6 + airtime_mvc/application/models/Preference.php | 109 +++++++++++- airtime_mvc/application/models/Schedule.php | 6 + airtime_mvc/application/models/StoredFile.php | 7 + airtime_mvc/application/models/Users.php | 27 +++ .../views/scripts/form/preferences.phtml | 6 +- .../scripts/form/preferences_support.phtml | 108 +++++++++-- .../views/scripts/form/register-dialog.phtml | 167 +++++++++++------- airtime_mvc/build/schema.xml | 4 + airtime_mvc/public/css/styles.css | 9 + .../js/airtime/preferences/preferences.js | 102 ++++++----- install/airtime-install.php | 2 + install/include/AirtimeInstall.php | 13 ++ 18 files changed, 656 insertions(+), 193 deletions(-) diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index 3d93fea00..52da767e3 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -49,7 +49,10 @@ class LoginController extends Zend_Controller_Action //the default storage is a session with namespace Zend_Auth $authStorage = $auth->getStorage(); $authStorage->write($userInfo); - + + $this->refer_sess = new Zend_Session_Namespace("referrer"); + $this->refer_sess->referrer = 'login'; + $this->_redirect('Nowplaying'); } else diff --git a/airtime_mvc/application/controllers/NowplayingController.php b/airtime_mvc/application/controllers/NowplayingController.php index f52b8dd58..220918e96 100644 --- a/airtime_mvc/application/controllers/NowplayingController.php +++ b/airtime_mvc/application/controllers/NowplayingController.php @@ -18,6 +18,14 @@ class NowplayingController extends Zend_Controller_Action $this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowview.js','text/javascript'); + + //popup if previous page was login + $refer_sses = new Zend_Session_Namespace('referrer'); + if($refer_sses->referrer == 'login'){ + //unset session + Zend_Session::namespaceUnset('referrer'); + $this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js','text/javascript'); + } } public function getDataGridDataAction() diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index bcc1388dd..b172fd613 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -8,6 +8,7 @@ class PreferenceController extends Zend_Controller_Action /* Initialize action controller here */ $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('register', 'json') + ->addActionContext('remindme', 'json') ->initContext(); } @@ -19,9 +20,6 @@ class PreferenceController extends Zend_Controller_Action $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript'); $this->view->statusMsg = ""; - $this->view->registered = Application_Model_Preference::GetRegistered(); - $this->view->supportFeedback = Application_Model_Preference::GetSupportFeedback(); - $form = new Application_Form_Preferences(); if ($request->isPost()) { @@ -47,10 +45,46 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetEmail($values["preferences_support"]["Email"]); Application_Model_Preference::SetStationWebSite($values["preferences_support"]["StationWebSite"]); Application_Model_Preference::SetSupportFeedback($values["preferences_support"]["SupportFeedback"]); + Application_Model_Preference::SetPublicise($values["preferences_support"]["Publicise"]); + + $imagePath = $form->getSubForm('preferences_support')->Logo->getFileName(); + + Application_Model_Preference::SetStationCountry($values["preferences_support"]["Country"]); + Application_Model_Preference::SetStationCity($values["preferences_support"]["City"]); + Application_Model_Preference::SetStationDescription($values["preferences_support"]["Description"]); + Application_Model_Preference::SetStationLogo($imagePath); $this->view->statusMsg = "
Preferences updated.
"; + + }else{ + $errors = $form->getErrors(); + $firstElementWithError = ''; + + foreach($errors as $section => $error){ + foreach($error as $name => $er){ + if(count($er) > 0){ + $firstElementWithError = $name; + break; + } + } + if($section == "preferences_general"){ + $this->view->errorGeneral = true; + }elseif($section == "preferences_soundcloud"){ + $this->view->errorSoundCloud = true; + }elseif($section == "preferences_support"){ + $this->view->errorSupport = true; + } + } } + + } + + $this->view->supportFeedback = Application_Model_Preference::GetSupportFeedback(); + $logo = Application_Model_Preference::GetStationLogo(); + if($logo){ + $this->view->logoImg = $logo; + } $this->view->form = $form; } @@ -61,8 +95,20 @@ class PreferenceController extends Zend_Controller_Action $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript'); $form = new Application_Form_RegisterAirtime(); + + $logo = Application_Model_Preference::GetStationLogo(); + if($logo){ + $this->view->logoImg = $logo; + } + $this->view->dialog = $form->render($this->view); } + + public function remindmeAction(){ + $now = date("Y-m-d H:i:s"); + Application_Model_Preference::SetRemindMeDate($now); + die(); + } } diff --git a/airtime_mvc/application/forms/RegisterAirtime.php b/airtime_mvc/application/forms/RegisterAirtime.php index 843cce502..80bedc7cd 100644 --- a/airtime_mvc/application/forms/RegisterAirtime.php +++ b/airtime_mvc/application/forms/RegisterAirtime.php @@ -5,43 +5,14 @@ class Application_Form_RegisterAirtime extends Zend_Form_SubForm public function init() { + $country_list = Application_Model_Preference::GetCountryList(); + $this->setDecorators(array( - array('ViewScript', array('viewScript' => 'form/register-dialog.phtml')) - )); + array('ViewScript', array('viewScript' => 'form/register-dialog.phtml')), + array('File', array('viewScript' => 'form/register-dialog.phtml', 'placement' => false))) + ); - // checkbox for publicise - $this->addElement('checkbox', 'Publicise', array( - 'label' => 'Publicise my station on Sourcefabric.org', - 'required' => false, - 'value' => Application_Model_Preference::GetSupportFeedback(), - 'decorators' => array( - 'ViewHelper' - ) - )); - - // Station Name - $this->addElement('text', 'StationName', array( - 'label' => 'Station Name:', - 'required' => false, - 'class' => 'input_text', - 'value' => Application_Model_Preference::GetStationName(), - 'decorators' => array( - 'ViewHelper' - ) - )); - - // Station Web Site - $this->addElement('text', 'StationWebSite', array( - 'label' => 'Station Web Site:', - 'required' => false, - 'class' => 'input_text', - 'value' => Application_Model_Preference::GetStationWebSite(), - 'decorators' => array( - 'ViewHelper' - ) - )); - - // Phone number + // Phone number $this->addElement('text', 'Phone', array( 'class' => 'input_text', 'label' => 'Phone:', @@ -64,15 +35,92 @@ class Application_Form_RegisterAirtime extends Zend_Form_SubForm 'ViewHelper' ) )); - - // text area for sending detail + + // Station Web Site + $this->addElement('text', 'StationWebSite', array( + 'label' => 'Station Web Site:', + 'required' => false, + 'class' => 'input_text', + 'value' => Application_Model_Preference::GetStationWebSite(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // county list dropdown + $this->addElement('select', 'Country', array( + 'label' => 'Country:', + 'required' => false, + 'value' => Application_Model_Preference::GetStationCountry(), + 'multiOptions' => $country_list, + 'decorators' => array( + 'ViewHelper' + ) + )); + + // Station city + $this->addElement('text', 'City', array( + 'label' => 'City:', + 'required' => false, + 'class' => 'input_text', + 'value' => Application_Model_Preference::GetStationCity(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // Station Description + $description = new Zend_Form_Element_Textarea('Description'); + $description->class = 'input_text_area'; + $description->setLabel('Station Description:') + ->setRequired(false) + ->setValue(Application_Model_Preference::GetStationDescription()) + ->setDecorators(array('ViewHelper')) + ->setAttrib('ROWS','2') + ->setAttrib('COLS','58'); + $this->addElement($description); + + // Station Logo + $upload = new Zend_Form_Element_File('Logo'); + $upload->setLabel('Station Logo:') + ->setRequired(false) + ->setDecorators(array('File')) + ->addValidator('Count', false, 1) + ->addValidator('Extension', false, 'jpg,png,gif') + ->addValidator('ImageSize', false, array( + 'minwidth' => 180, + 'minheight' => 180, + 'maxwidth' => 1000, + 'maxheight' => 1000)); + $this->addElement($upload); + + //enable support feedback + $this->addElement('checkbox', 'SupportFeedback', array( + 'label' => 'Send support feedback', + 'required' => false, + 'value' => Application_Model_Preference::GetSupportFeedback(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // checkbox for publicise + $this->addElement('checkbox', 'Publicise', array( + 'label' => 'Publicise my station on Sourcefabric.org', + 'required' => false, + 'value' => Application_Model_Preference::GetPublicise(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // text area for sending detail $this->addElement('textarea', 'SendInfo', array( - 'class' => 'textarea', + 'class' => 'sending_textarea', 'required' => false, 'filters' => array('StringTrim'), - 'cols' => 48, - 'rows' => 20, 'readonly' => true, + 'rows' => 24, 'value' => Application_Model_Preference::GetSystemInfo(), 'decorators' => array( 'ViewHelper' diff --git a/airtime_mvc/application/forms/SupportPreferences.php b/airtime_mvc/application/forms/SupportPreferences.php index 745d432c4..69f137b8f 100644 --- a/airtime_mvc/application/forms/SupportPreferences.php +++ b/airtime_mvc/application/forms/SupportPreferences.php @@ -5,9 +5,12 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm public function init() { + $country_list = Application_Model_Preference::GetCountryList(); + $this->setDecorators(array( - array('ViewScript', array('viewScript' => 'form/preferences_support.phtml')) - )); + array('ViewScript', array('viewScript' => 'form/preferences_support.phtml')), + array('File', array('viewScript' => 'form/preferences_support.phtml', 'placement' => false))) + ); // Phone number $this->addElement('text', 'Phone', array( @@ -44,29 +47,84 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm ) )); + // county list dropdown + $this->addElement('select', 'Country', array( + 'label' => 'Country:', + 'required' => false, + 'value' => Application_Model_Preference::GetStationCountry(), + 'multiOptions' => $country_list, + 'decorators' => array( + 'ViewHelper' + ) + )); + + // Station city + $this->addElement('text', 'City', array( + 'label' => 'City:', + 'required' => false, + 'class' => 'input_text', + 'value' => Application_Model_Preference::GetStationCity(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // Station Description + $this->addElement('textarea', 'Description', array( + 'label' => 'Station Description:', + 'required' => false, + 'class' => 'input_text_area', + 'value' => Application_Model_Preference::GetStationDescription(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // Station Logo + $upload = new Zend_Form_Element_File('Logo'); + $upload->setLabel('Station Logo:') + ->setRequired(false) + ->setDecorators(array('File')) + ->addValidator('Count', false, 1) + ->addValidator('Extension', false, 'jpg,png,gif') + ->addValidator('ImageSize', false, array( + 'minwidth' => 180, + 'minheight' => 180, + 'maxwidth' => 1000, + 'maxheight' => 1000)); + $this->addElement($upload); + //enable support feedback $this->addElement('checkbox', 'SupportFeedback', array( - 'label' => 'Support feedback enabled', + 'label' => 'Send support feedback', 'required' => false, 'value' => Application_Model_Preference::GetSupportFeedback(), + 'decorators' => array( + 'ViewHelper' + ) + )); + + // checkbox for publicise + $this->addElement('checkbox', 'Publicise', array( + 'label' => 'Publicise my station on Sourcefabric.org', + 'required' => false, + 'value' => Application_Model_Preference::GetPublicise(), 'decorators' => array( 'ViewHelper' ) )); - //add register button if not registered - if( !Application_Model_Preference::GetRegistered() ){ - $this->addElement('submit', 'Register', array( - 'class' => 'ui-button ui-state-default', - 'ignore' => true, - 'label' => 'Register', - 'decorators' => array( - 'ViewHelper' - ) - )); - } + // text area for sending detail + $this->addElement('textarea', 'SendInfo', array( + 'class' => 'sending_textarea', + 'required' => false, + 'filters' => array('StringTrim'), + 'readonly' => true, + 'value' => Application_Model_Preference::GetSystemInfo(), + 'decorators' => array( + 'ViewHelper' + ) + )); } - - } diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 1b7ee4e05..fd4c3cead 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -119,6 +119,12 @@ class Playlist { $sql = 'DELETE FROM '.$CC_CONFIG["playListTable"]; $CC_DBC->query($sql); } + + public static function getPlaylistCount(){ + global $CC_CONFIG, $CC_DBC; + $sql = 'SELECT count(*) as cnt FROM '.$CC_CONFIG["playListTable"]; + return $CC_DBC->GetOne($sql); + } /** * Delete the file from all playlists. diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 5c754318f..5a3882e1d 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -221,6 +221,14 @@ class Application_Model_Preference return Application_Model_Preference::GetValue("support_feedback"); } + public static function SetPublicise($publicise){ + Application_Model_Preference::SetValue("publicise", $publicise); + } + + public static function GetPublicise(){ + return Application_Model_Preference::GetValue("publicise"); + } + public static function SetRegistered($registered){ Application_Model_Preference::SetValue("registered", $registered); } @@ -229,14 +237,101 @@ class Application_Model_Preference return Application_Model_Preference::GetValue("registered"); } - public static function GetSystemInfo(){ - $output; - exec('airtime-check-system', $output); - $out = implode("\n", preg_replace('/\s+/', ' ', $output)); - - // Sever API - $out .= php_sapi_name(); + public static function SetStationCountry($country){ + Application_Model_Preference::SetValue("country", $country); + } + + public static function GetStationCountry(){ + return Application_Model_Preference::GetValue("country"); + } + + public static function SetStationCity($city){ + Application_Model_Preference::SetValue("city", $city); + } + + public static function GetStationCity(){ + return Application_Model_Preference::GetValue("city"); + } + + public static function SetStationDescription($description){ + Application_Model_Preference::SetValue("description", $description); + } + + public static function GetStationDescription(){ + return Application_Model_Preference::GetValue("description"); + } + + public static function SetStationLogo($imagePath){ + if(!empty($imagePath)){ + $image = file_get_contents($imagePath); + $image = base64_encode($image); + Application_Model_Preference::SetValue("logoImage", $image); + } + } + + public static function GetStationLogo(){ + return Application_Model_Preference::GetValue("logoImage"); + } + + public static function GetUniqueId(){ + return Application_Model_Preference::GetValue("uniqueId"); + } + + public static function GetCountryList(){ + global $CC_DBC; + $sql = "SELECT * FROM cc_country"; + $res = $CC_DBC->GetAll($sql); + $out = array(); + foreach($res as $r){ + $out[$r["iso_code"]] = $r["name"]; + } return $out; } + + public static function GetSystemInfo(){ + exec('/usr/bin/airtime-check-system', $output); + + $output = preg_replace('/\s+/', ' ', $output); + + $systemInfoArray = array(); + foreach( $output as $key => &$out){ + $info = explode('=', $out); + if(isset($info[1])){ + $key = str_replace(' ', '_', $info[0]); + $key = strtoupper($key); + $systemInfoArray[$key] = $info[1]; + } + } + + $outputArray = array(); + + $outputArray['STATION_NAME'] = Application_Model_Preference::GetStationName(); + $outputArray['STATION_WEB_SITE'] = Application_Model_Preference::GetStationWebSite(); + $outputArray['STATION_COUNTRY'] = Application_Model_Preference::GetStationCountry(); + $outputArray['STATION_CITY'] = Application_Model_Preference::GetStationCity(); + $outputArrat['STATION_DESCRIPTION'] = Application_Model_Preference::GetStationDescription(); + //$outputArray['Version'] = $systemInfoArray['AIRTIME_VERSION']; + $outputArray['WEB_SERVER'] = php_sapi_name(); + //$outputArray['OS Info'] = $systemInfoArray['OS']; + $outputArray['NUM_OF_USERS'] = User::getUserCount(); + $outputArray['NUM_OF_SONGS'] = StoredFile::getFileCount(); + $outputArray['NUM_OF_PLAYLISTS'] = Playlist::getPlaylistCount(); + $outputArray['NUM_OF_SCHEDULED_PLAYLIST'] = Schedule::getSchduledPlaylistCount(); + $outputArray['UNIQUE_ID'] = Application_Model_Preference::GetUniqueId(); + + $outputArray = array_merge($outputArray, $systemInfoArray); + + $outputString = "\n"; + foreach($outputArray as $key => $out){ + $outputString .= $key.' : '.$out."\n"; + } + + return $outputString; + } + + public static function SetRemindMeDate($now){ + $weekAfter = mktime(0, 0, 0, date("m") , date("d")+7, date("Y")); + Application_Model_Preference::SetValue('remindme', $weekAfter); + } } diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 5676da420..0bf61f4d4 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -527,6 +527,12 @@ class Schedule { $retVal = $CC_DBC->query($sql); return $retVal; } + + public static function getSchduledPlaylistCount(){ + global $CC_CONFIG, $CC_DBC; + $sql = "SELECT count(*) as cnt FROM ".$CC_CONFIG['scheduleTable']; + return $CC_DBC->GetOne($sql); + } /** diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index aa7dbef92..c9ff830c7 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -88,6 +88,13 @@ class StoredFile { } } + public static function getFileCount() + { + global $CC_CONFIG, $CC_DBC; + $sql = "SELECT count(*) as cnt FROM ".$CC_CONFIG["filesTable"]." WHERE state='ready'"; + return $CC_DBC->GetOne($sql); + } + /** * Set multiple metadata values using database columns as indexes. * diff --git a/airtime_mvc/application/models/Users.php b/airtime_mvc/application/models/Users.php index cf836ded8..ef7b2e25d 100644 --- a/airtime_mvc/application/models/Users.php +++ b/airtime_mvc/application/models/Users.php @@ -188,6 +188,33 @@ class User { return $CC_DBC->GetAll($sql); } + + public static function getUserCount($type=NULL){ + global $CC_DBC; + + $sql; + + $sql_gen = "SELECT count(*) AS cnt FROM cc_subjs "; + + if(!isset($type)){ + $sql = $sql_gen; + } + else{ + if(is_array($type)) { + for($i=0; $iGetOne($sql); + } public static function getHosts($search=NULL) { return User::getUsers(array('H'), $search); diff --git a/airtime_mvc/application/views/scripts/form/preferences.phtml b/airtime_mvc/application/views/scripts/form/preferences.phtml index 7bb5fa5c0..68f17aa61 100644 --- a/airtime_mvc/application/views/scripts/form/preferences.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences.phtml @@ -1,13 +1,13 @@ -
+ element->getSubform('preferences_general') ?> -

SoundCloud Settings

+

SoundCloud Settings

-

Support Settings

+

Support Settings

diff --git a/airtime_mvc/application/views/scripts/form/preferences_support.phtml b/airtime_mvc/application/views/scripts/form/preferences_support.phtml index af17a91c6..a7ba0b3c1 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_support.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_support.phtml @@ -1,13 +1,35 @@
- element->getView()->registered){?> -
Registered
- -
Please register your Airtime system by clicking Register button at the bottom.
- element->getView()->supportFeedback === '0'){?> -
Be more awesome by selecting "Support feedback" below. You will be helping Airtim improve!
+

Be more awesome by selecting "Support feedback" below. You will be helping Airtim improve!

+
+ + element->getElement('SupportFeedback')->hasErrors()) : ?> +
    + element->getElement('SupportFeedback')->getMessages() as $error): ?> +
  • + +
+ +
+
+ + element->getElement('Publicise')->hasErrors()) : ?> +
    + element->getElement('Publicise')->getMessages() as $error): ?> +
  • + +
+ +
+

Note: In order to publicise your station, "Send support feedback" must be enabled

@@ -47,21 +69,73 @@ -
- - element->getElement('SupportFeedback')->hasErrors()) : ?> +
+ +
+
+ element->getElement('Country') ?> + element->getElement('Country')->hasErrors()) : ?>
    - element->getElement('SupportFeedback')->getMessages() as $error): ?> + element->getElement('Country')->getMessages() as $error): ?>
- +
-
- element->getElement('Register') ?> -
+
+ +
+
+ element->getElement('City') ?> + element->getElement('City')->hasErrors()) : ?> +
    + element->getElement('City')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+
+ element->getElement('Description') ?> + element->getElement('Description')->hasErrors()) : ?> +
    + element->getElement('Description')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+ element->getView()->logoImg){?> +
+ +
+ element->getElement('Logo') ?> +

Min. size: 180x180 Max. size: 600x600

+ element->getElement('Logo')->hasErrors()) : ?> +
    + element->getElement('Logo')->getMessages() as $error): ?> +
  • + +
+ +
+
+

+ Show me what I am sending +

+ +
diff --git a/airtime_mvc/application/views/scripts/form/register-dialog.phtml b/airtime_mvc/application/views/scripts/form/register-dialog.phtml index e42a15224..08c1ea548 100644 --- a/airtime_mvc/application/views/scripts/form/register-dialog.phtml +++ b/airtime_mvc/application/views/scripts/form/register-dialog.phtml @@ -5,54 +5,41 @@ advertise your station on sourcefabric.org

- + -
-
- - element->getElement('Publicise')->hasErrors()) : ?> -
    - element->getElement('Publicise')->getMessages() as $error): ?> -
  • - -
- -
-
- -
-
-
- -
-
- element->getElement('StationName') ?> - element->getElement('StationName')->hasErrors()) : ?> +
+ element->getView()->supportFeedback === '0'){?> +

Be more awesome by selecting "Support feedback" below. You will be helping Airtim improve!

+ +
+ + element->getElement('SupportFeedback')->hasErrors()) : ?>
    - element->getElement('StationName')->getMessages() as $error): ?> + element->getElement('SupportFeedback')->getMessages() as $error): ?>
- +
-
- -
-
- element->getElement('StationWebSite') ?> - element->getElement('StationWebSite')->hasErrors()) : ?> +
+ + element->getElement('Publicise')->hasErrors()) : ?>
    - element->getElement('StationWebSite')->getMessages() as $error): ?> + element->getElement('Publicise')->getMessages() as $error): ?>
- -
+ +
+

Note: In order to publicise your station, "Send support feedback" must be enabled

- +
element->getElement('Phone') ?> @@ -65,7 +52,7 @@
- +
element->getElement('Email') ?> @@ -77,27 +64,87 @@
-
-
+
+ +
+
+ element->getElement('StationWebSite') ?> + element->getElement('StationWebSite')->hasErrors()) : ?> +
    + element->getElement('StationWebSite')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+
+ element->getElement('Country') ?> + element->getElement('Country')->hasErrors()) : ?> +
    + element->getElement('Country')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+
+ element->getElement('City') ?> + element->getElement('City')->hasErrors()) : ?> +
    + element->getElement('City')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+
+ element->getElement('Description') ?> + element->getElement('Description')->hasErrors()) : ?> +
    + element->getElement('Description')->getMessages() as $error): ?> +
  • + +
+ +
+
+ +
+ element->getView()->logoImg){?> +
+ +
+ element->getElement('Logo') ?> +

Min. size: 180x180 Max. size: 600x600

+ element->getElement('Logo')->hasErrors()) : ?> +
    + element->getElement('Logo')->getMessages() as $error): ?> +
  • + +
+ +
+ + +

+ Show me what I am sending +

+ +
- -

- Show me what I am sending -

- -
-
-
- element->getElement('SendInfo') ?> -
Airtime version:
-
1.9.0
- -
Unique ID:
-
AT19236520FR00673
- -
Station name:
-
BBC Radio 1
-
-
-
\ No newline at end of file diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 1546e3e0c..b30697c85 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -296,4 +296,8 @@ + + + +
diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index f5a166b18..b2d4f24f5 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -1639,6 +1639,10 @@ dd.radio-inline-list, .preferences dd.radio-inline-list { height: 120px; } +.preferences dd#Description-element.block-display .input_text_area { + height: 60px; +} + #show_time_info { font-size:12px; height:30px; @@ -1723,4 +1727,9 @@ label span { clear: left; font-weight:bold; width:40%; +} + +.sending_textarea { + width: 100%; + resize: none; } \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index a8b292827..fa890842f 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -1,51 +1,61 @@ $(document).ready(function() { - var form = $("form"); - - form.find("h3").click(function(){ - var h3 = $(this); - h3.next().toggle(); - - if(h3.hasClass("close")) { - h3.removeClass("close"); - } - else { - h3.addClass("close"); - } - }); - - $('#Register').click(function(event){ - event.preventDefault(); - $.get("/Preference/register", {format:"json"}, function(json){ - var dialog = $(json.dialog); - - dialog.dialog({ - autoOpen: false, - title: 'Register Airtime', - width: 400, - height: 500, - modal: true, - buttons: {"Ok": function() { - dialog.remove(); - }} - }); - dialog.dialog('open'); - - var form = $("form"); - - form.find("h3").click(function(){ - var h3 = $(this); - h3.next().toggle(); - - if(h3.hasClass("close")) { - h3.removeClass("close"); - } - else { - h3.addClass("close"); - } - }); - }) - }) + $('.collapsible-header').live('click',function() { + $(this).next().toggle('fast'); + $(this).toggleClass("close"); + return false; + }).next().hide(); + + $("#SupportFeedback").click( function(){ + var pub = $("#Publicise"); + if( !$(this).is(':checked') ){ + pub.removeAttr("checked"); + pub.attr("disabled", true); + }else{ + pub.removeAttr("disabled"); + } + }); + + showErrorSections(); + }); +function showErrorSections() { + + if($("soundcloud-settings .errors").length > 0) { + $("#soundcloud-settings").show(); + $(window).scrollTop($("soundcloud-settings .errors").position().top); + } + if($("#support-settings .errors").length > 0) { + $("#support-settings").show(); + $(window).scrollTop($("#support-settings .errors").position().top); + } +} + +function resizeImg(ele){ + var img = $(ele); + + var width = ele.width; + var height = ele.height; + + // resize img proportionaly + if( width > height && width > 450){ + var ratio = 450/width; + img.css("width", "450px"); + var newHeight = height * ratio; + img.css("height", newHeight ); + + }else if( width < height && height > 450){ + var ratio = 450/height; + img.css("height", "450px"); + var newWidth = width * ratio; + img.css("width", newWidth ); + }else if( width == height && width > 450){ + img.css("height", "450px"); + img.css("width", "450px" ); + } + +} + + diff --git a/install/airtime-install.php b/install/airtime-install.php index cb4a0c90f..5ff9e5118 100644 --- a/install/airtime-install.php +++ b/install/airtime-install.php @@ -125,5 +125,7 @@ AirtimeInstall::CreateSymlinksToUtils(); AirtimeInstall::CreateZendPhpLogFile(); +AirtimeInstall::SetUniqueId(); + /* FINISHED AIRTIME PHP INSTALLER */ diff --git a/install/include/AirtimeInstall.php b/install/include/AirtimeInstall.php index dbbff57b6..65c34046c 100644 --- a/install/include/AirtimeInstall.php +++ b/install/include/AirtimeInstall.php @@ -262,6 +262,19 @@ class AirtimeInstall } return true; } + + public static function SetUniqueId(){ + global $CC_DBC; + + $uniqueId = md5(uniqid("", true)); + + $sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('uniqueId', '$uniqueId')"; + $result = $CC_DBC->query($sql); + if (PEAR::isError($result)) { + return false; + } + return true; + } public static function GetAirtimeVersion() {