Subversion Repositories SmartDukaan

Rev

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

Rev 13532 Rev 13565
Line 14... Line 14...
14
/**
14
/**
15
 * This controller does not use a model
15
 * This controller does not use a model
16
 *
16
 *
17
 * @var array
17
 * @var array
18
 */
18
 */
19
	public $uses = array();
19
	public $uses = array('Api');
20
 
20
 
21
	public $components = array('Paginator','RequestHandler');
21
	public $components = array('Paginator','RequestHandler');
22
/**
22
/**
23
 * Displays a view
23
 * Displays a view
24
 *
24
 *
Line 29... Line 29...
29
 */
29
 */
30
	public function display() {
30
	public function display() {
31
		if($this->request->is('ajax')){
31
		if($this->request->is('ajax')){
32
			$this->layout = 'ajax';
32
			$this->layout = 'ajax';
33
		}
33
		}
34
		$this->loadModel('Album');
-
 
35
		$path = func_get_args();
34
		$path = func_get_args();
36
 
35
 
37
		$count = count($path);
36
		$count = count($path);
38
		if (!$count) {
37
		if (!$count) {
39
			return $this->redirect('/');
38
			return $this->redirect('/');
Line 49... Line 48...
49
		if (!empty($path[$count - 1])) {
48
		if (!empty($path[$count - 1])) {
50
			$title_for_layout = Inflector::humanize($path[$count - 1]);
49
			$title_for_layout = Inflector::humanize($path[$count - 1]);
51
		}
50
		}
52
		$title_for_layout = "Get Cashback on favourite";
51
		$title_for_layout = "Get Cashback on favourite";
53
		$description = "Get cashback on your favourite products.Mouth watering deals";
52
		$description = "Get cashback on your favourite products.Mouth watering deals";
54
 
-
 
-
 
53
		$apideals = $this->Api->getDeals();
-
 
54
		$deals = $apideals['products'];
55
		//Load the most viewed videos
55
		//Load the most viewed videos
56
		$this->set(compact('page', 'subpage', 'title_for_layout', 'description', 'authurl'));
56
		$this->set(compact('page', 'subpage', 'title_for_layout', 'description', 'deals'));
57
		try {
57
		try {
58
			$this->render(implode('/', $path));
58
			$this->render(implode('/', $path));
59
		} catch (MissingViewException $e) {
59
		} catch (MissingViewException $e) {
60
			if (Configure::read('debug')) {
60
			if (Configure::read('debug')) {
61
				throw $e;
61
				throw $e;