Exemple #1
0
function list_S3QL($element, $D)
{
    extract($D);
    if ($element == 'projects') {
        $data = list_projects($D);
    }
    if ($element == 'resources' || $element == 'classes') {
        $data = list_classes($D);
        #$data = list_shared_resources ($D);
        #if($data=='')
        #$data = list_project_resources ($D);
    }
    if ($element == 'users') {
        #$data = list_users($D);
        $data = list_all_users($D);
    }
    if ($element == 'keys') {
        $data = list_keys($D);
    }
    if ($element == 'accesslog') {
        $data = list_logs($D);
    }
    if ($element == 'rules') {
        $data = list_rules($D);
    }
    if ($element == 'rulelog') {
        $data = list_rules_log($D);
    }
    if ($element == 'resource instances') {
        $data = list_all_instances($D);
    }
    if ($element == 'statements') {
        $data = list_statements($D);
        if (is_array($data)) {
            $data = array_map('ValuesToFileLinks', $data);
        }
    }
    #echo '<pre>';print_r($data);
    #After the query, resume the cols that are supposed to be displayed
    if ($D['out'] != '' && $D['out'] != '*') {
        if ($SQLfun == 'distinct') {
            $D['out'] = str_replace(array($SQLfun, "(", ")"), "", $D['out']);
        }
        $cols = array_map('trimmit', explode(',', $D['out']));
    }
    for ($c = 0; $c < count($cols); $c++) {
        $pCol = $cols[$c];
        if ($c == count($cols) - 1) {
            $header .= trim($pCol);
        } else {
            $header .= trim($pCol) . $format['middle'];
        }
    }
    $x = array('data' => $data, 'format' => $format, 'header' => $header, 'columns' => $cols);
    if ($data != '') {
        echo display($x);
    } else {
        echo "<report>Your query returned no results</report>";
    }
}
Exemple #2
0
function html5_user_listprojects($lang, $mod = null)
{
    global $text_cont;
    trigger_error($mod);
    if (is_string($mod)) {
        $cb = 'html5_' . $mod;
        $mod = $cb($lang);
    }
    $list = list_projects();
    $count = 0;
    $html_var = '<div id="message">' . $mod . '</div><div id="project_list">';
    if (isset($list)) {
        foreach ($list as $key => $value) {
            if (in_array($key, $_SESSION['db_data']['projects']) || admin(true) || vip(true)) {
                $html_var .= '<div class="project"><a href="?action=project&project_id=' . $key . '">' . html($value['name']) . '</a></div>';
                $count++;
            }
        }
    }
    if (!$count) {
        $html_var .= '<div class="project">' . $text_cont[53][$lang] . '</div>';
    }
    $html_var .= '</div>';
    return $html_var;
}
} else {
    echo "<a href='list_etexts.php?x=s{$listsuffix}'>" . _("Silver") . "</a>";
}
echo " | ";
if ($type == "Bronze") {
    echo _("Bronze");
} else {
    echo "<a href='list_etexts.php?x=b{$listsuffix}'>" . _("Bronze") . "</a>";
}
?>
</center><br>

<?php 
echo "<p>{$info}</p>";
echo "<p>{$boilerplate}</p>";
?>
<center>
<?php 
$listurl = "list_etexts.php?x={$x}&amp;per_page={$per_page}&amp;offset={$offset}";
echo sprintf(_("<i>Title:</i> <a href='%1\$s'>asc</a> or <a href='%2\$s'>desc</a> | "), "{$listurl}&amp;sort=0", "{$listurl}&amp;sort=1");
echo sprintf(_("<i>Author:</i> <a href='%1\$s'>asc</a> or <a href='%2\$s'>desc</a> | "), "{$listurl}&amp;sort=2", "{$listurl}&amp;sort=3");
echo sprintf(_("<i>Submitted Date:</i> <a href='%1\$s'>asc</a> or <a href='%2\$s'>desc</a>"), "{$listurl}&amp;sort=4", "{$listurl}&amp;sort=5");
?>
<br>
</center>
<hr width="75%" align="center">

<?php 
$sortlist = array("ORDER BY nameofwork asc", "ORDER BY nameofwork desc", "ORDER BY authorsname asc", "ORDER BY authorsname desc", "ORDER BY modifieddate asc", "ORDER BY modifieddate desc");
list_projects($state, $sortlist[$sort], "list_etexts.php?x={$x}&amp;sort={$sort}&amp;", $per_page, $offset);
// vim: sw=4 ts=4 expandtab
function load_index($path, MCSession $curusr)
{
    if (empty($path) || $path == "/") {
        require_once dirname(__FILE__) . "/appmodules/series.mod.php";
        return list_projects($curusr, $_GET['q']);
    } else {
        require_once dirname(__FILE__) . "/appmodules/children.mod.php";
        return list_children($path, $curusr, $_GET['q']);
    }
}