trait Pman_Core_RooTrait {
+ var $validTables = false;
+
+ var $key;
+
+ var $transObj = false;
+
+ var $debugEnabled = true;
+
function init()
{
if (isset($this->_hasInit)) {
}
- function checkDebugPost()
- {
- return (!empty($_GET['_post']) || !empty($_GET['_debug_post'])) &&
- $this->authUser &&
- method_exists($this->authUser,'groups') &&
- in_array('Administrators', $this->authUser->groups('name'));
-
- }
-
function dataObject($tab)
{
if (is_array($this->validTables) && !in_array($tab, $this->validTables)) {
}
return $x;
-
}
+
/*
* From Pman.php
*/
$this->jerr($out);
}
+
+ function addEvent($act, $obj = false, $remarks = '')
+ {
+ if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])) {
+ return;
+ }
+
+ $e = DB_DataObject::factory('Events');
+ $e->init($act,$obj,$remarks);
+
+ $e->event_when = date('Y-m-d H:i:s');
+
+ $eid = $e->insert();
+
+ // fixme - this should be in onInsert..
+ $wa = DB_DataObject::factory('core_watch');
+ if (method_exists($wa,'notifyEvent')) {
+ $wa->notifyEvent($e); // trigger any actions..
+ }
+
+ $e->onInsert(isset($_REQUEST) ? $_REQUEST : array() , $this);
+
+ return $e;
+
+ }
+
+ function checkPerm($obj, $lvl, $req= null)
+ {
+ if (!method_exists($obj, 'checkPerm')) {
+ return true;
+ }
+ if ($obj->checkPerm($lvl, $this->getAuthUser(), $req)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ function getAuthUser()
+ {
+ die('Get auth user is not implement.');
+ }
}