| Line 28... |
Line 28... |
| 28 |
public function index() {
|
28 |
public function index() {
|
| 29 |
// $this->Category->recursive = 0;
|
29 |
// $this->Category->recursive = 0;
|
| 30 |
// $this->set('categories', $this->Paginator->paginate());
|
30 |
// $this->set('categories', $this->Paginator->paginate());
|
| 31 |
$userId = $this->request->query('user_id');
|
31 |
$userId = $this->request->query('user_id');
|
| 32 |
$this->loadModel('UserCategory');
|
32 |
$this->loadModel('UserCategory');
|
| 33 |
$options = array('conditions' => array('user_id'=>$userId),'recursive'=>-1);
|
33 |
$options = array('conditions' => array('user_id'=>$userId),'order'=>array('rank','asc'),'recursive'=>-1);
|
| 34 |
$userCategories = $this->UserCategory->find('all',$options);
|
34 |
$userCategories = $this->UserCategory->find('all',$options);
|
| 35 |
$this->response->type('json');
|
35 |
$this->response->type('json');
|
| 36 |
$this->layout = 'ajax';
|
36 |
$this->layout = 'ajax';
|
| 37 |
$conditions = array(array('Category.parent_id !='=>0));
|
37 |
$conditions = array(array('Category.parent_id !='=>0));
|
| 38 |
if(!empty($userCategories)){
|
38 |
if(!empty($userCategories)){
|