-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of work on the behavior and datasources
- Loading branch information
Dean Sofer
committed
Nov 19, 2010
1 parent
e62cab1
commit 794ae2b
Showing
22 changed files
with
457 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
<?php | ||
|
||
class CartAppController extends AppController { | ||
|
||
} | ||
|
||
?> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
<?php | ||
|
||
class CartAppModel extends AppModel { | ||
|
||
} | ||
|
||
?> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
/** | ||
* CartPaymentsController | ||
* | ||
* [Short Description] | ||
* | ||
* @package Cart Plugin | ||
* @author Dean | ||
* @version $Id$ | ||
* @copyright | ||
**/ | ||
|
||
class CartPaymentsController extends AppController { | ||
var $name = 'CartPayments'; | ||
|
||
var $helpers = array('Html', 'Form'); | ||
var $components = array('Session'); | ||
|
||
function ipn($type = null) { | ||
$this->CartPayment->processIpn($_POST, $type); | ||
} | ||
|
||
/** | ||
* Index action | ||
* | ||
* @access public | ||
*/ | ||
function index() { | ||
$this->Payment->recursive = 0; | ||
$this->set('cartPayments', $this->paginate()); | ||
} | ||
|
||
/** | ||
* View action | ||
* | ||
* @access public | ||
* @param integer $id ID of record | ||
*/ | ||
function view($id = null) { | ||
if (!$id) { | ||
$this->Session->setFlash(__('Invalid Payment', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} | ||
$this->set('payment', $this->Payment->read(null, )); | ||
} | ||
|
||
/** | ||
* Add action | ||
* | ||
* @access public | ||
*/ | ||
function add() { | ||
if (!empty(->data)) { | ||
$this->Payment->create(); | ||
if ($this->Payment->save($this->data)) { | ||
$this->Session->setFlash(__('The Payment has been saved', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} else { | ||
$this->Session->setFlash(__('The Payment could not be saved. Please, try again.', true)); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Edit action | ||
* | ||
* @access public | ||
* @param integer $id ID of record | ||
*/ | ||
function edit($id = null) { | ||
if (!$id && empty($this->data)) { | ||
$this->Session->setFlash(__('Invalid Payment', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} | ||
if (!empty($this->data)) { | ||
if ($this->Payment->save($this->data)) { | ||
$this->Session->setFlash(__('The Payment has been saved', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} else { | ||
$this->Session->setFlash(__('The Payment could not be saved. Please, try again.', true)); | ||
} | ||
} | ||
if (empty(->data)) { | ||
$this->data = ->Payment->read(null, $id); | ||
} | ||
} | ||
|
||
/** | ||
* Delete action | ||
* | ||
* @access public | ||
* @param integer $id ID of record | ||
*/ | ||
function delete($id = null) { | ||
if (!$id) { | ||
$this->Session->setFlash(__('Invalid id for Payment', true)); | ||
$this->redirect(array('action'=>'index')); | ||
} | ||
if ($this->Payment->delete($id)) { | ||
$this->Session->setFlash(__('Payment deleted', true)); | ||
$this->redirect(array('action'=>'index')); | ||
} | ||
$this->Session->setFlash(__('Payment was not deleted', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} | ||
} | ||
?> |
Oops, something went wrong.