public function generateInner() { $ul = new MUnorderedList(); if ($this->caption != '') { $ul->addOption($this->caption); } $separator = $this->separator ?: self::SEPARATOR; $options = $this->getControls(); if ($this->home != '') { $link = new MLink('', $this->labelHome, $this->home); $ul->addOption($link->generate()); $ul->addOption($separator); } $count = count($options); $i = 1; foreach ($options as $o) { if ($i++ < $count) { $ul->addOption($o->generate()); $ul->addOption($separator); } else { $o->setClass('active'); $ul->addOption($o->generate()); } } $ul->setClass($this->getClass()); $this->inner = $ul; }
public function init($action) { parent::init(); $spanX = new MSpan('', 'x', 'closeText'); $span = new MSpan('', $spanX->generate(), 'dijitDialogCloseIcon'); $span->setHTMLTitle('Fechar'); $span->addEvent('mouseover', "event.currentTarget.className='dijitDialogCloseIcon dijitDialogCloseIconHover';"); $span->addEvent('mouseout', "event.currentTarget.className='dijitDialogCloseIcon';"); $span->addEvent('mouseup', "event.currentTarget.className='dijitDialogCloseIcon';"); $span->addEvent('mousedown', "event.currentTarget.className='dijitDialogCloseIcon dijitDialogCloseIconActive';"); $this->setAction($action); $this->setText($span->generate()); }
public static function link($column, $i, $row) { $value = $row[$column->index ?: 0]; $control = new MLink(); $n = count($row); $action = $column->action ?: $column->href; if (preg_match_all('/#([^#]*)#/', $action, $matches)) { if (is_array($matches[1])) { foreach ($matches[1] as $match) { $action = preg_replace('/#' . $match . '#/', trim($row[$match]), $action); } } } if ($column->options) { $control->setText(($column->grid->showid ? " ({$value})" : '') . $column->options[$value]); } $action = str_replace('#?#', $value, $action); $control->setId(uniqid()); $control->setAction($action); $control->setText($value); $control->setClass('mGridLink'); return $control; }
public function init($id = '', $label = '', $action = '', $text = '', $target = '') { parent::init($id, $label, $action, $text, $target); $this->setAction($action ?: 'submit'); }
function helper_interwikilinks($matches) { $action = $matches[1]; $text = empty($matches[2]) ? $matches[1] : $matches[2]; $target = $matches[3]; if (substr($action, 0, 1) == '#') { $link = '<a class="mLink" href="' . $action . '">' . $text . '</a>'; } else { $mlink = new MLink('', '', $action, $text, $target); $link = $mlink->generate(); } return $link; }
function fill($fileInput, $fileOutput, $fileType, $parameters, $classPath, $save) { if ($this->executionType == 'local') { // execute java program at localhost $params = array(); // build a params array as base to json encoding if (is_array($parameters)) { foreach ($parameters as $pn => $pv) { $params[$pn] = utf8_encode($pv); } } $db = Manager::$conf['db'][$this->dataSource]; $params['dbUser'] = $db['user']; $params['jdbcDriver'] = $db['jdbc']['driver']; $params['jdbcDb'] = $db['jdbc']['db']; $prefix = substr(uniqid(md5(uniqid(""))), 0, 10); $params['pass'] = base64_encode($prefix . $db['password']); $params['relatorio'] = $fileInput; $params['fileOutput'] = $fileOutput; $params['fileType'] = $this->fileType; $javaPath = $this->manager->getOptions("javaPath"); // $logPath = $this->manager->getConf('home.logs'); $fileLog = $this->manager->getLog()->getLogFileName(str_replace("\\", "", "Jasper_" . str_replace('/', '', $this->name)) . "_" . substr(uniqid(md5(uniqid(""))), 0, 6) . '.log'); $json = addslashes(json_encode($params)); $MJasperPath = Manager::getFrameworkPath('classes/extensions/jasper'); $debug = $this->manager->getOptions("debug"); $cmd = $javaPath . "/bin/java -classpath {$classPath} MJasper \"{$json}\"" . ($debug ? " 2> {$fileLog}" : ""); ////mdump($cmd); exec($cmd, $output); //var_dump($output); if (trim($output[0]) == "end") { //no errors! if ($this->fileType == "TXT") { // adjust for CR+LF difference between Windows and Linux Mutil::unix2dos($fileOutput); } if ($save) { // download $this->manager->response->sendDownload($fileOutput); } else { // new window $output = Manager::getAbsoluteURL('var/reports/' . $this->fileOutput); $this->manager->getPage()->window($output); } } else { // errors! $link = new MLink('', 'aqui', Manager::getActionURL('manager', "logs:{$fileLog}"), 'aqui', '_errors'); $detalhes = "<br>Para mais detalhes clique " . $link->generate(); throw new EControlException(implode("<br>", $output) . $detalhes); } } else { if ($this->executionType == 'remote') { //Generate report throught another host, via TomCat $this->fileOutput = $this->manager->getConf("home.url_jasper") . "?bd={$this->db}&relatorio={$filein}" . $parameters; $this->manager->getPage()->window($this->fileOutput); } } }
public function getPageLast() { $pageNumber = $this->getPageNumber(); $pageCount = $this->getPageCount(); if ($pageNumber < $pageCount) { $image = new MLink('', ' '); // $image->setAction('!' . $this->grid->name . '.goPage(' . $pageCount . ');'); $this->goPage[] = array('id' => $image->getId(), 'page' => $pageCount); $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOn'); } else { $image = new MDiv('', ' '); $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOff'); } return $image; }
public function __construct($name = NULL, $text = NULL, $action = NULL, $target = '') { parent::__construct($name, '', $action, $text); $this->setTarget($target ?: 'mWindow'); }