예제 #1
0
/**
 * Returns the layout header information
 *
 * @since 6.0.00
 * @param
 *            string (optional) $layout_dir loads layouts from specified folder
 * @return mixed
 */
function get_layouts_header($layout_dir = '')
{
    $layouts_header = [];
    if ($handle = opendir($layout_dir)) {
        while ($file = readdir($handle)) {
            if (is_file($layout_dir . $file)) {
                if (strpos($layout_dir . $file, '.layout.php')) {
                    $fp = fopen($layout_dir . $file, 'r');
                    // Pull only the first 8kiB of the file in.
                    $layout_data = fread($fp, 8192);
                    fclose($fp);
                    preg_match('|Layout Name:(.*)$|mi', $layout_data, $name);
                    preg_match('|Layout Slug:(.*)$|mi', $layout_data, $layout_slug);
                    foreach (array('name', 'layout_slug') as $field) {
                        if (!empty(${$field})) {
                            ${$field} = trim(${$field}[1]);
                        } else {
                            ${$field} = '';
                        }
                    }
                    $layout_data = array('filename' => $file, 'Name' => $name, 'Title' => $name, 'Slug' => $layout_slug);
                    $layouts_header[] = $layout_data;
                }
            } else {
                if (is_dir($layout_dir . $file) && $file != '.' && $file != '..') {
                    get_layouts_header($layout_dir . $file . '/');
                }
            }
        }
        closedir($handle);
    }
    return $layouts_header;
}
예제 #2
0
}
/**
 * System Settings View
 * 
 * This view is used to render the general settings screen.
 *  
 * @license GPLv3
 * 
 * @since       3.0.0
 * @package     eduTrac SIS
 * @author      Joshua Parker <*****@*****.**>
 */
$app = \Liten\Liten::getInstance();
$app->view->extend('_layouts/dashboard');
$app->view->block('dashboard');
$layouts_header = get_layouts_header(APP_PATH . 'views/_layouts/myet/');
$screen = 'setting';
?>

<ul class="breadcrumb">
	<li><?php 
echo _t('You are here');
?>
</li>
	<li><a href="<?php 
echo get_base_url();
?>
dashboard/<?php 
echo bm();
?>
" class="glyphicons dashboard"><i></i> <?php