コード例 #1
0
ファイル: mod_services.php プロジェクト: jasanders/os-aios
function showModulesList($page, $roles)
{
    global $nav_pages;
    global $nav_view;
    // calculate avaiable memory
    $a = exec("df | grep '/usr/local/etc/mos'");
    if ($a == '') {
        $a = exec(" echo \$( df | grep '/usr/local/etc' )| cut -d' ' -f4");
    } else {
        $a = exec(" echo \$( df | grep '/usr/local/etc/mos' )| cut -d' ' -f4");
    }
    $fmem = $a * 1024;
    ?>
<div id="about_container">
<a href="#" onclick="closeAbout()"><div id="about_topic"><?php 
    echo getMsg('coreCm_about');
    ?>
</div></a>
<div id="about_list">
</div></div>

<div id="container">

<table border="0" cellspacing="0" cellpadding="0">
<tr><td><h3><?php 
    echo $nav_pages[$page]['title'];
    ?>
</h3></td>
<td width="20">&nbsp;</td>
<td>
<div class="mod_toolbar">
<a class="mod_button" href="?page=<?php 
    echo $page;
    ?>
&view=tile" title="<?php 
    echo getMsg('coreTileView');
    ?>
">
<img src="modules/core/images/btn_tile_view.png" /></a>
<a class="mod_button" href="?page=<?php 
    echo $page;
    ?>
&view=list" title="<?php 
    echo getMsg('coreListView');
    ?>
">
<img src="modules/core/images/btn_list_view.png" /></a>
<a class="mod_button" href="?page=<?php 
    echo $page;
    ?>
&act=getrep" title="<?php 
    echo getMsg('coreCmUpdList');
    ?>
">
<img src="modules/core/images/btn_page_refresh.png" /></a>
<a class="mod_button" href="?page=update_all&ret=<?php 
    echo $page;
    ?>
&act=prepare" title="<?php 
    echo getMsg('coreCmUpdAll');
    ?>
">
<img src="modules/core/images/btn_update_all.png" /></a>
</div></td></tr></table>

<div class="memory">
<b><?php 
    echo getMsg('coreFreeMem') . getHumanValue($fmem);
    ?>
</b>
</div>

<?php 
    if ($nav_view == 'list') {
        ?>
<table class="mod_listview" border="0" cellspacing="0" cellpadding="8">
<thead><tr>
<td><?php 
        echo getMsg('coreHeadName');
        ?>
</td>
<td><?php 
        echo getMsg('coreHeadDesc');
        ?>
</td>
<td align="center"><?php 
        echo getMsg('coreHeadSize');
        ?>
</td>
<td align="center"><?php 
        echo getMsg('coreHeadIRev');
        ?>
</td>
<td align="center"><?php 
        echo getMsg('coreHeadARev');
        ?>
</td>
</tr></thead>
<?php 
    }
    ksort($roles);
    end($roles);
    $lastRole = key($roles);
    foreach ($roles as $role => $mods) {
        if ($nav_view == 'list') {
            ?>
<thead><tr><td>&nbsp;</td><td colspan="4"><?php 
            echo getMsg('coreRole_' . $role);
            ?>
</td></tr></thead>
<?php 
        } else {
            ?>
<div class="mod_role">
<div class="mod_role_topic"><?php 
            echo getMsg('coreRole_' . $role);
            ?>
</div>
<div class="mod_role_list">
<?php 
        }
        ksort($mods);
        end($mods);
        $lastMod = key($mods);
        foreach ($mods as $mod => $item) {
            $sts = $item['status'];
            if ($nav_view == 'list') {
                ?>
<tr class="mod_list_<?php 
                echo $sts;
                if ($role == $lastRole && $mod == $lastMod) {
                    echo ' mod_list_last';
                }
                ?>
">
<td><?php 
                echo $mod;
                ?>
</td>
<td width="100%">
<?php 
            } else {
                ?>
<div class="mod_card">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="center">
<td><img src="modules/core/images/st_<?php 
                echo $sts;
                ?>
.png" title="<?php 
                echo getMsg('coreSt_' . $sts);
                ?>
"/></td>
<td width="100%">
<?php 
            }
            drawRootMenu($item['menu']);
            ?>
</td>
<?php 
            if ($nav_view == 'list') {
                ?>
<td align="right"><?php 
                echo getHumanValue($item['size']);
                ?>
&nbsp;</td>
<td align="center"><?php 
                echo $item['irev'];
                ?>
&nbsp;</td>
<td align="center"><?php 
                if ($item['arev'] != '' && $item['irev'] != '' && $item['irev'] != $item['arev']) {
                    echo '<b>' . $item['arev'] . '</b>';
                } else {
                    echo $item['arev'];
                }
                ?>
&nbsp;</td></tr>
<?php 
            } else {
                ?>
</tr></table>
<?php 
                if ($item['arev'] != '' && $item['irev'] != '' && $item['irev'] != $item['arev']) {
                    echo "<div class=\"mod_update\">\n";
                    echo "<a href=\"?page={$page}&mod={$mod}&act=update\" title=\"" . getMsg('coreCm_update') . "\">" . $item['arev'] . "</a>\n";
                    echo "</div>\n";
                }
                ?>
</div>
<?php 
            }
        }
        if ($nav_view != 'list') {
            ?>
</div></div>
<?php 
        }
    }
    if ($nav_view == 'list') {
        ?>
</table>
<?php 
    }
    ?>
</div>
<?php 
}
コード例 #2
0
ファイル: index.php プロジェクト: jasanders/os-aios
    $nav_menu = array('main' => array('type' => 'node', 'title' => getMsg('navManage'), 'items' => array()), 'nav' => array('type' => 'node', 'title' => getMsg('navigation'), 'items' => array()), 'res' => array('type' => 'node', 'title' => getMsg('navResouces'), 'items' => array()), 'srv' => array('type' => 'node', 'title' => getMsg('navService'), 'items' => array()));
    $d = opendir('modules');
    while ($m = readdir($d)) {
        if ($nav_modules[$m]['_show']) {
            $f = 'modules/' . $m . '/def_navy.php';
            if (file_exists($f)) {
                include $f;
            }
        }
    }
    ?>
<div id="header">
<center><table><tr><td>
<?php 
    // draw menu
    drawRootMenu($nav_menu);
    ?>
</td></tr></table></center></div>

<div id="content_container">
<?php 
    // draw content
    if (function_exists($npage . '_body')) {
        call_user_func($npage . '_body');
    }
    ?>
</div></div>
</body></html>
<?php 
} else {
    // non-html page