Subversion Repositories SmartDukaan

Rev

Rev 15403 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15403 Rev 15655
Line 14... Line 14...
14
 * @var array
14
 * @var array
15
 */
15
 */
16
	public $components = array('Paginator');
16
	public $components = array('Paginator');
17
 
17
 
18
	public function index() {	
18
	public function index() {	
-
 
19
		throw new NotFoundException(__('Unauthorized access'));
19
		$this->layout = 'ajax';
20
		$this->layout = 'ajax';
20
		$t = $this->request->query('t');
21
		$t = $this->request->query('t');
21
		if(!empty($t) && $t >0){
22
		if(!empty($t) && $t >0){
22
			$options = array('conditions'=>array("unix_timestamp(modified) > "=>$t));
23
			$options = array('conditions'=>array("unix_timestamp(modified) > "=>$t));
23
		}else{
24
		}else{
Line 37... Line 38...
37
 * admin_index method
38
 * admin_index method
38
 *
39
 *
39
 * @return void
40
 * @return void
40
 */
41
 */
41
	public function admin_index() {
42
	public function admin_index() {
-
 
43
		throw new NotFoundException(__('Unauthorized access'));
42
		$this->Mobileappsetting->recursive = 0;
44
		$this->Mobileappsetting->recursive = 0;
43
		$this->set('mobileappsettings', $this->Paginator->paginate());
45
		$this->set('mobileappsettings', $this->Paginator->paginate());
44
	}
46
	}
45
 
47
 
46
/**
48
/**
Line 49... Line 51...
49
 * @throws NotFoundException
51
 * @throws NotFoundException
50
 * @param string $id
52
 * @param string $id
51
 * @return void
53
 * @return void
52
 */
54
 */
53
	public function admin_view($id = null) {
55
	public function admin_view($id = null) {
-
 
56
		throw new NotFoundException(__('Unauthorized access'));
54
		if (!$this->Mobileappsetting->exists($id)) {
57
		if (!$this->Mobileappsetting->exists($id)) {
55
			throw new NotFoundException(__('Invalid mobileappsetting'));
58
			throw new NotFoundException(__('Invalid mobileappsetting'));
56
		}
59
		}
57
		$options = array('conditions' => array('Mobileappsetting.' . $this->Mobileappsetting->primaryKey => $id));
60
		$options = array('conditions' => array('Mobileappsetting.' . $this->Mobileappsetting->primaryKey => $id));
58
		$this->set('mobileappsetting', $this->Mobileappsetting->find('first', $options));
61
		$this->set('mobileappsetting', $this->Mobileappsetting->find('first', $options));
Line 62... Line 65...
62
 * admin_add method
65
 * admin_add method
63
 *
66
 *
64
 * @return void
67
 * @return void
65
 */
68
 */
66
	public function admin_add() {
69
	public function admin_add() {
-
 
70
		throw new NotFoundException(__('Unauthorized access'));
67
		if ($this->request->is('post')) {
71
		if ($this->request->is('post')) {
68
			$this->Mobileappsetting->create();
72
			$this->Mobileappsetting->create();
69
			if ($this->Mobileappsetting->save($this->request->data)) {
73
			if ($this->Mobileappsetting->save($this->request->data)) {
70
				$this->Session->setFlash(__('The mobileappsetting has been saved.'));
74
				$this->Session->setFlash(__('The mobileappsetting has been saved.'));
71
				return $this->redirect(array('action' => 'index'));
75
				return $this->redirect(array('action' => 'index'));
Line 81... Line 85...
81
 * @throws NotFoundException
85
 * @throws NotFoundException
82
 * @param string $id
86
 * @param string $id
83
 * @return void
87
 * @return void
84
 */
88
 */
85
	public function admin_edit($id = null) {
89
	public function admin_edit($id = null) {
-
 
90
		throw new NotFoundException(__('Unauthorized access'));
86
		if (!$this->Mobileappsetting->exists($id)) {
91
		if (!$this->Mobileappsetting->exists($id)) {
87
			throw new NotFoundException(__('Invalid mobileappsetting'));
92
			throw new NotFoundException(__('Invalid mobileappsetting'));
88
		}
93
		}
89
		if ($this->request->is(array('post', 'put'))) {
94
		if ($this->request->is(array('post', 'put'))) {
90
			if ($this->Mobileappsetting->save($this->request->data)) {
95
			if ($this->Mobileappsetting->save($this->request->data)) {
Line 105... Line 110...
105
 * @throws NotFoundException
110
 * @throws NotFoundException
106
 * @param string $id
111
 * @param string $id
107
 * @return void
112
 * @return void
108
 */
113
 */
109
	public function admin_delete($id = null) {
114
	public function admin_delete($id = null) {
-
 
115
		throw new NotFoundException(__('Unauthorized access'));
110
		$this->Mobileappsetting->id = $id;
116
		$this->Mobileappsetting->id = $id;
111
		if (!$this->Mobileappsetting->exists()) {
117
		if (!$this->Mobileappsetting->exists()) {
112
			throw new NotFoundException(__('Invalid mobileappsetting'));
118
			throw new NotFoundException(__('Invalid mobileappsetting'));
113
		}
119
		}
114
		$this->request->onlyAllow('post', 'delete');
120
		$this->request->onlyAllow('post', 'delete');
Line 116... Line 122...
116
			$this->Session->setFlash(__('The mobileappsetting has been deleted.'));
122
			$this->Session->setFlash(__('The mobileappsetting has been deleted.'));
117
		} else {
123
		} else {
118
			$this->Session->setFlash(__('The mobileappsetting could not be deleted. Please, try again.'));
124
			$this->Session->setFlash(__('The mobileappsetting could not be deleted. Please, try again.'));
119
		}
125
		}
120
		return $this->redirect(array('action' => 'index'));
126
		return $this->redirect(array('action' => 'index'));
121
	}}
127
	}
-
 
128
}