}
}
+class IPF_Admin_ModelListener
+{
+ public function beforeEdit($o)
+ {
+ $this->beforeChange($o);
+ }
+
+ public function beforeAdd($o)
+ {
+ $this->beforeChange($o);
+ }
+
+ public function beforeChange($o)
+ {
+ }
+
+ public function afterEdit($o)
+ {
+ $this->afterChange($o);
+ }
+
+ public function afterAdd($o)
+ {
+ $this->afterChange($o);
+ }
+
+ public function afterChange($o)
+ {
+ }
+}
+
class IPF_Admin_Model
{
static $models = array();
var $inlineInstances = array();
var $perPage = 50;
public $hidden = false;
+ public $modelListeners = array();
public function __construct($modelName)
{
protected function _beforeEdit($o)
{
+ foreach ($this->modelListeners as $l)
+ $l->beforeEdit($o);
$this->_beforeChange($o);
}
protected function _beforeAdd($o)
{
+ foreach ($this->modelListeners as $l)
+ $l->beforeAdd($o);
$this->_beforeChange($o);
}
- protected function _beforeChange($o){
+ protected function _beforeChange($o)
+ {
}
protected function _afterEdit($o)
{
+ foreach ($this->modelListeners as $l)
+ $l->afterEdit($o);
$this->_afterChange($o);
}
protected function _afterAdd($o)
{
+ foreach ($this->modelListeners as $l)
+ $l->afterAdd($o);
$this->_afterChange($o);
}