Example #1
1
/**
 * 
 * 
 * @param $appname
 * @param $file
 * @param $file2
 */
function display_section($nav, $items)
{
    section_start($nav['text'], $GLOBALS['phpgw']->common->image($nav['image'][0], $nav['image'][1]));
    foreach ($items as $item) {
        section_item($item['url'], $item['text']);
    }
    section_end();
}
<?php

$img = '/' . $appname . '/images/' . $appname . '.gif';
if (file_exists($GLOBALS['phpgw_info']['server']['server_root'] . $img)) {
    $img = $GLOBALS['phpgw_info']['server']['webserver_url'] . $img;
} else {
    $img = '/' . $appname . '/images/navbar.gif';
    if (file_exists($GLOBALS['phpgw_info']['server']['server_root'] . $img)) {
        $img = $GLOBALS['phpgw_info']['server']['webserver_url'] . $img;
    } else {
        $img = '';
    }
}
section_start('Headlines', $img);
echo '<a href="' . $GLOBALS['phpgw']->link('/headlines/admin.php') . '">' . lang('Edit headline sites') . '</a><br>';
echo '<a href="' . $GLOBALS['phpgw']->link('/headlines/preferences.php', 'editDefault=1') . '">' . lang('Edit headlines shown by default') . '</a>';
section_end();
function display_section($appname, $file, $file2 = False)
{
    if ($file2) {
        $file = $file2;
    }
    section_start($appname, $GLOBALS['phpgw']->common->image($appname, array('navbar', $appname)));
    while (list($text, $url) = each($file)) {
        section_item($url, lang($text));
    }
    section_end();
}
function display_section($appname, $file, $file2 = False)
{
    if ($file2) {
        $file = $file2;
    }
    if (is_array($file)) {
        section_start($appname, $GLOBALS['phpgw']->common->image($appname, array('navbar', $appname, 'nonav')));
        while (list($text, $url) = each($file)) {
            // If user doesn't have application configuration access, then don't show the configuration links
            if (strpos($url, 'admin.uiconfig') === False || !$GLOBALS['phpgw']->acl->check('site_config_access', 1, 'admin')) {
                section_item($url, lang($text));
            }
        }
        section_end();
    }
}
    header("location:admin.index.php");
    die;
}
$users = new usersMenus();
if (!$users->AsProxyMonitor) {
    die;
}
if (isset($_GET["section"])) {
    section_start();
    exit;
}
if (isset($_GET["session-search"])) {
    search_session();
    exit;
}
section_start();
function section_start()
{
    $boot = new boostrap_form();
    $tpl = new templates();
    $page = CurrentPageName();
    echo $boot->SearchFormGen("searchstring", "session-search", null, null);
}
function search_session()
{
    $tpl = new templates();
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?squid-sessions=yes")));
    if (count($datas) == 0) {
        senderrors("{this_request_contains_no_data}");
    }