Beispiel #1
0
<?php

// load base functions
require_once '../../../config.php';
// get prioritized sections
$prioritized = get_exts_order();
// and availabe sections too
$exts = ext_available();
$div = "";
foreach ($prioritized as $dirname => $priority) {
    // skip deleted sections (do not remove from DB)
    if (!in_array($dirname, $exts)) {
        continue;
    }
    $div .= '<div id="' . $dirname . '" class="groupItem">';
    $div .= ' <div class="itemHeader">' . filename_to_str($dirname) . '</div>';
    $div .= '</div>';
}
echo $div;
Beispiel #2
0
?>

<h1 id="manage">Manage Roles</h1>

<?php 
check_notified_request("manage");
?>

<table cellspacing="0" class="cms">
  <caption>check those sections that each role can access to</caption>
  <thead>
    <tr>
      <th>role name</th>
      <?php 
foreach ($MODULES as $mod) {
    echo '<th>' . filename_to_str($mod) . '</th>';
}
?>
      <th>action</th>
    </tr>
  </thead>
  <!-- NOW SHOULD BE VALIDATION ERRORS, BECAUSE FORMS CANNOT WRAP THE WHOLE TABLE ROW, but who cares? -->
  <tbody>
    <?php 
foreach ($ROLES as $role) {
    echo table_row($role);
}
?>
  </tbody>
  <tbody>
    <tr><td colspan="<?php 
    <p id="logged"><a href="<?php 
echo ABS_PATH;
?>
">Logged in</a> as <strong><?php 
echo $_SESSION['login'];
?>
</strong> &mdash;
    <a id="logout" class="smallround" href="<?php 
echo ADMIN_PATH;
?>
sys/logout.php">disconnect</a></p>
    
  </div><!-- end header -->
    
  <div id="nav">
    <ul>
      <?php 
$basedir = filename_to_str(ext_name());
$basecss = $basedir == "admin" ? ' class="current"' : null;
// display always the dashboard
echo '<li' . $basecss . '><a href="' . ADMIN_PATH . '">Dashboard</a></li>';
// display allowed sections
echo ext_format();
?>
    </ul>
  </div><!-- end nav -->
  
  <div id="global">
  
  <?php 
// Custom admin content ("extension" from here onwards) should start here
Beispiel #4
0
/** 
 * Gives format to CMS sections. 
 * @return  string  Formatted output list (LI elements)
 */
function ext_format()
{
    if (!isset($_SESSION['allowed'])) {
        return false;
    }
    $current = ext_name();
    // check priority
    $prioritized = get_exts_order();
    // loop through available sections
    $list = "";
    foreach ($prioritized as $dir => $priority) {
        if (!in_array($dir, $_SESSION['allowed'])) {
            continue;
        }
        $css = $current == $dir ? ' class="current"' : null;
        $href = ADMIN_PATH . 'ext/' . $dir . '/';
        $list .= '<li' . $css . '><a href="' . $href . '">' . ucfirst(filename_to_str($dir)) . '</a></li>';
    }
    return $list;
}