function __construct($cfg = array()) { parent::__construct($cfg); if (br($cfg, 'lifeTime')) { $this->setCacheLifeTime($cfg['lifeTime']); } }
function plug_ascii($p, $o = '', $res = '') { $ret .= input1('txtarea', '', 60) . ' '; $ret .= lj('popw', 'ascii_plug___ascii_ascii*jb___txtarea', 'ok') . br(); $ret .= divd('ascii', ascii_j($p, $o, $res)); return $ret; }
function calcular_factura($articulos, $precios, $cantidades, $iva) { // global $sep; $headings = ["articulo", "precio", "cantidad", "subtotal"]; $datos = []; // array de arrays de datos para table() if (strlen($articulos) > 0) { // hay datos todavia?, por si acaso $aa = explode($sep, $articulos); // articulos array $pa = explode($sep, $precios); // precios array $ca = explode($sep, $cantidades); // cantidades array $total = 0; for ($i = 0; $i < count($aa); $i++) { $subtotal = $pa[$i] * $ca[$i]; $total += $subtotal; array_push($datos, [$aa[$i], $pa[$i], $ca[$i], $subtotal]); // añadimos el subtotal } $ti = $total * (1 + $iva); return "Factura:" . table($headings, $datos) . br() . "Total: {$total}" . br() . "Total ({$iva} de IVA incluido): {$ti}" . br() . br(); } else { return "No se debe nada (todavia)."; } }
function plug_sendmail() { $ret .= lkc("", "sendmail.php", "index") . br(); $ip = hostname(); $arr = array("from" => "text", "dest" => "text", "suj" => "text", "msg" => "textarea", "ok" => "submit"); if ($_POST["submit"] == "ok") { foreach ($arr as $k => $v) { ${$k} = $_POST[$k]; $ret .= $k . ': ' . ${$k} . "\n"; } if ($ip == $myip) { $ret .= nl2br($ret); mail($dest, $suj, $msg, 'From: ' . $from . "\n", ""); } else { $ret .= "_specify_your_ip_in_source" . br(); } } $f = "data/sendmail.txt"; //$ret.=lkc("",$f,"txt").br(); $t .= date("ymd.Hi", time()) . "\n" . $ip . "\n" . $ret . "---\n"; $t .= read_file($f); write_file($f, $t . "\n"); //write_file($f,$t,"a+"); $ret .= make_form_b($arr, ""); return $ret; }
function smsreader($r, $p, $o) { $o = '+' . $o; foreach ($r as $k => $v) { $numbr = $v[0] ? $v[0] : $v[1]; $numb = substr($numbr, 1); $day = $v[2] . $v[3] . $v[4] . $v[5] . $v[6] . $v[7]; if ($v[7]) { $time = mktime($v[5], $v[6], $v[7], $v[3], $v[4], $v[2]); } if ($v[0] && $v[0] == $o or $v[1] && $v[1] == $o) { //szFromNumber //$day=$v['uYear'].$v['uMonth'].$v['uDay'].$v['uHour'].$v['uMinute'].$v['uSecond']; if ($time) { $realday = mkday($time, 'ymd.hi'); } $ret .= $day . br() . $v[8] . br() . hr(); $who = ($v[0] ? 'From' : 'To') . ':' . $numbr; $rb[$time] = divc('panel', $who . ', ' . $realday . br() . divc('justy', $v[8])); } else { $rb[$time] .= lkc('', '/plugin/smsreader/' . $p . '/' . $numb, $numb) . ' '; } } ksort($rb); //p($rb); $ret = implode(hr(), $rb); //echo $ret; return $ret; }
function plug_microform($p, $id) { $rid = 'mfr' . randid(); //echo $p.'-'.$id; $nod = ses('mform', ses('qb') . '_microform_' . $id); req('pop'); ses('mformj', $rid . '_plug___microform_plug*microform_' . ajx($p) . '_' . $id); reqp('msql'); $msq = new msql('', $nod); //table list($p, $tp) = explode('§', $p); $rb = mform_mr($p); //p($rb); $msq->create($rb); $ret .= make_form($p, 'mfr' . $id, '_plug___microform_mform*j_' . ajx($p, '') . '_' . $id . '_') . br(); if (auth(4)) { $ret .= msqlink('users', ses('mform')) . ' ' . btn('txtsmall2', $nod) . ' '; } if ($tp == 1) { $ret .= mform_read($id); } elseif ($tp) { $ret .= plugin('msqtemplate', $nod, $tp); } return divd($rid, $ret . $bt); }
function save_funcs($f, $page) { //echo $f.'-'.$p.br();; $day = $_SESSION['philum']; //$day=mkday(time()); if (is_file($f)) { //echo $f.br(); if (substr($f, 0, 1) != '_') { $v = read_file($f); } list($rea, $reb) = splitfuncs($v); if (is_array($reb)) { //pr($reb); foreach ($reb as $func) { if ($func) { list($id, $maj) = sql_b('select id,maj from _sys where name="' . $func . '"', 'r'); $res = find_end($rea, 'function ' . $func . '(', '{', '}'); //$res=substr($res,strpos($res,'{')+1,strrpos($res,'}'-1)); //eco($res,1); $resav = addslashes($res); if (!$id && $maj != $day) { msquery('INSERT INTO _sys VALUES ("","' . $func . '","' . $page . '","' . $day . '","' . $resav . '")'); } elseif ($maj != $day) { msquery('UPDATE _sys SET maj="' . $day . '", func="' . $resav . '" WHERE id=' . $id); } $ret .= '//' . $func . "\n"; $ret .= $res . "\n\n"; } } if (!$id or $maj != $day) { echo "{$page} {$k} : saved \n" . br(); } } } return $ret; }
/** * Save the file to the specified path * @return boolean TRUE on success */ function save($srcFilePath, $path) { $dstFileName = br()->fs()->normalizeFileName(br()->fs()->fileName($this->getFileName())); $dstFilePath = '/' . rtrim(ltrim($path, '/'), '/') . '/' . md5_file($srcFilePath) . '/' . $dstFileName; $url = br()->AWS()->uploadFile($srcFilePath, $this->options['bucketName'] . $dstFilePath); return array('fileName' => $dstFileName, 'url' => $dstFilePath, 'href' => $url); }
function edit_allocations_for_transaction($type, $trans_no) { global $systypes_array; $cart = $_SESSION['alloc']; display_heading(sprintf(_("Allocation of %s # %d"), $systypes_array[$cart->type], $cart->trans_no)); display_heading($cart->person_name); display_heading2(_("Date:") . " <b>" . $cart->date_ . "</b>"); display_heading2(_("Total:") . " <b>" . price_format($cart->bank_amount) . ' ' . $cart->currency . "</b>"); if ($cart->currency != $cart->person_curr) { $total = _("Total in clearing currency:") . " <b>" . price_format($cart->amount) . "</b>" . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount / $cart->amount), $cart->currency, $cart->person_curr); display_heading2($total); } echo "<br>"; start_form(); div_start('alloc_tbl'); if (count($cart->allocs) > 0) { show_allocatable(true); //ML Start start_table(); //text_row_ex(_("Number: "), 'num', 10); end_table(); br(); //ML End submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true); submit('Process', _("Process"), true, _('Process allocations'), 'default'); submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel'); } else { display_note(_("There are no unsettled transactions to allocate."), 0, 1); submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel'); } div_end(); end_form(); }
function table2array_menu($p, $o, $rid) { //$ret.=input(1,'inp',$p,'').' '; $ret .= lj('', $rid . '_plug__2_table2array_table2array*j___inp', picto('reload')) . br(); $ret .= txarea('inp', $p, 64, 24); return $ret; }
function kb_build($id, $o) { if ($o) { $r = array('²1234567890°+', 'AZERTYUIOP¨£', 'QSDFGHJKLM%µ', 'WXCVBN?./§', '~#{[|`\\^@]}€<>'); } else { $r = array('&é"\'(-è_çà)=', 'azertyuiop^$', 'qsdfghjklmù*', 'wxcvbn,;:!'); } $cap = lj($o ? 'active' : '', 'kbd_plug___keyboard_kb*build_' . $id . '_' . yesno($o), picto('up')); foreach ($r as $v) { $ra = strsplit($v); $i++; foreach ($ra as $va) { $ret .= lja('popbt', 'insert_b(\'' . $va . '\',\'' . $id . '\')', $va) . ' '; } if ($i == 1) { $ret .= ljb('popw', 'conn', $id . '_del', picto('no')); } if ($i == 2) { $ret .= ljb('popw', 'insert_b', '\\n\',\'' . $id, picto('back')); } if ($i == 3) { $ret .= $cap; } if ($i == 4) { $ret .= lja('popbt', 'insert_b(\' \',\'' . $id . '\')', '--'); } $ret .= br(); } return $ret; }
public static function getInstance() { if (!self::$instanceInitialized) { self::$instanceInitialized = true; if ($config = br()->config()->get('db')) { try { switch ($config['engine']) { case 'mysql': require_once __DIR__ . '/BrMySQLDBProvider.php'; self::$instance = new BrMySQLDBProvider($config); break; case 'mysqli': require_once __DIR__ . '/BrMySQLiDBProvider.php'; self::$instance = new BrMySQLiDBProvider($config); break; case 'mongodb': require_once __DIR__ . '/BrMongoDBProvider.php'; self::$instance = new BrMongoDBProvider($config); break; } self::$instance->connect(); } catch (Exception $e) { if ($errorPage = br($config, 'errorPage')) { if (br()->request()->isAt($errorPage)) { } else { br()->response()->redirect($errorPage); } } else { throw new BrDBConnectionError($e->getMessage()); } } } } return self::$instance; }
/** * Draw the Footer * */ function getFooter() { global $cds; br(); br(); include $cds->path . 'inc/foot1.php'; echo '</div>'; echo '<div id="footer"><div class="left">' . $cds->content->getByAccessKey("footermessage"); echo '</div>'; echo '<br class="doNotDisplay doNotPrint" />'; echo '<div class="right">'; // footerlinks $links = $cds->menu->getMenuByPath('/FooterLinks'); if (is_object($links)) { $links = $links->lowerLevel(); if (is_array($links)) { for ($i = 0; $i < count($links); $i++) { echo $links[$i]->getTag() . ' '; if ($i < count($links) - 1) { echo '| '; } } } } echo '</div></div>'; }
function write($message, $group = 'MSG') { $this->init(); if ($this->filePointer && $this->isEnabled() && br()->log()->isEnabled()) { if (!is_resource($message)) { $logMessage = ''; if (strlen($message)) { if ($group) { $logMessage .= $group . ' '; } $logMessage .= br()->getProcessId() . ' '; if ($initTime = br()->log()->getInitTime()) { $logMessage .= $initTime; if ($time = br()->log()->getFormattedTimeOffset()) { $logMessage .= '+' . $time; } $logMessage .= ' '; } if ($logLevel = br()->log()->getLevel()) { $logMessage .= str_repeat(' ', $logLevel * 2); } $logMessage .= $message; } $logMessage .= "\n"; @fwrite($this->filePointer, $logMessage); } } }
public static function getInstance($name = 'default') { $instance = null; if (self::$reconsider || !isset(self::$instances[$name])) { if ($dbList = br()->config()->get('cache')) { self::$reconsider = false; $cacheConfig = br($dbList, $name, $dbList); br()->assert($cacheConfig, 'Cache [' . $name . '] not configured'); try { $instance = BrCache::createInstance($cacheConfig['engine'], $cacheConfig); } catch (Exception $e) { $instance = BrCache::createInstance('default', $cacheConfig); } } else { if (isset(self::$instances[$name])) { $instance = self::$instances[$name]; } else { $instance = BrCache::createInstance($name); } } self::$instances[$name] = $instance; } else { $instance = self::$instances[$name]; } return $instance; }
function doit($check) { if (!br()->isConsoleMode()) { br()->panic('Console mode only'); } $arguments = br()->getCommandLineArguments(); if ($className = @$arguments[0]) { $classFile = $this->jobsFolder . $className . '.php'; if (file_exists($classFile)) { if ($className) { array_splice($arguments, 0, 1); $tag = $classFile . '-' . br($arguments)->join('-'); if ($check) { $tag = 'check-' . $tag; } else { $tag = 'run-' . $tag; } br()->log('Trying to acquire lock for this script to avoid conflict with running instance'); $handle = br()->OS()->lockIfRunning($tag); require_once $classFile; $job = new $className(); if ($check) { $job->check(); } else { $job->run($arguments); } @fclose($handle); @unlink(br()->OS()->lockFileName($tag)); return true; } } else { br()->log('[ERROR] Job file ' . $classFile . ' not found'); } } }
/** * Get the HTML Output for a box in the cockpit. */ function drawABox($headline, $content) { echo getFormHeadline($headline); echo $content; echo getFormFooterLine(); br(); br(); }
public static function getInstance($name = 'default') { $instance = null; if (self::$reconsider || !isset(self::$instances[$name])) { if ($authList = br()->config()->get('auth')) { self::$reconsider = false; $authConfig = br($authList, $name, $authList); br()->assert($authConfig, 'Auth [' . $name . '] not configured'); switch ($authConfig['type']) { case "DBUsers": require_once __DIR__ . '/BrDBUsersAuthProvider.php'; $instance = new BrDBUsersAuthProvider($authConfig); break; default: throw new BrException('Unknown auth provider requested: ' . $name); break; } } else { if (isset(self::$instances[$name])) { $instance = self::$instances[$name]; } else { $authConfig = array(); require_once __DIR__ . '/BrDBUsersAuthProvider.php'; $instance = new BrDBUsersAuthProvider($authConfig); } } self::$instances[$name] = $instance; } else { $instance = self::$instances[$name]; } return $instance; }
function index() { if (!is_logged()) { redirect(base_url()); } $this->data['title'] = lang('off_vote'); $text = icon('64x64/chart_up.png') . '<p>'; if (config('alt_vote', 'rf_settings')) { $text .= '<br><h2>' . anchor('evote', 'Emudev Top') . '</h2>'; $text .= '<h2>' . anchor('mmotop', 'MMOTOP') . '</h2>'; } else { if ($this->_get_last_vote() != 0) { $text .= lang('off_youvote') . timespan($this->_get_last_vote(true), time()) . ',' . br(1); $text .= '<p>' . icon('32x32/clock.png') . lang('off_vote_wait') . timespan(time() + $this->_get_last_vote(), time() + $this->limit) . '</p>'; } elseif ($this->_last_ip() != 0) { $text .= icon("32x32/globe_warning.png") . lang('off_ip_vote'); $text .= '<p>' . icon('32x32/clock.png') . lang('off_vote_wait') . timespan(time() + $this->_last_ip(), time() + $this->limit) . '</p>'; } else { $text .= lang('off_vote_title') . '</p>' . $this->_show_vote_link() . anchor('vote/getbonus/' . gen_secure(), lang('off_vote_get')) . icon('32x32/note_accept.png'); // .gen_secure() } } $this->data['content'] = $text . br(2) . icon('32x32/sms.png') . anchor('vote/sms', lang('off_vote_sms')); compile(); }
function operations_build($p, $o) { reqp('mysql'); //$ret=$p.'-'.$o; //$r=plugin('mysql',$p,$o); p($r); $msq = new mysql('qda'); //echo $msq->b; $msq->read('id,day', 'kv', 'frm="oaxiiboo 6" order by day ASC'); $r = $msq->ret; setlocale(LC_ALL, "fr_FR"); $dr = array('jan' => 'jan', 'fev' => 'feb', 'mars' => 'mar', 'avr.' => 'apr', 'mai' => 'may', 'juin' => 'jun', 'juil' => 'jul', 'août' => 'aug', 'sept' => 'sep', 'oct' => 'oct', 'nov' => 'nov', 'déc' => 'dec'); foreach ($r as $k => $v) { $nb++; //14.12.28 00.50 (122) //$suj=date('y.m.d H.i',$v).' ('.$nb.')'; //20:41 - 19 juin 2015 $suj = date("H:i - d M Y", $v); //$suj=strftime("%R - %e %b %G",$v); //$suj=date('H:i - d m Y',$v).' ('.$nb.')'; $suj = strtolower($suj); $suj = str_replace(array_values($dr), array_keys($dr), $suj); $suj .= ' (' . $nb . ')'; echo $suj . br(); //$msq->update('suj',$suj,'id',$k); } //p($r); return $ret; }
function write($message) { $logMessage = str_repeat(' ', br()->log()->getLevel() * 2); $logMessage .= $message; $logMessage .= "\n"; echo $logMessage; }
function radio_edit($nod, $dr, $md, $id = '') { $id = $id ? $id : $_SESSION['read']; $nd = 'radio' . $id; if (!$nod) { $nod = $_SESSION['qb'] . '_' . $nd; } $nodb = str_replace('_', '*', $nod); if ($dr) { $ret .= radio_build($dr, $nod); } $r = msql_read('radio', $nod, ''); $ret .= msqlink('radio', $_SESSION['qb'] . '_' . $nd); if ($r[$md]) { foreach ($r[$md] as $k => $v) { $ky .= $md . '.' . $k . '|'; $edit .= input2('text', '"id="' . $md . '.' . $k, $v) . btn('txtsmall', $r['_menus_'][$k]) . br(); } $edit .= ljb('popbt', 'SaveR', 'popup_radiosav_' . $nodb . '__' . $k . '\',\'' . $ky, 'save'); } $ret .= divc('edit', $edit); if ($r) { foreach ($r as $k => $v) { foreach ($v as $ka => $va) { $datas[$k][] = $va; } if ($k != '_menus_' && $k != $md) { $datas[$k][] = ljb('popbt', 'SaveJ', 'popup_radioedit___' . $nodb . '__' . $k, 'edit'); } } } $ret .= make_divtable($datas); return popup('build_playlist', $ret); }
function output_pages_from_cache($http, $otp) { $npg = $_SESSION['prmb'][6]; $page = $_SESSION['page']; $min = ($page - 1) * $npg; $max = $page * $npg; if (is_array($otp)) { foreach ($otp as $id => $nb) { if (is_numeric($id)) { $i++; if ($i >= $min && $i < $max) { $mg = $http . '/imgc/' . first_img($nb[3]); if (is_link($mg)) { $ret .= btn('imgl', image($mg, '', 50)); } $ret .= bal('h2', lka($http . '/' . $id, $nb[2])); $ret .= btn('txtx', $nb[1]) . ' '; if (rstr(27)) { $ret .= btn('txtsmall', mkday($nb[0], 1)) . ' ' . pub_link($nb[9]) . ' '; } if (rstr(25)) { $ret .= btn('txtsmall', art_length($nb[8])); } $ret .= br() . br(); } } } } $n_pages = nb_page($i, $npg, $page); return $n_pages . $ret . $n_pages; }
/** * Validate a user's login */ public function authenticate() { $loginEmail = $this->input->post('loginEmail'); $loginPassword = $this->input->post('loginPassword'); $this->db->where('email', $loginEmail); $query = $this->db->get('users'); $row = $query->row(); if ($query->num_rows() == 1) { /** * Validate Password taken from Crackstation.net * @param $password, $correct_hash */ if ($this->password->validate_password($loginPassword, $row->password)) { $session_array = array('userID' => $row->userID, 'fname' => $row->fname, 'lname' => $row->lname, 'email' => $row->email, 'usertype' => $row->usertype); if ($row->activated == 1) { $this->session->set_userdata('logged_in', $session_array); $this->session->set_flashdata('login-success', 'Welcome to AusCert, ' . $row->fname . '!'); redirect('home', 'refresh'); } else { if ($row->activated == 0) { $this->session->set_flashdata('email-not-verified', 'Your email: ' . $loginEmail . ' is not activated.' . br(1) . 'You are required to activate your email before logging in.'); redirect('login', 'refresh'); } } } else { $this->session->set_flashdata('login-error', 'Invalid Email and/or Password.'); redirect('login', 'refresh'); } } else { $this->session->set_flashdata('login-error', 'Invalid Email and/or Password.'); redirect('login', 'refresh'); } }
function baz_u($d) { list($ob, $op) = split_right(':', $d); list($od, $oq) = split_one('/', $op); //echo $ob.'-'.$od.'-'.$oq.br(); if ($oq) { switch ($od) { case 'bal': return bal($oq, $ob); break; case 'plug': return plugin($oq, $ob); break; } } else { switch ($op) { case 'br': return br(); break; case 'b': return bal($op, $ob); break; case 'u': return bal($op, $ob); break; } } return '(' . $d . ')'; }
function render($id, $title) { global $path_to_root; include_once $path_to_root . "/includes/ui.inc"; $today = date2sql(Today()); $sql = "SELECT bank_act, bank_account_name, SUM(amount) balance FROM " . TB_PREF . "bank_trans bt" . " INNER JOIN " . TB_PREF . "bank_accounts ba ON bt.bank_act = ba.id" . " WHERE trans_date < '{$today}'" . " AND inactive <> 1"; if ($this->data_filter != '') { $sql .= ' AND ' . $this->data_filter; } $sql .= " GROUP BY bank_act, bank_account_name" . " ORDER BY bank_account_name"; $result = db_query($sql); br(); $th = array(_("Account"), _("Balance")); start_table(TABLESTYLE, "width=98%"); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell($myrow["bank_account_name"]); amount_cell($myrow['balance']); end_row(); } end_table(1); }
function run() { if (!br()->isConsoleMode()) { br()->panic('Console mode only'); } br()->log('[...] Trying to acquire lock for this script to avoid conflict with running instance'); $handle = br()->OS()->lockIfRunning(br()->callerScript()); br()->log('[...] Jobs folder: ' . $this->jobsFolder); br()->log('[...] Starting JobsManager'); while (true) { $jobs = array(); br()->fs()->iterateDir($this->jobsFolder, '^Job.*[.]php$', function ($jobFile) use(&$jobs) { $jobs[] = array('classFile' => $jobFile->nameWithPath(), 'className' => br()->fs()->fileNameOnly($jobFile->name())); }); foreach ($jobs as $jobDesc) { br()->log('[PRC] Starting process checker for ' . $jobDesc['className']); $classFile = $jobDesc['classFile']; $className = $jobDesc['className']; require_once $classFile; $job = new $className(); $job->spawn(true); } br()->log('[...] Idle'); sleep(30); } }
function wol() { if (!extension_loaded('sockets')) { show_error('La extension "sockets" no esta cargada, debe cargarla para poder usar estas opciones'); } $this->load->library('rapyd'); $this->rapyd->load('dataform'); $form = new DataForm('supervisor/monitoreo/wol/process'); $form->mac = new inputField('Dirección MAC', 'mac'); $form->mac->append('Ejemplo: 00:01:02:03:04:05'); $form->mac->rule = 'required|mac'; $form->mac->maxlength = 17; $form->mac->size = 20; $form->submit('btnsubmit', 'Enviar'); $form->build_form(); if ($form->on_success()) { $mac = $form->mac->newValue; $rt = $this->_wol($mac); if (!$rt) { $form->error_string = $this->error; $form->build_form(); $salida = $form->output . br(); } else { $salida = $form->output . br() . 'Señal enviada satisfactoriamente'; } } else { $salida = $form->output; } $this->rapyd->jquery[] = '$(".inputnum").numeric(".");'; $data['content'] = $salida; $data['title'] = heading('Envio de señal de encendido por LAN'); $data['head'] = $this->rapyd->get_head(); $this->load->view('view_ventanas', $data); }
/** * Draw the Footer * */ function getFooter() { global $cds; br(); br(); include $cds->path . 'inc/foot1.php'; echo "</td>"; echo '<td width="20"> </td>'; echo '<td valign="top" width=200"><br><br><br><br>'; include $cdsp->path . 'inc/side1.php'; br(); echo "</td></tr></table>"; br(); br(); echo '<div id="footerline">'; echo '<table width="100%" border="0" cellpadding="0" cellspacing="0">'; echo '<tr><td width="30%">'; // footerlinks $links = $cds->menu->getMenuByPath('/FooterLinks'); if (is_object($links)) { $links = $links->lowerLevel(); if (is_array($links)) { for ($i = 0; $i < count($links); $i++) { echo $links[$i]->getTag() . ' '; if ($i < count($links) - 1) { echo '- '; } } } } echo '</td><td width="40%" align="center">' . $cds->content->getByAccessKey("footermessage"); echo '</td><td width="30%" align="right">Powered by <a href="http://www.nxsystems.org" target="_blank">N/X CMS</a></td></tr></table>'; echo '</div></div>'; }
function send($requestedAssests = null) { $files = array(); $files[] = __DIR__ . '/3rdparty/jquery/jquery-1.7.1.min.js'; if (strpos(br()->request()->get('extra'), 'jquery-ui') !== false) { $files[] = __DIR__ . '/3rdparty/jquery.ui/jquery-ui.js'; } $files[] = __DIR__ . '/3rdparty/bootstrap/js/bootstrap.min.js'; $files[] = __DIR__ . '/3rdparty/humane-js/humane.min.js'; $files[] = __DIR__ . '/3rdparty/mustache/mustache.min.js'; if (strpos(br()->request()->get('extra'), 'gritter') !== false) { $files[] = __DIR__ . '/3rdparty/gritter/js/jquery.gritter.min.js'; } $files[] = __DIR__ . '/js/bright.min.js'; $lastModified = 0; foreach ($files as $file) { if (($n = filemtime($file)) > $lastModified) { $lastModified = $n; } } if ($d = br()->request()->ifModifidSince()) { if ($d >= $lastModified) { br()->response()->sendNotModified(); } } header('Content-type: application/x-javascript'); header('Last-Modified: ' . date('r', $lastModified)); //header('Cache-Control:max-age=5, proxy-revalidate, must-revalidate'); foreach ($files as $file) { readfile($file); } exit; }