当前位置: 首页>>代码示例>>PHP>>正文


PHP XUtils::imageListSerialize方法代码示例

本文整理汇总了PHP中XUtils::imageListSerialize方法的典型用法代码示例。如果您正苦于以下问题:PHP XUtils::imageListSerialize方法的具体用法?PHP XUtils::imageListSerialize怎么用?PHP XUtils::imageListSerialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XUtils的用法示例。


在下文中一共展示了XUtils::imageListSerialize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUpdate

 /**
  * 更新
  *
  * @param  $id
  */
 public function actionUpdate($id)
 {
     parent::_acl();
     $model = parent::_dataLoad(new Place(), $id);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Place'])) {
         $model->attributes = $_POST['Place'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         $data = $_POST['Place'];
         $model->rank = $data['rank'];
         $file = XUpload::upload($_FILES['attach']);
         $adr = XUpload::upload($_FILES['pic_adr']);
         if (is_array($file)) {
             $model->pic = $file['pathname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if (is_array($adr)) {
             $model->pic_adr = $adr['pathname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if ($model->validate() && $model->save()) {
             AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑内容,ID:' . $id));
             $this->redirect(array('index'));
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     }
     $this->render('place_update', array('model' => $model));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:38,代码来源:PlaceController.php

示例2: actionView

 public function actionView($id)
 {
     $lesson = $this->loadModel($id);
     $userId = $this->_cookiesGet('userId');
     $userType = $this->_cookiesGet('userType');
     $this->_seoTitle = '课程 - ' . $lesson->name;
     //取报名人数
     $actual_students_criteria = new CDbCriteria();
     $actual_students = StudentLesson::model()->count($actual_students_criteria->addCondition("lesson_id =" . $id));
     $lesson->actual_students = $actual_students;
     $teacher = Teacher::model()->findByPk($lesson->teacher_id);
     $place = Place::model()->findByPk($lesson->place_id);
     //教学环境图片显示
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     //判断学员已收藏的课程
     if ($userType === 'student') {
         $is_focus = StudentLesson::model()->findByAttributes(array('student_id' => $userId, 'lesson_id' => $id, 'is_collection' => 1));
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($place->pic_other) {
         $imageList = unserialize($place->pic_other);
     }
     $this->render('view', array('is_focus' => $is_focus, 'isJoin' => $this->isJoin($userId, $id, 1), 'userType' => $userType, 'lesson' => $lesson, 'place' => $place, 'teacher' => $teacher, 'imageList' => $imageList));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:26,代码来源:LessonController.php

示例3: actionUpdatePlace

 public function actionUpdatePlace()
 {
     $model = Place::model()->findByPk($_GET['id']);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Place'])) {
         $model->attributes = $_POST['Place'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         $file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(192, 470)));
         $adr = XUpload::upload($_FILES['pic_adr'], array('thumb' => true, 'thumbSize' => array(498, 364)));
         if (is_array($file)) {
             $model->pic = $file['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if (is_array($adr)) {
             $model->pic_adr = $adr['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if ($model->validate() && $model->save()) {
             $this->redirect(array('/host/default/myplace'));
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->pic_other) {
         $imageList = unserialize($model->pic_other);
     }
     $this->render('addplace', array('model' => $model, 'imageList' => $imageList));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:31,代码来源:DefaultController.php

示例4: actionUpdate

 /**
  * 更新
  *
  * @param  $id
  */
 public function actionUpdate($id)
 {
     parent::_acl();
     $model = parent::_dataLoad(new Family(), $id);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Family'])) {
         $model->attributes = $_POST['Family'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         if ($model->validate() && $model->save()) {
             AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑内容,ID:' . $id));
             $this->redirect(array('index'));
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->pic_other) {
         $imageList = unserialize($model->pic_other);
     }
     $this->render('family_update', array('model' => $model, 'imageList' => $imageList));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:26,代码来源:FamilyController.php

示例5: actionUpdate

 /**
  * 更新
  *
  * @param  $id
  */
 public function actionUpdate($id)
 {
     parent::_acl('subject_update');
     $model = parent::_dataLoad(new Subject(), $id);
     $imageList = $this->_gets->getParam('imageList');
     $layoutList = $this->_gets->getParam('layoutList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     $layoutListSerialize = XUtils::imageListSerialize($layoutList);
     if (isset($_POST['Subject'])) {
         $model->attributes = $_POST['Subject'];
         $model->date = strtotime($_POST['Subject']['date']);
         $file = XUpload::upload($_FILES['attach']);
         if (is_array($file)) {
             $model->room_type_image = $file['pathname'];
             @unlink($_POST['oAttach']);
         }
         $model->image_list = $imageListSerialize['dataSerialize'];
         $model->layout_list = $layoutListSerialize['dataSerialize'];
         if ($model->save()) {
             AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑项目,ID:' . $id));
             $this->redirect(array('index'));
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->image_list) {
         $imageList = unserialize($model->image_list);
     }
     if ($layoutList) {
         $layoutList = $layoutListSerialize['data'];
     } elseif ($model->layout_list) {
         $layoutList = unserialize($model->layout_list);
     }
     $this->city_list = parent::_groupList('city');
     $this->render('update', array('model' => $model, 'imageList' => $imageList, 'layoutList' => $layoutList));
 }
开发者ID:zywh,项目名称:maplecity,代码行数:41,代码来源:SubjectController.php

示例6: actionUpdate

 /**
  * 更新
  *
  * @param  $id
  */
 public function actionUpdate($id)
 {
     parent::_acl();
     $attr = $this->_gets->getParam('attr');
     $model = parent::_dataLoad(new Post(), $id);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Post'])) {
         $style = $this->_gets->getParam('style');
         $acl = $this->_gets->getParam('acl');
         $styleFormat = XUtils::titleStyle($style);
         $model->attributes = $_POST['Post'];
         $file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(400, 250)));
         if (is_array($file)) {
             $model->attach_file = $file['pathname'];
             $model->attach_thumb = $file['paththumbname'];
             $model->attach_status = 'Y';
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         $model->title_style = $styleFormat['text'];
         $model->title_style_serialize = $styleFormat['serialize'];
         $model->acl = is_array($acl) ? implode(',', $acl) : '';
         $model->image_list = $imageListSerialize['dataSerialize'];
         if ($model->save()) {
             Attr::xupdate($model->id, $attr);
             Post2tags::build('update', $_POST['Post']['tags'], $model->id, $model->catalog_id);
             AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑内容,ID:' . $id));
             $this->redirect(array('index'));
         }
     }
     $attrModel = Attr::lists($model->catalog_id, 'post');
     if ($attr) {
         $attrData = Attr::dataReset($attr);
     } else {
         $attrData = Attr::datas($model->id);
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->image_list) {
         $imageList = unserialize($model->image_list);
     }
     $this->render('update', array('model' => $model, 'imageList' => $imageList, 'attrModel' => $attrModel, 'attrData' => $attrData, 'groupList' => $this->_groupList('user')));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:49,代码来源:PostController.php

示例7: actionUpdate

 /**
  * 更新
  *
  * @param  $id
  */
 public function actionUpdate($id)
 {
     parent::_acl('house_update');
     $original = Yii::app()->request->getQuery('original');
     $model = parent::_dataLoad(new House(), $id);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['House'])) {
         $model->attributes = $_POST['House'];
         $model->accessDate = strtotime($_POST['House']['accessDate']);
         $model->match = implode(',', $_POST['House']['match']);
         $file = XUpload::upload($_FILES['house_image']);
         if (is_array($file)) {
             $model->house_image = $file['pathname'];
             @unlink($_POST['oAttach']);
         }
         $model->image_list = $imageListSerialize['dataSerialize'];
         if ($model->save()) {
             AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑房源信息,ID:' . $id));
             if (!empty($original)) {
                 $this->redirect($original);
             } else {
                 $this->redirect(array('index'));
             }
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->image_list) {
         $imageList = unserialize($model->image_list);
     }
     $this->subject_list = parent::_groupList('subject');
     $this->city_list = parent::_groupList('city');
     $this->district_list = parent::_groupList('district');
     $this->investType_list = parent::_groupList('investType');
     $this->propertyType_list = parent::_groupList('propertyType');
     $this->match_list = parent::_groupList('match');
     $this->render('update', array('model' => $model, 'imageList' => $imageList, 'original' => $original));
 }
开发者ID:zywh,项目名称:maplecity,代码行数:44,代码来源:HouseController.php


注:本文中的XUtils::imageListSerialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。