public function init() { $country_list = Application_Model_Preference::GetCountryList(); $isSass = Application_Model_Preference::GetPlanLevel() == 'disabled' ? false : true; $this->isSass = $isSass; $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/support-setting.phtml', "isSaas" => $isSass)), array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))); //Station name $this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => true, 'filters' => array('StringTrim'), 'validator' => array('NotEmpty'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper'))); // Phone number $this->addElement('text', 'Phone', array('class' => 'input_text', 'label' => 'Phone:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetPhone(), 'decorators' => array('ViewHelper'))); //Email $this->addElement('text', 'Email', array('class' => 'input_text', 'label' => 'Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetEmail(), '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'))); // 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,jpeg,png,gif')->addFilter('ImageSize'); $upload->setAttrib('accept', 'image/*'); $this->addElement($upload); if (!$isSass) { //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 $checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise"); $checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')->setRequired(false)->setDecorators(array('ViewHelper'))->setValue(Application_Model_Preference::GetPublicise()); if (Application_Model_Preference::GetSupportFeedback() == '0') { $checkboxPublicise->setAttrib("disabled", "disabled"); } $this->addElement($checkboxPublicise); // text area for sending detail $this->addElement('textarea', 'SendInfo', array('class' => 'sending_textarea', 'required' => false, 'filters' => array('StringTrim'), 'readonly' => true, 'cols' => 61, 'rows' => 5, 'value' => Application_Model_Preference::GetSystemInfo(false, true), 'decorators' => array('ViewHelper'))); // checkbox for privacy policy $checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy"); $checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")->setDecorators(array('ViewHelper')); $this->addElement($checkboxPrivacy); } // submit button $submit = new Zend_Form_Element_Submit("submit"); $submit->class = 'ui-button ui-state-default right-floated'; $submit->setIgnore(true)->setLabel("Save")->setDecorators(array('ViewHelper')); $this->addElement($submit); }
public function init() { $this->setAction('/Showbuilder'); $this->setMethod('post'); $country_list = Application_Model_Preference::GetCountryList(); $privacyChecked = false; if (Application_Model_Preference::GetPrivacyPolicyCheck() == 1) { $privacyChecked = true; } $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/register-dialog.phtml', 'privacyChecked' => $privacyChecked)), array('File', array('viewScript' => 'form/register-dialog.phtml', 'placement' => false)))); // Station Name $stnName = new Zend_Form_Element_Text("stnName"); $stnName->setLabel("Station Name")->setRequired(true)->setValue(Application_Model_Preference::GetStationName())->setDecorators(array('ViewHelper')); $this->addElement($stnName); // Phone number $this->addElement('text', 'Phone', array('class' => 'input_text', 'label' => 'Phone:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetPhone(), 'decorators' => array('ViewHelper'))); //Email $this->addElement('text', 'Email', array('class' => 'input_text', 'label' => 'Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetEmail(), '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'))); // 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,jpeg,png,gif')->addFilter('ImageSize'); $this->addElement($upload); //enable support feedback $this->addElement('checkbox', 'SupportFeedback', array('label' => 'Send support feedback', 'required' => false, 'value' => 1, 'decorators' => array('ViewHelper'))); // checkbox for publicise $checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise"); $checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')->setRequired(false)->setDecorators(array('ViewHelper'))->setValue(Application_Model_Preference::GetPublicise()); $this->addElement($checkboxPublicise); // text area for sending detail $this->addElement('textarea', 'SendInfo', array('class' => 'sending_textarea', 'required' => false, 'filters' => array('StringTrim'), 'readonly' => true, 'rows' => 5, 'cols' => 61, 'value' => Application_Model_Preference::GetSystemInfo(false, true), 'decorators' => array('ViewHelper'))); // checkbox for privacy policy $checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy"); $checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")->setDecorators(array('ViewHelper')); $this->addElement($checkboxPrivacy); }
$folderName = "common"; } } require_once $CC_CONFIG['phpDir'] . '/application/' . $folderName . '/' . $filename; } } spl_autoload_register('my_autoload'); require_once 'propel/runtime/lib/Propel.php'; Propel::init($CC_CONFIG['phpDir'] . "/application/configs/airtime-conf-production.php"); //Zend framework if (file_exists('/usr/share/php/libzend-framework-php')) { set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path()); } require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $infoArray = Application_Model_Preference::GetSystemInfo(true); if (Application_Model_Preference::GetSupportFeedback() == '1') { $url = 'http://stat.sourcefabric.org/index.php?p=airtime'; //$url = 'http://localhost:9999/index.php?p=airtime'; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $url); $data = json_encode($infoArray); $dataArray = array("data" => $data); curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray); $result = curl_exec($ch); curl_close($ch); } // Get latest version from stat server and store to db if (Application_Model_Preference::GetPlanLevel() == 'disabled') {