PATH:
home
/
letacommog
/
letaweb
/
admin
/
controllers
<?php class BlogController extends PController { public $layout = 'column1'; protected function getIndex($a, $i) { return isset($a[$i]) ? $a[$i] : ''; } public function actionIndex() { if (Yii::app()->site->model->isExpired()) { $this->render('/site/expired'); return; } $this->runPage('blog'); } public function actionView() { $id = $_REQUEST['id']; $this->runPage('blogview'); } public function actionCategory() { if (isset($_REQUEST['id'])) { $id = $_REQUEST['id']; $_GET["category"] = $id; } $this->runPage('blog'); } protected function runPage($pageName) { $page = BPages::model()->find('name=:name', array(':name' => $pageName)); if (isset($page)) { define("_BBC_PAGE_NAME", $page->name); define("_BBCLONE_DIR",Yii::getPathofAlias('bbclone_app').'/'); define("_BBC_CACHE_PATH",Yii::getPathofAlias('application_site').'/stats/'); define("COUNTER", _BBCLONE_DIR."mark_page.php"); @include_once(COUNTER); Yii::app()->context->page = $page; $this->pageTitle = $page->title; Yii::app()->clientScript->registerMetaTag($page->keywords, 'keywords'); Yii::app()->clientScript->registerMetaTag($page->description, 'description'); require_once Yii::getPathofAlias('application_admin.classes').'/general.php'; $this->render('/site/view', array('page' => $page)); } else { $page = new BPages(); $page->name = $pageName; $page->file_name = $pageName; define("_BBC_PAGE_NAME", $page->name); define("_BBCLONE_DIR",Yii::getPathofAlias('bbclone_app').'/'); define("_BBC_CACHE_PATH",Yii::getPathofAlias('application_site').'/stats/'); define("COUNTER", _BBCLONE_DIR."mark_page.php"); @include_once(COUNTER); Yii::app()->context->page = $page; $this->pageTitle = $page->title; Yii::app()->clientScript->registerMetaTag($page->keywords, 'keywords'); Yii::app()->clientScript->registerMetaTag($page->description, 'description'); require_once Yii::getPathofAlias('application_admin.classes').'/general.php'; $this->render('/site/view', array('page' => $page)); } } public function actionAjax() { $type = $_REQUEST['action_type']; if($type =='cart') { $json = array( 'quantity' => cmm_cart::$total['items'], 'value' => !empty(cmm_customer::$data['display_prices_including_tax']) ? cmm_cart::$total['value'] + cmm_cart::$total['tax'] : cmm_cart::$total['value'], 'formatted_value' => !empty(cmm_customer::$data['display_prices_including_tax']) ? cmm_currency::format(cmm_cart::$total['value'] + cmm_cart::$total['tax']) : cmm_currency::format(cmm_cart::$total['value']), ); if (is_array(cmm_notices::get('warnings'))) { $warnings = array_values(cmm_notices::get('warnings')); $json['alert'] = array_shift($warnings); } if (!is_null(cmm_notices::get('errors')) && is_array(cmm_notices::get('errors'))) { $errors = array_values(cmm_notices::get('errors')); $json['alert'] = array_shift($errors); } cmm_notices::reset(); //mb_convert_variables(language::$selected['charset'], 'UTF-8', $json); $json = json_encode($json); // mb_convert_variables('UTF-8', language::$selected['charset'], $json); echo $json; } else if(startsWith($type,"checkout_")) { include Yii::getPathofAlias("application.widgets.views.modules").DIRECTORY_SEPARATOR .$type.".php"; } else if(startsWith($type,"cartcontent_")) { include Yii::getPathofAlias("application.widgets.views.modules").DIRECTORY_SEPARATOR .$type.".php"; } else if($type=="get_address") { if (empty($_GET['trigger'])) die('{}'); $customer = new mod_customer(); $result = $customer->get_address(array_merge($_POST, $_GET)); if (empty($result)) die('{}'); if (!empty($result['error'])) die('{}'); $json = array( 'tax_id' => isset($result['tax_id']) ? $result['tax_id'] : '', 'company' => isset($result['company']) ? $result['company'] : '', 'firstname' => isset($result['firstname']) ? $result['firstname'] : '', 'lastname' => isset($result['lastname']) ? $result['lastname'] : '', 'address1' => isset($result['address1']) ? $result['address1'] : '', 'address2' => isset($result['address2']) ? $result['address2'] : '', 'postcode' => isset($result['postcode']) ? $result['postcode'] : '', 'city' => isset($result['city']) ? $result['city'] : '', 'country_code' => isset($result['country_code']) ? $result['country_code'] : '', 'zone_code' => isset($result['zone_code']) ? $result['zone_code'] : '', 'phone' => isset($result['phone']) ? $result['phone'] : '', 'mobile' => isset($result['mobile']) ? $result['mobile'] : '', 'email' => isset($result['email']) ? $result['email'] : '', 'alert' => isset($result['alert']) ? $result['alert'] : '', ); $json = json_encode($json); echo $json; } else if($type=="get_zone") { $country_code = $_GET['country_code']; $zones = BZone::model()->findAll(array('condition'=>'country_code=:country_code', 'params'=>array(':country_code'=>$country_code))); $json = array(); $json['zone'] = array(); foreach($zones as $zone) { $json['zone'][] = $zone->attributes; } $country = BCountry::model()->find('iso_code_2=:iso_code_2', array(':iso_code_2'=>$country_code)); $json['postcode_required'] = $country->postcode_required; $json = json_encode($json); echo $json; } else if($type=="add_comment") { $form = new NewsCommentForm('guest_comment'); $json = array(); if (isset($_POST['NewsCommentForm'])) { $form->attributes = $_POST['NewsCommentForm']; $result = $form->save(); if($result != false) { $json['html'] = includeViewFile("newscomment_item", array('comment'=>$result, 'news_id'=>$form->news_id), true, 'application.widgets.views.modules'); } else { $json['errors'] = $form->getErrors(); } } $json = json_encode($json); echo $json; } } }
[+]
..
[-] AjaxController.php
[edit]
[-] SiteController.php
[edit]
[-] IpnController.php
[edit]
[-] StatController.php
[edit]
[-] BuilderController.php
[edit]
[-] BlogController.php
[edit]
[-] UserController.php
[edit]
[-] CheckoutController.php
[edit]
[-] PaypalController.php
[edit]