function load_shortcodes() { foreach (glob(__DIR__ . '/library/*') as $dir) { require_once $dir . '/index.php'; load_templates($dir); add_shortcode(basename($dir), 'CodexCodes\\' . basename($dir) . '\\' . basename($dir) . '_shortcode_handler'); } }
/** * Parse the templates directory and populate the global $Templates array with the files * Works recursively, to reference a deep template use a +key_path+ like you do with the * dictionary. * snippets.snippet5 => templates/snippets/snippet5 */ function load_templates($path = TEMPLATES_ROOT) { $templates = array(); $dh = opendir($path); while (($file = readdir($dh)) !== false) { if (preg_match('/^\\.+/', $file)) { continue; } $_file_path = realpath($path . '/' . $file); $templates[$file] = is_dir($_file_path) ? load_templates($_file_path) : $_file_path; } closedir($dh); return $templates; }
<?php // Basic paths for the rest of the program to use define('ROOT', realpath(dirname(__FILE__) . '/../')); define('DICTIONARY', ROOT . '/config/dictionary.yml'); define('TEMPLATES_ROOT', ROOT . '/templates'); // Common includes require_once ROOT . '/lib/spyc.php'; require_once ROOT . '/lib/functions.php'; // Globals -- mind the Caps $Dictionary = spyc_load_file(DICTIONARY); $Templates = load_templates(); $RenderFlags = array();
<?php require_once 'includes/site.inc.php'; load_templates(array('helptext')); $smarty->display('help.tpl');
$smarty->assign("website_link", $Settings->getSetting('websiteLink')); $networkoptions = unserialize($Settings->getSetting("networkoptions")); $lanIP = $networkoptions['lanipaddress']; $smarty->assign("serverip", $lanIP); custom_settings(array('hidefooter', 'hideheader', 'hidemenu', 'disableallcss', 'hidehelplink', 'hidenormallogin')); $logintitle = $Settings->getSetting('logintitle'); if ($logintitle == '') { $logintitle = $Settings->getSetting('locationName') . " Hotspot"; } $smarty->assign("logintitle", $logintitle); $freeloginbuttontext = $Settings->getSetting('freeloginbuttontext'); if ($freeloginbuttontext == '') { $freeloginbuttontext = T_('Free Access'); } $smarty->assign("freeloginbuttontext", $freeloginbuttontext); // Load templates needed by all pages load_templates(array('maincss')); function load_templates($templates) { global $Settings, $smarty; foreach ($templates as $template) { $smarty->assign('tpl_' . $template, $Settings->getTemplate($template)); } } function custom_settings($settings = array()) { global $smarty, $Settings; foreach ($settings as $setting) { $smarty->assign($setting, $Settings->getSetting($setting) == 'TRUE' ? true : false); } }
echo $tpl->render(array('lang_admin_groups' => $lang_admin_groups, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['del_group'], array($group_id)), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/groups.php'), 'group_id' => $group_id, 'group_title' => $group_title)); require PANTHER_ROOT . 'footer.php'; } } list($group_title, $group_members) = $ps->fetch(PDO::FETCH_NUM); $page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['User groups']); define('PANTHER_ACTIVE_PAGE', 'admin'); require PANTHER_ROOT . 'header.php'; generate_admin_menu('groups'); $group_options = array(); foreach ($panther_groups as $cur_group) { if ($cur_group['g_id'] != PANTHER_GUEST && $cur_group['g_id'] != $group_id) { $group_options[] = array('id' => $cur_group['g_id'], 'selected' => $cur_group['g_id'] == PANTHER_MEMBER ? true : false, 'title' => $cur_group['g_title']); } } $tpl = load_templates('move_group.tpl'); echo $tpl->render(array('lang_admin_groups' => $lang_admin_groups, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['del_group'], array($group_id)), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/groups.php'), 'group_id' => $group_id, 'group_title' => $group_title, 'group_members' => forum_number_format($group_members), 'group_options' => $group_options)); require PANTHER_ROOT . 'footer.php'; } } } } $page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['User groups']); define('PANTHER_ACTIVE_PAGE', 'admin'); require PANTHER_ROOT . 'header.php'; generate_admin_menu('groups'); $group_options = $new_options = $default_options = array(); foreach ($panther_groups as $cur_group) { if ($cur_group['g_id'] != PANTHER_ADMIN && $cur_group['g_id'] != PANTHER_GUEST) { $new_options[] = array('id' => $cur_group['g_id'], 'title' => $cur_group['g_title']); }
$reply = array($_GET['reply']); } $smarty->assign("error", $reply); //break; // Fall through? //break; // Fall through? case 'notyet': case 'logoff': // Display login setup_login_form(); break; case 'success': //Logged in. Try popup and redirect to userurl // If this is an automac login (check UID vs MAC) then we skip the // normal success and go back to portal which should work better as // it's not a nojs login if ($_GET['uid'] == mactoautousername($_GET['mac'])) { break; } // load_templates(array('loggedinnojshtml')); $smarty->display('loggedin.tpl'); exit; break; } function setup_login_form() { global $smarty; $smarty->display('portal.tpl'); exit; } $smarty->display('portal.tpl');
<meta charset="UTF-8"> <title>EasyLogin v1.3</title> <!-- Demo CSS --> <link rel="stylesheet" href="easylogin/assets/css/demo.css"> <!-- jQuery --> <script src="easylogin/assets/js/jquery-1.11.0.min.js"></script> </head> <body> <div id="container"> <h1 class="demo-title">EasyLogin <small>v</small><span>1.3</span></h1> <?php // Path to load.php require_once 'easylogin/includes/load.php'; $EL = EasyLogin::getInstance(); // Load templates for modals load_templates(); ?> <div style="text-align:center;"> <?php if (is_user_logged_in()) { ?> Howdy, <?php echo current_user('username'); ?> | <a href="#" data-toggle="modal" data-target="#EL_account">My Account</a> | <?php if (current_user('role') == 'admin') { ?>