Пример #1
0
 /**
  * [ADMIN] 並び替えを更新する
  *
  * @return bool
  */
 public function admin_update_sort()
 {
     $user = $this->BcAuth->user();
     if ($this->request->data) {
         if ($this->Favorite->changeSort($this->request->data['Sort']['id'], $this->request->data['Sort']['offset'], array('Favorite.user_id' => $user['id']))) {
             clearDataCache();
             exit(true);
         }
     }
     $this->ajaxError(400, '無効な処理です。');
     exit;
 }
Пример #2
0
 /**
  * afterSave
  *
  * @return boolean
  * @access public
  */
 public function afterSave($created, $options = array())
 {
     if (empty($this->data['BlogContent']['id'])) {
         $this->data['BlogContent']['id'] = $this->getInsertID();
     }
     // 検索用テーブルへの登録・削除
     if (!$this->data['BlogContent']['exclude_search'] && $this->data['BlogContent']['status']) {
         $this->saveContent($this->createContent($this->data));
         clearDataCache();
         $datas = $this->BlogPost->find('all', array('conditions' => array('BlogPost.blog_content_id' => $this->data['BlogContent']['id']), 'recursive' => -1));
         foreach ($datas as $data) {
             $this->BlogPost->set($data);
             $this->BlogPost->afterSave(true);
         }
     } else {
         $this->deleteContent($this->data['BlogContent']['id']);
     }
 }
Пример #3
0
/**
 * キャッシュファイルを全て削除する
 */
function clearAllCache()
{
    Cache::clear(false, '_cake_core_');
    Cache::clear(false, '_cake_model_');
    Cache::clear(false, '_cake_env_');
    // viewキャッシュ削除
    clearCache();
    // dataキャッシュ削除
    clearDataCache();
}
Пример #4
0
 /**
  * 並び替えを更新する [AJAX]
  *
  * @return bool
  */
 public function admin_ajax_update_sort()
 {
     if ($this->request->data) {
         if ($this->Plugin->changePriority($this->request->data['Sort']['id'], $this->request->data['Sort']['offset'])) {
             clearViewCache();
             clearDataCache();
             echo true;
         } else {
             $this->ajaxError(500, '一度リロードしてから再実行してみてください。');
         }
     } else {
         $this->ajaxError(500, '無効な処理です。');
     }
     exit;
 }
Пример #5
0
 /**
  * 並び替えを更新する [AJAX]
  *
  * @access public
  * @return boolean
  */
 function admin_ajax_update_sort()
 {
     if ($this->data) {
         $this->setViewConditions('Page', array('action' => 'admin_index'));
         $conditions = $this->_createAdminIndexConditions($this->data);
         $this->Page->fileSave = false;
         $this->Page->contentSaving = false;
         if ($this->Page->changeSort($this->data['Sort']['id'], $this->data['Sort']['offset'], $conditions)) {
             clearViewCache();
             clearDataCache();
             echo true;
         } else {
             $this->ajaxError(500, '一度リロードしてから再実行してみてください。');
         }
     } else {
         $this->ajaxError(500, '無効な処理です。');
     }
     exit;
 }
Пример #6
0
 /**
  * [ADMIN] 並び替えを更新する
  *
  * @access public
  * @return boolean
  */
 function admin_update_sort()
 {
     if ($this->data) {
         if ($this->Favorite->changeSort($this->data['Sort']['id'], $this->data['Sort']['offset'])) {
             clearDataCache();
             exit(true);
         }
     }
     exit;
 }
Пример #7
0
 /**
  * 並び替えを更新する [AJAX]
  *
  * @access public
  * @return boolean
  */
 function admin_update_sort()
 {
     if ($this->data) {
         $this->setViewConditions('Page', array('action' => 'admin_index'));
         $conditions = $this->_createAdminIndexConditions($this->data);
         $this->Page->fileSave = false;
         $this->Page->contentSaving = false;
         if ($this->Page->changeSort($this->data['Sort']['id'], $this->data['Sort']['offset'], $conditions)) {
             clearViewCache();
             clearDataCache();
             echo true;
         } else {
             echo false;
         }
     } else {
         echo false;
     }
     exit;
 }
Пример #8
0
 /**
  * 並び替えを更新する [AJAX]
  *
  * @return bool
  */
 public function admin_ajax_update_sort()
 {
     $this->autoRender = false;
     if ($this->request->data) {
         if ($this->Plugin->changePriority($this->request->data['Sort']['id'], $this->request->data['Sort']['offset'])) {
             clearViewCache();
             clearDataCache();
             Configure::write('debug', 0);
             return true;
         } else {
             $this->ajaxError(500, '一度リロードしてから再実行してみてください。');
         }
     } else {
         $this->ajaxError(500, '無効な処理です。');
     }
     return false;
 }