Subversion Repositories SmartDukaan

Rev

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

Rev 13591 Rev 13595
Line 51... Line 51...
51
 *
51
 *
52
 * @return void
52
 * @return void
53
 */
53
 */
54
	public function add() {
54
	public function add() {
55
		if ($this->request->is('post')) {
55
		if ($this->request->is('post')) {
-
 
56
			if(isset($this->request->data['pushdata']) && !empty($this->request->data['pushdata'])) {
-
 
57
				$pushdata = json_decode($this->request->data['pushdata'],1);	
-
 
58
				$this->log(print_r($pushdata,1));
56
			$this->UserUrl->create();
59
				$this->UserUrl->create();
57
			if ($this->UserUrl->saveAll($this->request->data)) {
60
				if ($this->UserUrl->saveAll($pushdata['pushdata'])) {
58
				$result = array('success' => true,'message'=>__('The url has been saved.'));
61
					$result = array('success' => true,'message'=>__('The url has been saved.'));
59
			} else {
62
				} else {
60
				$result = array('success' => false,'message'=>__('The url could not be saved. Please, try again.'));
63
					$result = array('success' => false,'message'=>__('The url could not be saved. Please, try again.'));
61
			}
64
				}
62
			$this->response->type('json');
65
				$this->response->type('json');
63
			$this->layout = 'ajax';
66
				$this->layout = 'ajax';
64
			$this->set(array(
67
				$this->set(array(
65
			    'result' => $result,
68
				    'result' => $result,
66
			    // 'callback' => $callback,
69
				    // 'callback' => $callback,
67
			    '_serialize' => array('result')
70
				    '_serialize' => array('result')
68
			));
71
				));
69
			$this->render('/Elements/json');
72
				$this->render('/Elements/json');
-
 
73
			}			
70
		}		
74
		}		
71
	}
75
	}
72
 
76
 
73
/**
77
/**
74
 * edit method
78
 * edit method