6 * - base application setup (variables etc to javascript)
8 * - authentication and permission info about user / application
9 * - json output methods.
10 * - file upload error checking - checkFileUploadError
11 * - logging to event table
12 * - sendTemplate code (normally use the Person version for sending to specific people..)
14 * - doc managment code?? - remarks and tracking??? - MOVEME
15 * - authentication link checking?? MOVEME?
16 * - authentication reset password ?? MOVEME?
17 * ?? arrayClean.. what's it doing here?!? ;)
21 * Pman['local_autoauth'] // who to login as when using localhost
22 * Pman['isDev'] // can the site show develpment info.?
23 * Pman['uiConfig'] // extra variable to export to front end..
24 * Pman['auth_comptype'] // -- if set to 'OWNER' then only users with company=OWNER can log in
25 * Pman['authTable'] // the authentication table (default 'person')
29 * DB_DataObject*:*toEventString (for logging - this is generically prefixed to all database operations.)
30 * - any data object where this method exists, the result will get prefixed to the log remarks
37 require_once 'Pman/Core/AssetTrait.php';
39 class Pman extends HTML_FlexyFramework_Page
41 use Pman_Core_AssetTrait;
42 //outputJavascriptDir()
47 var $appShortName= "";
48 var $appVersion = "1.8";
55 var $appDisabled = array(); // array of disabled modules..
56 // (based on config option disable)
58 var $authUser; // always contains the authenticated user..
60 var $disable_jstemplate = false; /// disable inclusion of jstemplate code..
64 * ------------- Standard getAuth/get/post methods of framework.
69 function getAuth() // everyone allowed in!!!!!
71 $this->loadOwnerCompany();
79 if (isset($this->_hasInit)) {
82 $this->_hasInit = true;
83 // move away from doing this ... you can access bootLoader.XXXXXX in the master template..
84 $boot = HTML_FlexyFramework::get();
85 // echo'<PRE>';print_R($boot);exit;
86 $this->appName= $boot->appName;
87 $this->appNameShort= $boot->appNameShort;
90 $this->appModules= $boot->enable;
92 // echo $this->arrayToJsInclude($files);
93 $this->isDev = empty($boot->Pman['isDev']) ? false : $boot->Pman['isDev'];
95 $this->appDisable = $boot->disable;
96 $this->appDisabled = explode(',', $boot->disable);
97 $this->version = $boot->version;
98 $this->uiConfig = empty($boot->Pman['uiConfig']) ? false : $boot->Pman['uiConfig'];
100 if (!empty($ff->Pman['local_autoauth']) &&
101 ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
102 ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
107 // if a file Pman_{module}_Pman exists.. and it has an init function... - call that..
109 //var_dump($this->appModules);
115 * module init is only loaded on main page call, and includes checks for configuration settings.
117 function initModules()
119 foreach(explode(',',$this->appModules) as $m) {
120 $cls = 'Pman_'. $m . '_Pman';
122 //echo $this->rootDir . '/'.str_replace('_','/', $cls). '.php';
124 if (!file_exists($this->rootDir . '/'.str_replace('_','/', $cls). '.php')) {
127 require_once str_replace('_','/', $cls). '.php';
129 if (method_exists($c,'init')) {
137 function get($base, $opts=array())
141 $this->initModules();
144 //$this->allowSignup= empty($opts['allowSignup']) ? 0 : 1;
145 $bits = explode('/', $base);
148 // should really be moved to Login...
150 if ($bits[0] == 'PasswordReset') {
151 $this->linkFail = $this->resetPassword(@$bits[1],@$bits[2],@$bits[3]);
152 header('Content-type: text/html; charset=utf-8');
156 $au = $this->getAuthUser();
158 $ff= HTML_FlexyFramework::get();
160 if (!empty($ff->Pman['auth_comptype']) && $au->id > 0 &&
161 ( !$au->company_id || ($ff->Pman['auth_comptype'] != $au->company()->comptype))) {
165 $this->jerr("Login not permited to outside companies - please reload");
167 $this->addEvent("RELOAD");
172 $this->jerror("BADURL","invalid url: $base");
175 if (isset($_GET['onloadTrack'])) {
176 $this->onloadTrack = (int)$_GET['onloadTrack'];
178 // getting this to work with xhtml is a nightmare
179 // = nbsp / <img> issues screw everyting up.
180 //var_dump($this->isDev);
181 // force regeneration on load for development enviroments..
183 HTML_FlexyFramework::get()->generateDataobjectsCache($this->isDev);
185 //header('Content-type: application/xhtml+xml; charset=utf-8');
189 if ($this->company && $this->company->logo_id) {
190 $im = DB_DataObject::Factory('Images');
191 $im->get($this->company->logo_id);
192 $this->appLogo = $this->baseURL . '/Images/Thumb/300x100/'. $this->company->logo_id .'/' . $im->filename;
195 header('Content-type: text/html; charset=utf-8');
198 function post($base) {
199 return $this->get($base);
203 // --------------- AUTHENTICATION or system information
206 * finds the compay with comptype=='OWNER'
208 * @return {Pman_Core_DataObjects_Companies} the owner company
210 function loadOwnerCompany()
212 // only applies if authtable is person..
213 $ff = HTML_FlexyFramework::get();
214 if (!empty($ff->Pman['authTable']) && !in_array($ff->Pman['authTable'] , [ 'core_person', 'Person' ])) {
218 $this->company = DB_DataObject::Factory('core_company');
219 if (!is_a($this->company, 'DB_DataObject')) { // non-core pman projects
222 $this->company->get('comptype', 'OWNER');
223 return $this->company;
229 * getAuthUser: - get the authenticated user..
231 * @return {DB_DataObject} of type Pman[authTable] if authenticated.
234 function getAuthUser()
236 if (!empty($this->authUser)) {
237 return $this->authUser;
239 $ff = HTML_FlexyFramework::get();
240 $tbl = empty($ff->Pman['authTable']) ? 'core_person' : $ff->Pman['authTable'];
242 $u = DB_DataObject::factory( $tbl );
246 $this->authUser =$u->getAuthUser();
247 return $this->authUser ;
251 * wrapper arround authuser->hasPerm
252 * @see Pman_Core_DataObject_Core_person::hasPerm
254 * @param {String} $name The permission name (eg. Projects.List)
255 * @param {String} $lvl eg. (C)reate (E)dit (D)elete ... etc.
258 function hasPerm($name, $lvl) // do we have a permission
260 static $pcache = array();
261 $au = $this->getAuthUser();
262 return $au && $au->hasPerm($name,$lvl);
267 * modulesList: List the modules in the application
269 * @return {Array} list of modules
271 function modulesList()
273 $boot = HTML_FlexyFramework::get();
274 // echo'<PRE>';print_R($boot);exit;
277 $mods = explode(',', $boot->enable);
278 if (in_array('Core',$mods)) { // core has to be the first modules loaded as it contains Pman.js
279 array_unshift($mods, 'Core');
282 if (in_array($boot->appNameShort,$mods)) { // Project has to be the last modules loaded as it contains Pman.js
283 unset($mods[array_search($boot->appNameShort, $mods)]);
284 $mods[] = $boot->appNameShort;
287 $mods = array_unique($mods);
289 $disabled = explode(',', $boot->disable ? $boot->disable : '');
291 foreach($mods as $mod) {
292 // add the css file..
293 if (in_array($mod, $disabled)) {
304 function hasModule($name)
307 if (!strpos( $name,'.') ) {
308 // use enable / disable..
309 return in_array($name, $this->modules());
312 $x = DB_DataObject::factory('core_group_right');
313 $ar = $x->defaultPermData();
314 if (empty($ar[$name]) || empty($ar[$name][0])) {
329 * ---------------- Global Tools ---------------
331 function checkFileUploadError() // check for file upload errors.
334 empty($_FILES['File'])
335 || empty($_FILES['File']['name'])
336 || empty($_FILES['File']['tmp_name'])
337 || empty($_FILES['File']['type'])
338 || !empty($_FILES['File']['error'])
339 || empty($_FILES['File']['size'])
341 $this->jerr("File upload error: <PRE>" . print_r($_FILES,true) . print_r($_POST,true) . "</PRE>");
347 * generate a tempory file with an extension (dont forget to delete it)
350 function tempName($ext)
352 $x = tempnam(ini_get('session.save_path'), HTML_FlexyFramework::get()->appNameShort.'TMP');
354 return $x .'.'. $ext;
359 * ------------- Authentication password reset ------ ??? MOVEME?
365 function resetPassword($id,$t, $key)
368 $au = $this->getAuthUser();
370 return "Already Logged in - no need to use Password Reset";
373 $u = DB_DataObject::factory('core_person');
374 //$u->company_id = $this->company->id;
376 if (!$u->get($id) || !strlen($u->passwd)) {
381 if ($key != $u->genPassKey($t)) {
382 return "invalid key";
385 $u->no_reset_sent = 0;
388 if ($t < strtotime("NOW - 1 DAY")) {
391 $this->showNewPass = implode("/", array($id,$t,$key));
396 * jerrAuth: standard auth failure - with data that let's the UI know..
400 $au = $this->authUser();
402 // is it an authfailure?
403 $this->jerr("Permission denied to view this resource", array('authFailure' => true));
405 $this->jerr("Not authenticated", array('authFailure' => true));
411 * ---------------- Standard JSON outputers. - used everywhere
414 * ---------------- Standard JSON outputers. - used everywhere
415 * JSON error - simple error with logging.
419 function jerr($str, $errors=array(), $content_type = false) // standard error reporting..
421 return $this->jerror('ERROR', $str,$errors,$content_type);
424 * Recomended JSON error indicator
427 * @param string $type - normally 'ERROR' - you can use this to track error types.
428 * @param string $message - error message displayed to user.
429 * @param array $errors - optioanl data to pass to front end.
430 * @param string $content_type - use text/plain to return plan text - ?? not sure why...
434 function jerror($type, $str, $errors=array(), $content_type = false) // standard error reporting..
436 if ($type !== false) {
437 $this->addEvent($type, false, $str);
440 $cli = HTML_FlexyFramework::get()->cli;
442 echo "ERROR: " .$str . "\n";
443 exit(1); // cli --- exit code to stop shell execution if necessary.
447 if ($content_type == 'text/plain') {
448 header('Content-Disposition: attachment; filename="error.txt"');
449 header('Content-type: '. $content_type);
450 echo "ERROR: " .$str . "\n";
456 require_once 'Services/JSON.php';
457 $json = new Services_JSON();
461 $retHTML = isset($_SERVER['CONTENT_TYPE']) &&
462 preg_match('#multipart/form-data#i', $_SERVER['CONTENT_TYPE']);
465 if (isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] == 'NO') {
469 $retHTML = isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] !='NO';
474 header('Content-type: text/html');
475 echo "<HTML><HEAD></HEAD><BODY>";
476 echo $json->encodeUnsafe(array(
479 'message' => $str, // compate with exeption / loadexception.
481 'errors' => $errors ? $errors : true, // used by forms to flag errors.
482 'authFailure' => !empty($errors['authFailure']),
484 echo "</BODY></HTML>";
488 if (isset($_REQUEST['_debug'])) {
489 echo '<PRE>'.htmlspecialchars(print_r(array(
493 'message' => $str, // compate with exeption / loadexception.
494 'errors' => $errors ? $errors : true, // used by forms to flag errors.
495 'authFailure' => !empty($errors['authFailure']),
501 echo $json->encode(array(
505 'message' => $str, // compate with exeption / loadexception.
506 'errors' => $errors ? $errors : true, // used by forms to flag errors.
507 'authFailure' => !empty($errors['authFailure']),
516 $cli = HTML_FlexyFramework::get()->cli;
518 echo "OK: " .$str . "\n";
521 require_once 'Services/JSON.php';
522 $json = new Services_JSON();
524 $retHTML = isset($_SERVER['CONTENT_TYPE']) &&
525 preg_match('#multipart/form-data#i', $_SERVER['CONTENT_TYPE']);
528 if (isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] == 'NO') {
532 $retHTML = isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] !='NO';
536 header('Content-type: text/html');
537 echo "<HTML><HEAD></HEAD><BODY>";
538 // encode html characters so they can be read..
539 echo str_replace(array('<','>'), array('\u003c','\u003e'),
540 $json->encodeUnsafe(array('success'=> true, 'data' => $str)));
541 echo "</BODY></HTML>";
546 echo $json->encode(array('success'=> true, 'data' => $str));
552 * output data for grids or tree
553 * @ar {Array} ar Array of data
554 * @total {Number|false} total number of records (or false to return count(ar)
555 * @extra {Array} extra key value list of data to pass as extra data.
558 function jdata($ar,$total=false, $extra=array(), $cachekey = false)
560 // should do mobile checking???
561 if ($total == false) {
564 $extra= $extra ? $extra : array();
565 require_once 'Services/JSON.php';
566 $json = new Services_JSON();
568 $retHTML = isset($_SERVER['CONTENT_TYPE']) &&
569 preg_match('#multipart/form-data#i', $_SERVER['CONTENT_TYPE']);
572 if (isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] == 'NO') {
576 $retHTML = isset($_REQUEST['returnHTML']) && $_REQUEST['returnHTML'] !='NO';
581 header('Content-type: text/html');
582 echo "<HTML><HEAD></HEAD><BODY>";
583 // encode html characters so they can be read..
584 echo str_replace(array('<','>'), array('\u003c','\u003e'),
585 $json->encodeUnsafe(array('success' => true, 'total'=> $total, 'data' => $ar) + $extra));
586 echo "</BODY></HTML>";
591 // see if trimming will help...
592 if (!empty($_REQUEST['_pman_short'])) {
595 foreach($ar as $as) {
597 foreach($as as $k=>$v) {
598 if (is_string($v) && !strlen(trim($v))) {
610 $ret = $json->encode(array('success' => true, 'total'=> $total, 'data' => $ar) + $extra);
612 if (!empty($cachekey)) {
614 $fn = ini_get('session.save_path') . '/json-cache'.date('/Y/m/d').'.'. $cachekey . '.cache.json';
615 if (!file_exists(dirname($fn))) {
616 mkdir(dirname($fn), 0777,true);
618 file_put_contents($fn, $ret);
626 /** a daily cache **/
627 function jdataCache($cachekey)
629 $fn = ini_get('session.save_path') . '/json-cache'.date('/Y/m/d').'.'. $cachekey . '.cache.json';
630 if (file_exists($fn)) {
631 header('Content-type: application/json');
632 echo file_get_contents($fn);
642 * ---------------- OUTPUT
644 function hasBg($fn) // used on front page to check if logos exist..
646 return file_exists($this->rootDir.'/Pman/'.$this->appNameShort.'/templates/images/'. $fn);
649 * outputJavascriptIncludes:
651 * output <script....> for all the modules in the applcaiton
654 function outputJavascriptIncludes()
656 // BC support - currently 1 project still relies on this.. (MO portal)
657 $o = HTML_FlexyFramework::get()->Pman_Core;
658 if (isset($o['packseed'])) {
659 return $this->outputJavascriptIncludesBC();
663 $mods = $this->modulesList();
665 foreach($mods as $mod) {
666 // add the css file..
668 $this->outputJavascriptDir("Pman/$mod/widgets", "*.js");
669 $this->outputJavascriptDir("Pman/$mod", "*.js");
673 if (empty($this->disable_jstemplate)) {
674 // and finally the JsTemplate...
675 echo '<script type="text/javascript" src="'. $this->baseURL. '/Core/JsTemplate"></script>'."\n";
683 * output <link rel=stylesheet......> for all the modules in the applcaiton
686 * This could css minify as well.
688 function outputCSSIncludes() // includes on CSS links.
691 $mods = $this->modulesList();
694 foreach($mods as $mod) {
695 // add the css file..
696 $this->outputCSSDir("Pman/$mod","*.css");
719 // --- OLD CODE - in for BC on MO project.... - needs removing...
721 // used on old versions.....
722 function outputJavascriptIncludesBC()
725 $mods = $this->modulesList();
727 foreach($mods as $mod) {
728 // add the css file..
731 $files = $this->moduleJavascriptList($mod.'/widgets');
732 foreach($files as $f) {
733 echo '<script type="text/javascript" src="'. $f. '"></script>'."\n";
736 $files = $this->moduleJavascriptList($mod);
737 foreach($files as $f) {
738 echo '<script type="text/javascript" src="'. $f. '"></script>'."\n";
742 if (empty($this->disable_jstemplate)) {
743 // and finally the JsTemplate...
744 echo '<script type="text/javascript" src="'. $this->baseURL. '/Core/JsTemplate"></script>'."\n";
749 * Gather infor for javascript files..
751 * @param {String} $mod the module to get info about.
752 * @return {StdClass} details about module.
754 function moduleJavascriptFilesInfo($mod)
757 static $cache = array();
759 if (isset($cache[$mod])) {
764 $ff = HTML_FlexyFramework::get();
766 $base = dirname($_SERVER['SCRIPT_FILENAME']);
767 $dir = $this->rootDir.'/Pman/'. $mod;
768 $path = $this->rootURL ."/Pman/$mod/";
770 $ar = glob($dir . '/*.js');
776 foreach($ar as $fn) {
778 // got the 'module file..'
779 $mtime = filemtime($dir . '/'. $f);
780 $maxtime = max($mtime, $maxtime);
781 $arfiles[$fn] = $mtime;
782 $files[] = $path . $f . '?ts='.$mtime;
785 ksort($arfiles); // just sort by name so it's consistant for serialize..
787 $compile = empty($ff->Pman['public_cache_dir']) ? 0 : 1;
788 $basedir = $compile ? $ff->Pman['public_cache_dir'] : false;
789 $baseurl = $compile ? $ff->Pman['public_cache_url'] : false;
791 $lsort = create_function('$a,$b','return strlen($a) > strlen($b) ? 1 : -1;');
792 usort($files, $lsort);
794 $smod = str_replace('/','.',$mod);
796 $output = date('Y-m-d-H-i-s-', $maxtime). $smod .'-'.md5(serialize($arfiles)) .'.js';
799 // why are translations done like this - we just build them on the fly frmo the database..
800 $tmtime = file_exists($this->rootDir.'/_translations_/'. $smod.'.js')
801 ? filemtime($this->rootDir.'/_translations_/'. $smod.'.js') : 0;
803 $cache[$mod] = (object) array(
804 'smod' => $smod, // module name without '/'
805 'files' => $files, // list of all files.
806 'filesmtime' => $arfiles, // map of mtime=>file
807 'maxtime' => $maxtime, // max mtime
808 'compile' => $this->isDev ? false : $compile,
809 'translation_file' => $base .'/_translations_/' . $smod . '.js',
810 'translation_mtime' => $tmtime,
812 'translation_data' => preg_replace('/\.js$/', '.__translation__.js', $output),
813 'translation_base' => $dir .'/', //prefix of filename (without moudle name))
814 'basedir' => $basedir,
815 'baseurl' => $baseurl,
816 'module_dir' => $dir,
823 * moduleJavascriptList: list the javascript files in a module
825 * The original version of this.. still needs more thought...
827 * Compiled is in Pman/_compiled_/{$mod}/{LATEST...}.js
828 * Translations are in Pman/_translations_/{$mod}.js
830 * if that stuff does not exist just list files in Pman/{$mod}/*.js
832 * Compiled could be done on the fly..
836 * @param {String} $mod the module to look at - eg. Pman/{$mod}/*.js
837 * @return {Array} list of include paths (either compiled or raw)
843 function moduleJavascriptList($mod)
847 $dir = $this->rootDir.'/Pman/'. $mod;
850 if (!file_exists($dir)) {
851 echo '<!-- missing directory '. htmlspecialchars($dir) .' -->';
855 $info = $this->moduleJavascriptFilesInfo($mod);
859 if (empty($info->files)) {
862 // finally sort the files, so they are in the right order..
864 // only compile this stuff if public_cache is set..
868 // public_cache_dir = /var/www/myproject_cache
869 // public_cache_url = /myproject_cache (with Alias apache /myproject_cache/ /var/www/myproject_cache/)
872 if (!$info->compile) {
873 echo "<!-- Javascript compile turned off (isDev on, or public_cache_dir not set) -->\n";
877 // where are we going to write all of this..
878 // This has to be done via a
879 if (!file_exists($info->basedir.'/'.$info->output) || !filesize($info->basedir.'/'.$info->output)) {
880 require_once 'Pman/Core/JsCompile.php';
881 $x = new Pman_Core_JsCompile();
883 $x->pack($info->filesmtime,$info->basedir.'/'.$info->output, $info->translation_base);
885 echo "<!-- file exists not exist: {$info->basedir}/{$info->output} -->\n";
888 if (file_exists($info->basedir.'/'.$info->output) &&
889 filesize($info->basedir.'/'.$info->output)) {
892 $info->baseurl.'/'. $info->output,
895 // output all the ava
896 // fixme - this needs the max datetime for the translation file..
897 $ret[] = $this->baseURL."/Admin/InterfaceTranslations/".$mod.".js"; //?ts=".$info->translation_mtime;
899 //if ($info->translation_mtime) {
900 // $ret[] = $this->rootURL."/_translations_/". $info->smod.".js?ts=".$info->translation_mtime;
907 // give up and output original files...
917 * PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
919 function initErrorHandling()
921 if (!class_exists('HTML_FlexyFramework2')) {
922 // what about older code that still users PEAR?
923 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
925 set_exception_handler(array($this,'onException'));
930 static $permitError = false; // static why?
932 var $showErrorToUser = true;
934 function onPearError($err)
936 return $this->onException($err);
941 function onException($ex)
944 static $reported = false;
949 if (Pman::$permitError) {
955 $out = is_a($ex,'Exception') ? $ex->getMessage() : $ex->toString();
958 //print_R($bt); exit;
961 $bt = is_a($ex,'Exception') ? $ex->getTrace() : $ex->backtrace;
962 foreach( $bt as $b) {
963 $ret[] = @$b['file'] . '(' . @$b['line'] . ')@' . @$b['class'] . '::' . @$b['function'];
969 //convert the huge backtrace into something that is readable..
970 $out .= "\n" . implode("\n", $ret);
972 $this->addEvent("EXCEPTION", false, $out);
974 if ($this->showErrorToUser) {
977 // not sure why this is here... - perhaps doing a jerr() was actually caught by the UI, and hidden from the user..?
978 $this->jerror(false,"An error Occured, please contact the website owner");
987 * ---------------- Logging ---------------
992 * Log an action (only if it has not been logged already.
994 * @param {String} action - group/name of event
995 * @param {DataObject|false} obj - dataobject action occured on.
996 * @param {String} any remarks
997 * @return {false|DB_DataObject} Event object.,
1000 function addEventOnce($act, $obj = false, $remarks = '')
1002 if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])) {
1005 $e = DB_DataObject::factory('Events');
1006 $e->init($act,$obj,$remarks);
1007 if ($e->find(true)) {
1010 return $this->addEvent($act, $obj, $remarks);
1016 * @param {String} action - group/name of event
1017 * @param {DataObject|false} obj - dataobject action occured on.
1018 * @param {String} any remarks
1019 * @return {DB_DataObject} Event object.,
1022 function addEvent($act, $obj = false, $remarks = '')
1025 if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])) {
1028 $au = $this->getAuthUser();
1030 $e = DB_DataObject::factory('Events');
1031 $e->init($act,$obj,$remarks);
1033 $e->event_when = date('Y-m-d H:i:s');
1035 $eid = $e->insert();
1037 // fixme - this should be in onInsert..
1038 $wa = DB_DataObject::factory('core_watch');
1039 if (method_exists($wa,'notifyEvent')) {
1040 $wa->notifyEvent($e); // trigger any actions..
1044 $e->onInsert(isset($_REQUEST) ? $_REQUEST : array() , $this);
1051 function addEventNotifyOnly($act, $obj = false, $remarks = '')
1053 $au = $this->getAuthUser();
1055 $e = DB_DataObject::factory('Events');
1056 $e->init($act,$obj,$remarks);
1058 $e->event_when = date('Y-m-d H:i:s');
1059 $wa = DB_DataObject::factory('core_watch');
1060 if (method_exists($wa,'notifyEvent')) {
1061 $wa->notifyEvent($e); // trigger any actions..
1066 // ------------------ DEPERCIATED ----------------------------
1068 // DEPRECITAED - use moduleslist
1069 function modules() { return $this->modulesList(); }
1071 // DEPRECIATED.. - use getAuthUser...
1072 function staticGetAuthUser() { $x = new Pman(); return $x->getAuthUser(); }
1075 // DEPRICATED USE Pman_Core_Mailer
1077 function emailTemplate($templateFile, $args)
1080 require_once 'Pman/Core/Mailer.php';
1081 $r = new Pman_Core_Mailer(array(
1082 'template'=>$templateFile,
1083 'contents' => $args,
1086 return $r->toData();
1089 // DEPRICATED - USE Pman_Core_Mailer
1090 // WHAT Part about DEPRICATED Does no one understand??
1091 function sendTemplate($templateFile, $args)
1093 require_once 'Pman/Core/Mailer.php';
1094 $r = new Pman_Core_Mailer(array(
1095 'template'=>$templateFile,
1096 'contents' => array(),