PATH:
home
/
letacommog
/
letaweb
/
admin
/
widgets
/
modules
<?php class CWidgetMailchimp extends CWidgetModule { public $forms,$mailto,$submit_button,$reset_button,$errormsg,$successmsg; public $apiKey, $listID, $title, $description, $disclaimer; protected function decodeData() { $this->forms = getIndex($this->module_data, 'forms', array()); $this->mailto = getIndex($this->module_data, 'mailto', ''); $this->submit_button = getIndex($this->module_data, 'submit_button', ''); if (strlen($this->submit_button) == 0) { $this->submit_button = Yii::app()->lang->term('LBL_BUTTON_SUBMIT'); } $this->reset_button = getIndex($this->module_data, 'reset_button', ''); if (strlen($this->reset_button) == 0) { $this->reset_button = Yii::app()->lang->term('LBL_BUTTON_RESET'); } $this->errormsg = getIndex($this->module_data, 'errormsg', ''); if (strlen($this->errormsg) == 0) { $this->errormsg = Yii::app()->lang->term('LBL_CONTACT_FORM_SUBMIT_ERROR'); } $this->successmsg = getIndex($this->module_data, 'successmsg', ''); $this->apiKey = getIndex($this->module_data, 'apiKey', ''); $this->listID = getIndex($this->module_data, 'listID', ''); $this->title = getIndex($this->module_data, 'title', ''); $this->description = getIndex($this->module_data, 'description', ''); $this->disclaimer = getIndex($this->module_data, 'disclaimer', ''); if (strlen($this->successmsg) == 0) { $this->successmsg = Yii::app()->lang->term('LBL_CONTACT_FORM_SUBMIT_SUCCESSFULL'); } } public function init() { parent::init(); if (isset($_POST['form'.$this->page_id])) { Yii::import('application.classes.mailchimp.MailChimp', true); $email = $_POST['form'.$this->page_id]['email']; if(strlen($email) == 0) { echo json_encode(array('error'=>'Email required')); exit(); } try { $MailChimp = new MailChimp($this->apiKey); $result = $MailChimp->post("lists/".$this->listID."/members", array( 'email_address' => $email, 'status' => 'subscribed', )); if($result == false) { echo json_encode(array('error'=>$MailChimp->getLastError())); exit(); } } catch (Exception $e) { echo json_encode(array('error'=>$e->getMessage())); return; } echo json_encode(array()); exit(); } } }
[+]
..
[-] CWidgetYoutube.php
[edit]
[-] CWidgetInfobanner.php
[edit]
[-] CWidgetTextimage.php
[edit]
[-] CWidgetShare_buttons.php
[edit]
[-] CWidgetIframe.php
[edit]
[-] CWidgetNewslist.php
[edit]
[-] CWidgetNewsdetail.php
[edit]
[+]
slick
[-] CWidgetNavbar.php
[edit]
[-] CWidgetAlert.php
[edit]
[-] CWidgetFacebookvideo.php
[edit]
[-] CWidgetSlick.php
[edit]
[-] CWidgetTitle.php
[edit]
[-] CWidgetGallery.php
[edit]
[-] CWidgetSocial_buttons.php
[edit]
[-] CWidgetFacebookpage.php
[edit]
[+]
accordion
[-] CWidgetContactform.php
[edit]
[-] CWidgetButton.php
[edit]
[-] CWidgetProgress_bar.php
[edit]
[-] CWidgettestmodule.php
[edit]
[-] CWidgetStatcounter.php
[edit]
[-] CWidgetEmbed.php
[edit]
[-] CWidgetFacebooksend.php
[edit]
[-] CWidgetRecentnews.php
[edit]
[-] CWidgetIcon.php
[edit]
[-] CWidgetNewscomment.php
[edit]
[-] CWidgetFacebookcomment.php
[edit]
[-] CWidgetIhover.php
[edit]
[-] CWidgetMenu.php
[edit]
[+]
tab
[-] CWidgetSpacer.php
[edit]
[-] CWidgetBox.php
[edit]
[-] CWidgetHtml.php
[edit]
[-] CWidgetImage.php
[edit]
[-] CWidgetAudio_player.php
[edit]
[-] CWidgetCountdown.php
[edit]
[-] CWidgetTypedtext.php
[edit]
[-] CWidgetCarousel.php
[edit]
[-] CWidgetText.php
[edit]
[-] CWidgetVideo.php
[edit]
[-] CWidgetFacebookpost.php
[edit]
[-] CWidgetRssfeed.php
[edit]
[-] CWidgetInfobox.php
[edit]
[-] CWidgetInfotable.php
[edit]
[-] CWidgetFancytext.php
[edit]
[-] CWidgetGooglemap.php
[edit]
[-] CWidgetSlideshow.php
[edit]
[-] CWidgetPricetable.php
[edit]
[-] CWidgetNewscategory.php
[edit]
[-] CWidgetLine.php
[edit]
[-] CWidgetModal.php
[edit]
[-] CWidgetMailchimp.php
[edit]
[-] CWidgetFacebooklike.php
[edit]