public function __construct($module, $item, $value, $defaults = null) { $this->value = $value; $this->module = $module; $this->item = $item; $this->defaults = $defaults; parent::__construct($module); if (file_exists(Manager::getModulePath($module, 'db/lookup.class')) && Manager::uses('/db/lookup.class', $module) || Manager::uses('/classes/lookup.class', $module)) { eval("\$object = new Business{$module}Lookup();"); eval("\$info = \$object->autoComplete{$item}(\$this,\$defaults);"); parent::__construct($this->module); if ($info) { $this->result = $info; } else { //faz consulta $sql = new Msql(''); $sql->createFrom($this->sql); $sql->prepare($value); $db = Manager::getDatabase($this->module); //$this->sql = MSql::prepare($this->sql,$value); //$result = $this->_db->query($value ? $sql->command : str_replace('?','NULL',$this->sql)); $result = $db->query($value ? $sql->command : str_replace('?', 'NULL', $this->sql)); $this->result = $result[0]; } } }
function executeJRXML($fileInput, $parameters = null, $fileType = 'PDF', $save = false) { $this->fileType = isset($fileType) ? strtoupper(trim($fileType)) : 'PDF'; $id = uniqid(md5(uniqid(""))); // generate a unique id to avoid name conflicts $this->fileOutput = $id . "." . strtolower($this->fileType); // the report generated file $pathOut = Manager::getFilesPath($this->fileOutput, true); $pathIn = $this->getInputPath($fileInput); $javaPath = Manager::getConf("home.java"); $MJasperPath = Manager::home . '/' . Manager::getConf("home.extensions") . "/jasper"; $scriptletsPath = Manager::getModulePath($module, 'reports/scriptlets.jar'); // scriptlets allow to create custom functions for use at report $classPath = "\"{$MJasperPath}/lib/*;{$MJasperPath}/build/classes;{$scriptletsPath};{$javaPath}/lib\""; return $this->fill($pathIn, $pathOut, $fileType, $parameters, $classPath, $save); }
public function invokeHandler($m, $handler) { global $context, $module, $action, $item, $session, $page, $auth, $perms, $navbar, $theme, $history, $self, $url; if ($handler == '') { return false; } //$this->data = $data; $this->action = $handler; $app = Manager::getApp(); if ($m == '' || $m == $app) { $module = $app; $path = Manager::getAppPath() . '/controllers/'; } else { $module = $m; $path = Manager::getModulePath($module, 'controllers/'); } //mdump("Handler:invokeHandler: [$module][$handler]"); $context = Manager::getContext(); $action = $context->getAction(); $self = $context->getAction(); $item = mrequest('item'); $session = Manager::getSession(); $navbar = new MNavigationBar(); //$view = Manager::getView($module, 'handler', $action); $page = $this->theme; $url = Manager::getCurrentURL(); $auth = Manager::getAuth(); $perms = Manager::getPerms(); $theme = $this->theme; $file = $path . $handler . '.inc.php'; //mdump('Handler:invokeHandler: file : ' . $file); if ($return = file_exists($file)) { include $file; } return $return; }
public function addModuleMessages($module) { $msgDir = Manager::getModulePath($module, 'conf/'); Manager::$msg->addMessages($msgDir); }