Example #1
0
/**
 * return an array of all subdirs in a dir
 *
 * @param $dir directory usually "modules/"
 * @return an array of String with a list of dirs
 */
function fetchModulesList($dir)
{
    $ret = array();
    $registerList = array();
    if (isset($_SESSION["supportModList"])) {
        foreach ($_SESSION["supportModList"] as $module) {
            if (file_exists($dir . $module . '/infoPackage.inc.php') && hasCorrectModuleAcl($module)) {
                $ret[] = $dir . $module;
                $registerList[] = $module;
            }
        }
    }
    /* register modulesList in $_SESSION */
    $_SESSION["modulesList"] = $registerList;
    return $ret;
}
Example #2
0
 /**
  * Add the submodule icon and the URL link to the top navigation bar
  */
 function generateNavBar()
 {
     if ($this->_visibility == False || !hasCorrectModuleAcl($this->_parentname)) {
         return;
     }
     list($module, $submod, $action) = split('/', $this->_defaultpage, 3);
     /*
        If the user has no right to access the default page, try to find
        another page.
     */
     if (!hasCorrectAcl($module, $submod, $action)) {
         $found = False;
         foreach ($this->getPages() as $page) {
             if ($page->isVisible() && hasCorrectAcl($module, $submod, $page->getAction())) {
                 $found = True;
                 $action = $page->getAction();
                 break;
             }
         }
         /* No page found, so don't display the submodule icon */
         if (!$found) {
             return;
         }
     }
     global $root;
     print "<li id=\"navbar" . $this->getName() . "\"><a href=\"" . $root . "main.php?module={$module}&amp;submod={$submod}&amp;action={$action}\">\n";
     print $this->_desc . "</a></li>\n";
 }
Example #3
0
<script type="text/javascript" src="jsframework/lib/raphael/g.raphael-min.js"></script>
<script type="text/javascript" src="jsframework/lib/raphael/g.pie-min.js"></script>
<script type="text/javascript" src="jsframework/lib/raphael/g.line-min.js"></script>
<script type="text/javascript" src="jsframework/lib/raphael/g.bar-min.js"></script>
<script type="text/javascript" src="jsframework/lib/raphael/utilities.js"></script>
<script type="text/javascript" src="jsframework/portlet.js"></script>
<?php 
$d = new Div(array("id" => "dashboard"));
$d->display();
$modules = $_SESSION["modulesList"];
$i = 1;
$z = 1;
// Search for panels in plugins subdirs...
foreach (getPanels() as $panelName) {
    foreach ($modules as $module) {
        if (hasCorrectModuleAcl($module, false) == true) {
            $basedir = "modules/{$module}/includes/panels/";
            if (is_dir($basedir)) {
                $h = opendir($basedir);
                while (false !== ($f = readdir($h))) {
                    if (substr($f, 0, 1) != ".") {
                        if ($f == $panelName . ".inc.php") {
                            $file = $basedir . $f;
                            include_once $file;
                            if (!isset($options["enable"])) {
                                $options["enable"] = True;
                            }
                            if (!isset($options["refresh"])) {
                                $options["refresh"] = 10;
                            }
                            if ($options["enable"]) {