<? // Include main class loading config file`i $root_path = dirname(__FILE__); include $root_path . '/includes.php'; include $root_path . '/config.php'; include $root_path . '/constructor_functions.php'; include $root_path . '/functions.php'; //Set the Template root, and set the header and footer $tmpl = new fTemplating($root_path . '/views/'); $tmpl->enableMinification('development', dirname(__FILE__) . '/../js_cache/',dirname(__FILE__) . '/..'); $tmpl->add('css','/bootstrap/bootstrap.min.css'); $tmpl->add('css','/assets/css/jquery-ui.css'); $tmpl->add('js','/assets/js/jquery.min.js'); $tmpl->add('js','/assets/js/jquery-ui.min.js'); $tmpl->add('js','/assets/js/jquery.collapsible.js'); $tmpl->add('js','/assets/js/jquery.graphite.js'); $tmpl->add('js','/bootstrap/js/bootstrap-modal.js'); $tmpl->add('js','/bootstrap/js/bootstrap-twipsy.js'); $tmpl->add('js','/bootstrap/js/bootstrap-popover.js'); $tmpl->set('header', 'header.php'); $tmpl->set('footer', 'footer.php'); //Set DB connection (using flourish it isn't actually connected to until the first use) $mysql_db = new fDatabase('mysql', $database_name, $database_user, $database_password);
if ($web_root != '/') { $web_root .= '/'; } define('TATTLE_WEB_ROOT', $web_root); define('VIEW_PATH', TATTLE_ROOT . '/inc/views/'); define('JS_CACHE', TATTLE_ROOT . '/js_cache/'); include TATTLE_ROOT . '/inc/includes.php'; include TATTLE_ROOT . '/inc/functions.php'; include TATTLE_ROOT . '/statistical_functions.php'; include TATTLE_ROOT . '/inc/config.php'; include TATTLE_ROOT . '/inc/constructor_functions.php'; //Set the Template root, and set the header and footer $tmpl = new fTemplating(VIEW_PATH); //if (!is_dir(JS_CACHE) || !is_writable(JS_CACHE)){ // $warning_message .= "JS Caching disabled due to js folder permissions"; //} else { // $tmpl->enableMinification('development', JS_CACHE, TATTLE_ROOT); //} $tmpl->add('css', 'bootstrap/css/bootstrap.css'); $tmpl->add('css', 'assets/css/jquery-ui.css'); $tmpl->add('css', 'assets/css/tattle.css'); $tmpl->add('js', 'assets/js/jquery-2.0.1.min.js'); $tmpl->add('js', 'assets/js/jquery-ui.js'); $tmpl->add('js', 'assets/js/jquery.collapsible.js'); $tmpl->add('js', 'assets/js/jquery.graphite.js'); $tmpl->add('js', 'assets/js/tattle.js'); $tmpl->add('js', 'bootstrap/js/bootstrap.js'); $tmpl->set('header', 'header.php'); $tmpl->set('footer', 'footer.php'); //Start the Flourish Session fSession::open();
if ($lang != NULL) { fCookie::set('safecast_lang', $lang, '+1 year', '/', '.safecast.org'); } if ($lang == NULL) { $lang = fCookie::get('safecast_lang', 'en'); } // get language file $lang_file = DOC_ROOT . '/lang/' . $lang . '.json'; if (!file_exists($lang_file)) { $lang_file = DOC_ROOT . '/lang/en.json'; } $file = new fFile($lang_file); $lang_file_content = $file->read(); //print_r("file content: ".$lang_file_content); $translations = json_decode($lang_file_content); //print_r('file: '.$lang_file); //print_r('************'.$translations.'^^^^^^^^^^^^^^^'); //die; $tmpl = new fTemplating(DOC_ROOT . '/views/'); $tmpl->set('header', 'header.php'); $tmpl->set('header_headless', 'header_headless.php'); $tmpl->set('info_header', 'info_header.php'); $tmpl->set('footer', 'footer.php'); $tmpl->set('lang', $lang); require_once DOC_ROOT . '/Browser.php'; $mobile = mobile_device_detect(true, false, true, true, true, true, true, false, false); if ($mobile) { $tmpl->add('css', 'style/mobile.css'); } else { $tmpl->add('css', 'style/base.css'); }
<?php include dirname(__FILE__) . '/config.php'; /** * Template Initialization */ $tmpl = new fTemplating(DOC_ROOT . '/resources/templates/'); $tmpl->set('title', $config["title"]); $tmpl->set('version', $config['version']); $tmpl->set('header', 'header.php'); $tmpl->set('menu', 'menu.php'); $tmpl->set('menuInventory', 'inventory-menu.php'); $tmpl->set('menuAdmin', 'admin-menu.php'); $tmpl->set('menuDocument', 'document-menu.php'); $tmpl->set('menuReport', 'report-menu.php'); $tmpl->set('footer', 'footer.php'); $tmpl->add('js', './resources/library/jquery/js/jquery-1.3.2.min.js'); $tmpl->add('js', './resources/library/jquery/js/jquery-ui-1.7.2.custom.min.js'); $tmpl->add('js', './resources/templates/main.js'); $tmpl->add('js', './resources/library/datejs/date.js'); $tmpl->add('css', array('path' => './resources/library/blueprint/screen.css', 'media' => 'screen, projection')); $tmpl->add('css', array('path' => './resources/library/blueprint/print.css', 'media' => 'print')); $tmpl->add('css', './resources/library/jquery/css/cupertino/jquery-ui-1.7.2.custom.css'); $tmpl->add('css', './css/style.css'); // Connecting to a MySQL database on the server $db = new fDatabase('mysql', $config['db']['dbName'], $config['db']['dbUsername'], $config['db']['password'], $config['db']['dbHost']); fORMDatabase::attach($db); fSession::open();
public function testJsMinificationMultiple() { $tmpl = new fTemplating(); $tmpl->enableMinification('development', './output/minification_cache/', $_SERVER['DOCUMENT_ROOT']); $tmpl->add('js', '/resources/js/foo.js'); $tmpl->add('js', '/resources/js/bar.js'); ob_start(); $tmpl->place('js'); $output = ob_get_clean(); preg_match('#/(\\w+\\.js)#', $output, $match); $this->assertEquals(file_get_contents('./resources/js/foo-min.js') . "\n" . file_get_contents('./resources/js/bar-min.js'), file_get_contents('./output/minification_cache/' . $match[1])); }