Subversion Repositories SmartDukaan

Rev

Rev 13758 | Rev 16423 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13758 Rev 16261
Line 13... Line 13...
13
 *
13
 *
14
 * @var array
14
 * @var array
15
 */
15
 */
16
	public $components = array('Paginator');
16
	public $components = array('Paginator');
17
 
17
 
-
 
18
	public function beforeFilter() {
-
 
19
		parent::beforeFilter();
-
 
20
		$this->Auth->allow('filter');
-
 
21
	}
-
 
22
 
18
/**
23
/**
19
 * index method
24
 * index method
20
 *
25
 *
21
 * @return void
26
 * @return void
22
 */
27
 */
Line 55... Line 60...
55
				$this->Session->setFlash(__('The brand could not be saved. Please, try again.'));
60
				$this->Session->setFlash(__('The brand could not be saved. Please, try again.'));
56
			}
61
			}
57
		}
62
		}
58
	}
63
	}
59
 
64
 
-
 
65
	public function filter($str,$catId=3) {
-
 
66
		setcookie("brandschosen", urldecode($str), time()+6*3600, '/');
-
 
67
		$this->redirect('/category/'.$catId);
-
 
68
	}	
-
 
69
 
60
/**
70
/**
61
 * edit method
71
 * edit method
62
 *
72
 *
63
 * @throws NotFoundException
73
 * @throws NotFoundException
64
 * @param string $id
74
 * @param string $id
Line 188... Line 198...
188
			$this->Session->setFlash(__('The brand has been deleted.'));
198
			$this->Session->setFlash(__('The brand has been deleted.'));
189
		} else {
199
		} else {
190
			$this->Session->setFlash(__('The brand could not be deleted. Please, try again.'));
200
			$this->Session->setFlash(__('The brand could not be deleted. Please, try again.'));
191
		}
201
		}
192
		return $this->redirect(array('action' => 'index'));
202
		return $this->redirect(array('action' => 'index'));
193
	}}
203
	}
-
 
204
 
-
 
205
	public function admin_genurl() {
-
 
206
		$this->Brand->Category->Behaviors->attach('Containable');
-
 
207
		$options = array('conditions'=>array('parent_id !='=>0),'contain'=>(array('Brand.name','Brand.displayed_in_preference_page','Brand.id')));
-
 
208
		$categories = $this->Brand->Category->find('all',$options);
-
 
209
		$this->set(compact('categories'));
-
 
210
	}
-
 
211
}