Example #1
0
 public function init()
 {
     $model = new SliderModel();
     $this->slides = $model->getSliderImages();
     $this->animations = array('lft', 'lfl', 'lfb', 'lfr');
     $this->coords = array(array('x' => rand(30, 300), 'y' => rand(10, 10)), array('x' => rand(50, 150), 'y' => rand(250, 240)), array('x' => rand(600, 800), 'y' => rand(10, 10)), array('x' => rand(500, 700), 'y' => rand(250, 240)));
     $this->propositions = Propositions::model()->limit(4)->findAllByAttributes(array('show_in_slider' => TRUE));
     parent::init();
 }
 public function actionChange()
 {
     $fileName = getParam('fileName', FALSE);
     if ($fileName) {
         $model = new SliderModel();
         if ($model->changeSlide($fileName)) {
             $this->successfulAjaxResponse($model->getResponse());
         } else {
             $this->unsuccessfulAjaxResponse($model->getResponse());
         }
     }
 }
Example #3
0
 /**
  * @param string $shopId 店铺ID
  */
 public function index($shopId = '')
 {
     if ($shopId) {
         $shopId = $shopId + 0;
     }
     // 此处需要做缓存
     $projects = (new ProjectModel())->allProjectsGroupByCategoryId();
     $shops = (new ShopModel())->getAllShops();
     $categories = (new CategoryModel())->getAllCategories();
     $sliderModel = new SliderModel();
     $hdpSliders = $sliderModel->getAllSlider(SliderModel::SLIDER_TYPE_HDP);
     $fllSliders = $sliderModel->getAllSlider(SliderModel::SLIDER_TYPE_FLL);
     $this->outputCache();
     $this->view('project/index', array('shops' => $shops, 'projects' => $projects, 'categories' => $categories, 'shopId' => $shopId, 'hdpSliders' => $hdpSliders, 'fllSliders' => $fllSliders));
 }
Example #4
0
 public function CreateSlider($slider_type = SLIDER_STANDAR, $args)
 {
     if (!is_array($args)) {
         return false;
     }
     $slider = SliderModel::GetSliderScript($slider_type);
 }
Example #5
0
 public function actionDelete($id)
 {
     SliderModel::model()->where("`id`='" . (int) $id . "'")->delete();
     $this->redirect($this->url);
 }