Exemple #1
0
        echo "<h3 class='error'>" . __('No types found') . "</h3>";
    } else {
        $table = new stdClass();
        $table->width = '99%';
        $table->class = 'listing';
        $table->head = array();
        $table->data = array();
        $table->colspan = array();
        $table->head[0] = __('Name');
        $table->head[1] = __('Icon');
        $table->head[2] = __('Items');
        $table->head[3] = __('Delete');
        foreach ($types as $type) {
            $data = array();
            $data[0] = "<a href='index.php?sec=download&sec2=operation/download/manage_types&id=" . $type["id"] . "'>" . $type["name"] . "</a>";
            $data[1] = get_download_type_icon($type["id"]);
            $data[2] = (int) get_db_value('COUNT(id_download)', 'tdownload_type_file', 'id_type', $type["id"]);
            $data[3] = "<a href='index.php?sec=download&sec2=operation/download/manage_types&op=delete&id=" . $type["id"] . "'\n\t\t\t\t\t\t\tonClick='if (!confirm(\" " . __('Are you sure?') . "\")) return false;'>\n\t\t\t\t\t\t\t<img title='" . __('Delete') . "' border='0' src='images/cross.png'></a>";
            array_push($table->data, $data);
        }
        print_table($table);
    }
    echo '<div style="width:99%; text-align: right;">';
    echo "<form method=post action='index.php?sec=download&sec2=operation/download/manage_types'>";
    print_input_hidden('op', 'new');
    print_submit_button(__('Create'), 'crt_btn', false, 'class="sub create"');
    echo "</form></div>";
}
// end of list
?>
Exemple #2
0
 // Name
 $data[0] = "<a title='" . $row["description"] . "' href='operation/common/download_file.php?type=release&id_attachment=" . $row["id"] . "'>";
 $data[0] .= $row["name"] . "</a>";
 if ($row["description"] != "") {
     $data[0] .= " <img src='images/zoom.png'>";
 }
 // Size
 $data[1] = format_for_graph(filesize($config["homedir"] . $row["location"]), 1, ".", ",", 1024);
 // Category
 $data[2] = "<img src='images/download_category/" . get_db_sql("SELECT icon FROM tdownload_category WHERE id = " . $row["id_category"]) . "'>";
 // Type
 $row["id_type"] = get_db_value("id_type", "tdownload_type_file", "id_download", $row["id"]);
 if (!$row["id_type"]) {
     $row["id_type"] = -1;
 }
 $data[3] = get_download_type_icon($row["id_type"]);
 if (give_acl($config["id_user"], 0, "FRW")) {
     // Downloads
     $data[4] = get_db_sql("SELECT COUNT(*) FROM tdownload_tracking where id_download = " . $row["id"]);
     // Public URL
     if ($row["public"]) {
         $url = $config["base_url"] . "/operation/common/download_file.php?type=external_release&id_attachment=" . $row["external_id"];
         $data[5] = "<a href='{$url}'><img src='images/world.png'></a>";
     } else {
         $data[5] = "";
     }
 }
 // Timestamp
 $data[6] = human_time_comparation($row["date"]);
 if (give_acl($config["id_user"], 0, "FRW")) {
     // Edit