示例#1
0
/**
 * @version $Id: search.php 237 2014-04-25 11:47:48Z soeren $
 * @package eXtplorer
 * @copyright soeren 2007-2014
 * @author The eXtplorer project (http://extplorer.net)
 * @author The	The QuiX project (http://quixplorer.sourceforge.net)
 *
 * @license
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Alternatively, the contents of this file may be used under the terms
 * of the GNU General Public License Version 2 or later (the "GPL"), in
 * which case the provisions of the GPL are applicable instead of
 * those above. If you wish to allow use of your version of this file only
 * under the terms of the GPL and not to allow others to use
 * your version of this file under the MPL, indicate your decision by
 * deleting  the provisions above and replace  them with the notice and
 * other provisions required by the GPL.  If you do not delete
 * the provisions above, a recipient may use your version of this file
 * under either the MPL or the GPL."
 *
 * File-Search Functions
 */
function ext_search_items($dir)
{
    // search for item
    if (empty($dir) && !empty($GLOBALS['__POST']["item"])) {
        $dir = $GLOBALS['__POST']["item"];
    }
    if (isset($GLOBALS['__POST']["searchitem"])) {
        $searchitem = stripslashes($GLOBALS['__POST']["searchitem"]);
        $subdir = !empty($GLOBALS['__POST']["subdir"]);
        $content = $GLOBALS['__POST']["content"];
        $list = make_list($dir, $searchitem, $subdir, $content);
    } else {
        $searchitem = NULL;
        $subdir = true;
    }
    if (empty($searchitem)) {
        show_searchform($dir);
        return;
    }
    // Results in JSON
    $items['totalCount'] = count($list);
    $result = get_result_array($list);
    $start = (int) $GLOBALS['__POST']["start"];
    $limit = (int) $GLOBALS['__POST']["limit"];
    if ($start < $items['totalCount'] && $limit < $items['totalCount']) {
        $result = array_splice($result, $start, $limit);
    }
    $items['items'] = $result;
    $json = new ext_Json();
    while (@ob_end_clean()) {
    }
    echo $json->encode($items);
}
示例#2
0
function make_list ($parent,$all=null){
    static $tasks;
    if(isset($all)){
        $tasks=$all;
    }
    echo'<ol>';
        foreach ($parent as $task_id=>$todo) {
            echo"<li>$todo";
            if(isset($tasks[$task_id])){
                make_list($tasks[$task_id]);
            }
            echo'</li>';
        }
        
    echo'</ol>';
    
}
示例#3
0
function make_list($parent)
{
    global $tasks;
    echo '<ol>';
    // Start an ordered list.
    foreach ($parent as $task_id => $todo) {
        echo "<li>{$todo}";
        if (isset($tasks[$task_id])) {
            // Call this function again:
            make_list($tasks[$task_id]);
        }
        echo '</li>';
        // Complete the list item.
    }
    // End of FOREACH loop.
    echo '</ol>';
    // Close the ordered list.
}
示例#4
0
function make_list($parent)
{
    global $tasks;
    echo '<ul>';
    // Loop through each sub-array
    foreach ($parent as $task_id => $todo) {
        // Display the item
        echo "<li>{$todo}";
        // Check for subtasks
        if (isset($tasks[$task_id])) {
            // Call this function again
            make_list($tasks[$task_id]);
        }
        echo '</li>';
        // Complete the list item
    }
    // end foreach
    echo '</ul>';
    // Close the ordered list
}
示例#5
0
function make_list($parent)
{
    global $tasks;
    echo '<ol>';
    // Start an ordered list.
    foreach ($parent as $task_id => $todo) {
        // Start with a checkbox!
        echo <<<EOT
<li><input type="checkbox" name="tasks[{$task_id}]" value="done"> {$todo}
EOT;
        // Check for subtasks:
        if (isset($tasks[$task_id])) {
            make_list($tasks[$task_id]);
        }
        echo '</li>';
        // Complete the list item.
    }
    // End of FOREACH loop.
    echo '</ol>';
    // Close the ordered list.
}
示例#6
0
function make_list($parent)
{
    // Need the main $tasks array:
    global $tasks;
    echo '<ol>';
    // Start an ordered list.
    // Loop through each subarray:
    foreach ($parent as $task_id => $todo) {
        // Display the item:
        echo "<li>{$todo}";
        // Check for subtasks:
        if (isset($tasks[$task_id])) {
            // Call this function again:
            make_list($tasks[$task_id]);
        }
        echo '</li>';
        // Complete the list item.
    }
    // End of FOREACH loop.
    echo '</ol>';
    // Close the ordered list.
}
示例#7
0
文件: view_tasks.php 项目: jyip/ToDo
function make_list($parent)
{
    // Need the main $tasks array:
    global $tasks;
    // Start and order list:
    echo '<ol>';
    // Loop through each subarray:
    foreach ($parent as $id => $todo) {
        // Display the item:
        echo <<<EOT
<li><input type="checkbox" name="tasks[{$id}]" value="done" /> {$todo}
EOT;
        // Check for subtasks:
        if (isset($tasks[$id])) {
            // Call function again:
            make_list($tasks[$id]);
        }
        // Complete the list item:
        echo '</li>';
    }
    // End of FOREACH loop
    // Close the ordered list:
    echo '</ol>';
}
示例#8
0
function list_dir($dir)
{
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header("<a href='javascript:history.go(-1);'><font color=#0a0a0a>Go Back to Problem List</font></a><br>" . $GLOBALS["messages"]["actdir"] . ": /" . get_rel_item("", $s_dir));
    // Javascript functions:
    include "./.include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"_img/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", $dir_up, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_up.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_home.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"_img/_refresh.gif\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_search.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    // print the edit buttons
    _print_edit_buttons($dir);
    // ADMIN & LOGOUT
    if (login_ok()) {
        echo "<TD>::</TD>";
        // ADMIN
        _print_link("admin", permissions_grant(NULL, NULL, "admin") || permissions_grant(NULL, NULL, "password"), $dir, NULL);
        // LOGOUT
        _print_link("logout", true, $dir, NULL);
    }
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if (permissions_grant($dir, NULL, "create")) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<SELECT name=\"mktype\"><option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list));
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $free = parse_file_size(disk_free_space(get_abs_dir($dir)));
    } elseif (function_exists("diskfreespace")) {
        $free = parse_file_size(diskfreespace(get_abs_dir($dir)));
    } else {
        $free = "?";
    }
    // echo "Total: ".parse_file_size(disk_total_space(get_abs_dir($dir))).", ";
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    for ($i = 0; $i < 4; ++$i) {
        echo "<TD class=\"header\"></TD>";
    }
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " LIKE '%" . $text_field[$key] . "%'";
                    break;
                case 'STARTS WITH (..%)':
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " LIKE '" . $text_field[$key] . "%'";
                    break;
                case 'ENDS WITH (%..)':
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " LIKE '%" . $text_field[$key] . "'";
                    break;
                case 'BETWEEN (value1, value2)':
                    $data = explode(',', $text_field[$key]);
                    $value1 = trim($data[0]);
                    $value2 = trim($data[1]);
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " BETWEEN '" . $value1 . "' AND '" . $value2 . "'";
                    break;
            }
            make_list($where_clause, $new_entry, ' AND ', FALSE);
        }
    }
}
//Construct group by - actually just needs to identify the field to use for group by clause
if (isset($arr_fields[$group_field])) {
    $group_clause = $arr_fields[$group_field];
} else {
    $group_clause = '';
}
$obj_custom_report = cobalt_load_class($data_subclass);
$obj_custom_report->custom_select_fields = $select_fields;
$obj_custom_report->custom_where_clause = $where_clause;
$obj_custom_report->custom_group_by = $group_clause;
$obj_custom_report->custom_join = $custom_join;
$obj_custom_report->custom_report();
示例#10
0
function print_list_page()
{
    global $admin, $template, $HEADING, $TEXT;
    // Generate pages list
    if ($admin->get_permission('pages_view') == true) {
        $template->set_file('pages_list', 'pages_list.htt');
        $template->set_block('pages_list', 'main_block', 'main');
        $template->set_block('main_block', 'page_list_block', 'page_list');
        $template->set_var('HEADING_MODIFY_DELETE_PAGE', $HEADING['MODIFY_DELETE_PAGE']);
        $template->set_var('TEXT_VISIBILITY', $TEXT['VISIBILITY']);
        $template->set_var('TEXT_MENU_TITLE', $TEXT['MENU_TITLE']);
        $template->set_var('TEXT_PAGE_TITLE', $TEXT['PAGE_TITLE']);
        $template->set_var('TEXT_ACTIONS', $TEXT['ACTIONS']);
        $par = array();
        $par['num_subs'] = 1;
        $editable_pages = 0;
        $loop = make_list(0, $editable_pages);
        $template->set_var('PAGES_LIST_LOOP', $loop);
        $template->parse('pages_list', 'page_list_block');
        $template->parse('main', 'main_block');
        $template->pparse('output', 'pages_list');
        if ($editable_pages == 0) {
            echo "</div><div class='empty_list'>" . $TEXT['NONE_FOUND'] . "</div>";
        }
    } else {
        $editable_pages = 0;
        echo "</div><div class='empty_list'>" . $TEXT['NONE_FOUND'] . "</div>";
    }
}
示例#11
0
 function get_listview_fields()
 {
     $table_name = $this->table_name;
     $this->arr_subtext_separators = array();
     foreach ($this->fields as $field_name => $field_struct) {
         if ($field_struct['in_listview'] == TRUE) {
             $make_filter_label = TRUE;
             if ($field_struct['attribute'] == 'foreign key' || $field_struct['attribute'] == 'primary&foreign key') {
                 $has_no_defined_relationship = TRUE;
                 //find the relationship information for this field; only 1-1
                 foreach ($this->relations as $key => $rel) {
                     if (strip_back_quote_smart($rel['link_child']) == $field_name && $rel['type'] == '1-1') {
                         $has_no_defined_relationship = FALSE;
                         require_once 'subclasses/' . strip_back_quote_smart($rel['table']) . '.php';
                         $class = strip_back_quote_smart($rel['table']);
                         $data_con = new $class();
                         $database = $data_con->db_use;
                         $temp_field_name = '';
                         $filter_field_name = '';
                         $arr_subtexts = array();
                         $arr_subtext_labels = array();
                         $subtext_cntr = 0;
                         foreach ($rel['link_subtext'] as $subtext) {
                             if ($temp_field_name != '') {
                                 $temp_field_name .= ', ';
                             }
                             if ($filter_field_name != '') {
                                 $filter_field_name .= ', ';
                             }
                             if (isset($rel['alias']) && $rel['alias'] != '') {
                                 $temp_field_name .= back_quote_smart($database) . '.' . back_quote_smart($rel['alias']) . '.' . back_quote_smart($subtext) . ' AS ' . back_quote_smart($database . '_' . $rel['alias'] . '_' . $subtext);
                                 $filter_field_name .= back_quote_smart($database) . '.' . back_quote_smart($rel['alias']) . '.' . back_quote_smart($subtext);
                                 $arr_subtexts[] = $database . '_' . $rel['alias'] . '_' . $subtext;
                             } else {
                                 $temp_field_name .= back_quote_smart($database) . '.' . back_quote_smart($rel['table']) . '.' . back_quote_smart($subtext) . ' AS ' . back_quote_smart($database . '_' . $rel['table'] . '_' . $subtext);
                                 $filter_field_name .= back_quote_smart($database) . '.' . back_quote_smart($rel['table']) . '.' . back_quote_smart($subtext);
                                 $arr_subtexts[] = $database . '_' . $rel['table'] . '_' . $subtext;
                             }
                             $arr_subtext_labels[] = $data_con->fields[$subtext]['label'];
                             ++$subtext_cntr;
                         }
                         if ($subtext_cntr > 1) {
                             foreach ($arr_subtext_labels as $new_filter_label) {
                                 make_list_array($this->arr_filter_field_labels, $new_filter_label);
                             }
                             $make_filter_label = FALSE;
                         }
                         if (isset($this->fields[$field_name]['list_settings']['list_separators'])) {
                             $this->arr_subtext_separators[] = $this->fields[$field_name]['list_settings']['list_separators'];
                         }
                         $related_field_name = $temp_field_name;
                         make_list($this->lst_fields, back_quote_smart($related_field_name), ',', FALSE);
                         make_list($this->lst_filter_fields, back_quote_smart($filter_field_name), ',', FALSE);
                         $this->arr_fields[] = $arr_subtexts;
                         if ($field_struct['attribute'] == 'primary&foreign key') {
                             //if foreign key is also a primary key, we also need the original field aside from the subtext field
                             $orig_field_name = back_quote_smart($table_name) . '.' . back_quote_smart($field_name);
                             make_list($this->lst_fields, back_quote_smart($orig_field_name), ',', FALSE);
                         }
                     }
                 }
                 if ($has_no_defined_relationship) {
                     error_handler('Cannot render ListView, incorrect configuration.', ' Missing relationship information for foreign-key column "' . $field_name . '".');
                 }
             } else {
                 make_list($this->lst_fields, back_quote_smart($table_name) . '.' . back_quote_smart($field_name), ',', FALSE);
                 make_list($this->lst_filter_fields, back_quote_smart($table_name) . '.' . back_quote_smart($field_name), ',', FALSE);
                 make_list_array($this->arr_fields, $field_name);
             }
             make_list($this->lst_field_labels, $field_struct['label'], ',');
             make_list_array($this->arr_field_labels, $field_struct['label']);
             if ($make_filter_label) {
                 make_list_array($this->arr_filter_field_labels, $field_struct['label']);
             }
         } elseif ($field_struct['attribute'] == 'primary key') {
             make_list($this->lst_fields, back_quote_smart($table_name) . '.' . back_quote_smart($field_name), ',', FALSE);
         }
     }
     return $this;
 }
示例#12
0
文件: list.php 项目: kostya1017/our
/**
 * This function assembles an array (list) of files or directories in the directory specified by $dir
 * The result array is send using JSON
 *
 * @param string $dir
 * @param string $sendWhat Can be "files" or "dirs"
 */
function send_dircontents($dir, $sendWhat = 'files')
{
    // print table of files
    global $dir_up, $mainframe;
    // make file & dir tables, & get total filesize & number of items
    get_dircontents($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    if ($sendWhat == 'files') {
        $list = $file_list;
    } elseif ($sendWhat == 'dirs') {
        $list = $dir_list;
    } else {
        $list = make_list($dir_list, $file_list);
    }
    $i = 0;
    $items['totalCount'] = count($list);
    $items['items'] = array();
    $dirlist = array();
    if ($sendWhat != 'dirs') {
        // Replaced array_splice, because it resets numeric indexes (like files or dirs with a numeric name)
        // Here we reduce the list to the range of $limit beginning at $start
        $a = 0;
        $output_array = array();
        foreach ($list as $key => $value) {
            if ($a >= $GLOBALS['start'] && $a - $GLOBALS['start'] < $GLOBALS['limit']) {
                $output_array[$key] = $value;
            }
            $a++;
        }
        $list = $output_array;
    }
    while (list($item, $info) = each($list)) {
        // link to dir / file
        if (is_array($info)) {
            $abs_item = $info;
            if (extension_loaded('posix')) {
                $user_info = posix_getpwnam($info['user']);
                $file_info['uid'] = $user_info['uid'];
                $file_info['gid'] = $user_info['gid'];
            }
        } else {
            $abs_item = get_abs_item(ext_TextEncoding::fromUTF8($dir), $item);
            $file_info = @stat($abs_item);
        }
        $is_dir = get_is_dir($abs_item);
        if ($GLOBALS['use_mb']) {
            if (ext_isFTPMode()) {
                $items['items'][$i]['name'] = $item;
            } else {
                if (mb_detect_encoding($item) == 'ASCII') {
                    $items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
                } else {
                    $items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
                }
            }
        } else {
            $items['items'][$i]['name'] = ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item);
        }
        $items['items'][$i]['is_file'] = get_is_file($abs_item);
        $items['items'][$i]['is_archive'] = ext_isArchive($item) && !ext_isFTPMode();
        $items['items'][$i]['is_writable'] = $is_writable = @$GLOBALS['ext_File']->is_writable($abs_item);
        $items['items'][$i]['is_chmodable'] = $is_chmodable = @$GLOBALS['ext_File']->is_chmodable($abs_item);
        $items['items'][$i]['is_readable'] = $is_readable = @$GLOBALS['ext_File']->is_readable($abs_item);
        $items['items'][$i]['is_deletable'] = $is_deletable = @$GLOBALS['ext_File']->is_deletable($abs_item);
        $items['items'][$i]['is_editable'] = get_is_editable($abs_item);
        $items['items'][$i]['icon'] = _EXT_URL . "/images/" . get_mime_type($abs_item, "img");
        $items['items'][$i]['size'] = parse_file_size(get_file_size($abs_item));
        // type
        $items['items'][$i]['type'] = get_mime_type($abs_item, "type");
        // modified
        $items['items'][$i]['modified'] = parse_file_date(get_file_date($abs_item));
        // permissions
        $perms = get_file_perms($abs_item);
        if ($perms) {
            if (strlen($perms) > 3) {
                $perms = substr($perms, 2);
            }
            $items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
        } else {
            $items['items'][$i]['perms'] = ' (unknown) ';
        }
        $items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
        if (extension_loaded("posix")) {
            if ($file_info["uid"]) {
                $user_info = posix_getpwuid($file_info["uid"]);
                //$group_info = posix_getgrgid($file_info["gid"]);
                $items['items'][$i]['owner'] = $user_info["name"] . " (" . $file_info["uid"] . ")";
            } else {
                $items['items'][$i]['owner'] = " (unknown) ";
            }
        } else {
            $items['items'][$i]['owner'] = 'n/a';
        }
        if ($is_dir && $sendWhat != 'files') {
            $id = str_replace('/', $GLOBALS['separator'], $dir) . $GLOBALS['separator'] . $item;
            $id = str_replace($GLOBALS['separator'], '_RRR_', $id);
            $qtip = "<strong>" . ext_Lang::mime('dir', true) . "</strong><br /><strong>" . ext_Lang::msg('miscperms', true) . ":</strong> " . $perms . "<br />";
            $qtip .= '<strong>' . ext_Lang::msg('miscowner', true) . ':</strong> ' . $items['items'][$i]['owner'];
            if ($GLOBALS['use_mb']) {
                if (ext_isFTPMode()) {
                    $dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                } else {
                    if (mb_detect_encoding($item) == 'ASCII') {
                        $dirlist[] = array('text' => htmlspecialchars(ext_TextEncoding::toUTF8($item)), 'id' => utf8_encode($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                    } else {
                        $dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                    }
                }
            } else {
                $dirlist[] = array('text' => htmlspecialchars(ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item)), 'id' => ext_isFTPMode() ? $id : ext_TextEncoding::toUTF8($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
            }
        }
        if (!$is_dir && $sendWhat == 'files' || $sendWhat == 'both') {
            $i++;
        }
    }
    while (@ob_end_clean()) {
    }
    if ($sendWhat == 'dirs') {
        $result = $dirlist;
    } else {
        $result = $items;
    }
    $classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
    $json = new $classname();
    echo $json->encode($result);
    ext_exit();
}
示例#13
0
function search_items($dir)
{
    // search for item
    if (isset($GLOBALS['__POST']["searchitem"])) {
        $searchitem = stripslashes($GLOBALS['__POST']["searchitem"]);
        $subdir = isset($GLOBALS['__POST']["subdir"]) && $GLOBALS['__POST']["subdir"] == "y";
        $list = make_list($dir, $searchitem, $subdir);
    } else {
        $searchitem = NULL;
        $subdir = true;
    }
    $msg = $GLOBALS["messages"]["actsearchresults"];
    if ($searchitem != NULL) {
        $msg .= ": (/" . get_rel_item($dir, $searchitem) . ")";
    }
    show_header($msg);
    // Search Box
    echo "<BR><TABLE><FORM name=\"searchform\" action=\"" . make_link("search", $dir, NULL);
    echo "\" method=\"post\">\n<TR><TD><INPUT name=\"searchitem\" type=\"text\" size=\"25\" value=\"";
    echo $searchitem . "\"><INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btnsearch"];
    echo "\">&nbsp;<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnclose"];
    echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL);
    echo "';\"></TD></TR><TR><TD><INPUT type=\"checkbox\" name=\"subdir\" value=\"y\"";
    echo ($subdir ? " checked>" : ">") . $GLOBALS["messages"]["miscsubdirs"] . "</TD></TR></FORM></TABLE>\n";
    // Results
    if ($searchitem != NULL) {
        echo "<TABLE width=\"95%\"><TR><TD colspan=\"2\"><HR></TD></TR>\n";
        if (count($list) > 0) {
            // Table Header
            echo "<TR>\n<TD WIDTH=\"42%\" class=\"header\"><B>" . $GLOBALS["messages"]["nameheader"];
            echo "</B></TD>\n<TD WIDTH=\"58%\" class=\"header\"><B>" . $GLOBALS["messages"]["pathheader"];
            echo "</B></TD></TR>\n<TR><TD colspan=\"2\"><HR></TD></TR>\n";
            // make & print table of found items
            print_table($list);
            echo "<TR><TD colspan=\"2\"><HR></TD></TR>\n<TR><TD class=\"header\">" . count($list) . " ";
            echo $GLOBALS["messages"]["miscitems"] . ".</TD><TD class=\"header\"></TD></TR>\n";
        } else {
            echo "<TR><TD>" . $GLOBALS["messages"]["miscnoresult"] . "</TD></TR>";
        }
        echo "<TR><TD colspan=\"2\"><HR></TD></TR></TABLE>\n";
    }
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.searchform) document.searchform.searchitem.focus();
// -->
</script><?php 
}
                    $value2 = trim($data[1]);
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " BETWEEN '" . $value1 . "' AND '" . $value2 . "'";
                    break;
                case 'NOT BETWEEN (value1, value2)':
                    $data = explode(',', $op_value);
                    $value1 = trim($data[0]);
                    $value2 = trim($data[1]);
                    $new_entry = $arr_fields[$arr_fields_by_order[$key]] . " NOT BETWEEN '" . $value1 . "' AND '" . $value2 . "'";
                    break;
            }
            make_list($where_clause, $new_entry, ' AND ', FALSE);
        }
    }
}
//Construct group by - actually just needs to identify the field to use for group by clause
init_var($group_clause);
if (isset($arr_fields[$group_field1])) {
    make_list($group_clause, $arr_fields[$group_field1], ', ', FALSE);
}
if (isset($arr_fields[$group_field2])) {
    make_list($group_clause, $arr_fields[$group_field2], ', ', FALSE);
}
if (isset($arr_fields[$group_field3])) {
    make_list($group_clause, $arr_fields[$group_field3], ', ', FALSE);
}
$obj_custom_report = cobalt_load_class($data_subclass);
$obj_custom_report->custom_select_fields = $select_fields;
$obj_custom_report->custom_where_clause = $where_clause;
$obj_custom_report->custom_group_by = $group_clause;
$obj_custom_report->custom_join = $custom_join;
$obj_custom_report->custom_report();
示例#15
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        ext_Result::sendResult('', false, $dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>&nbsp;/&nbsp;";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>&nbsp;/&nbsp;";
        }
    }
    echo '<div class="componentheading">' . $GLOBALS["messages"]["actdir"] . ": " . $dir_links . '</div>';
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _EXT_URL . "/images/";
    if ($GLOBALS["direction"] == "ASC") {
        $_srt = "DESC";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "ASC";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    /*echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    	
    	// PARENT DIR
    	echo "<td>";
    	if( $dir != "" ) {
    	  echo "<a href=\"".make_link("list",$dir_up,NULL)."\">";
    	  echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_up.png\" ";
    	  echo "alt=\"".$GLOBALS["messages"]["uplink"]."\" title=\"".$GLOBALS["messages"]["uplink"]."\"></a>";
    	}
    	echo "</td>\n";
    	// HOME DIR
    	echo "<td><a href=\"".make_link("list",NULL,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_home.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["homelink"]."\" title=\"".$GLOBALS["messages"]["homelink"]."\"></a></td>\n";
    	// RELOAD
    	echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    	echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_refresh.gif\" alt=\"".$GLOBALS["messages"]["reloadlink"];
    	echo "\" title=\"".$GLOBALS["messages"]["reloadlink"]."\"></A></td>\n";
    	// SEARCH
    	echo "<td><a href=\"".make_link("search",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_search.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["searchlink"]."\" title=\"".$GLOBALS["messages"]["searchlink"];
    	echo "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	// Joomla Sysinfo
    	echo "<td><a href=\"".make_link("sysinfo",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/systeminfo.gif\" ";
    	echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" .$GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	if($allow) {
    		// COPY
    		echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_copy.gif\" alt=\"".$GLOBALS["messages"]["copylink"];
    		echo "\" title=\"".$GLOBALS["messages"]["copylink"]."\"></a></td>\n";
    		// MOVE
    		echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_move.gif\" alt=\"".$GLOBALS["messages"]["movelink"];
    		echo "\" title=\"".$GLOBALS["messages"]["movelink"]."\"></A></td>\n";
    		// DELETE
    		echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_delete.gif\" alt=\"".$GLOBALS["messages"]["dellink"];
    		echo "\" title=\"".$GLOBALS["messages"]["dellink"]."\"></A></td>\n";
    		// CHMOD
    		echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
    		// UPLOAD
    		if(ini_get("file_uploads")) {
    			echo "<td><a href=\"".make_link("upload",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></A></td>\n";
    		} else {
    			echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></td>\n";
    		}
    		// ARCHIVE
    		if($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) {
    			echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    			echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_archive.gif\" alt=\"".$GLOBALS["messages"]["comprlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["comprlink"]."\"></A></td>\n";
    		}
    	} else {
    		// COPY
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_copy_.gif\" alt=\"".$GLOBALS["messages"]["copylink"]."\" title=\"";
    		echo $GLOBALS["messages"]["copylink"]."\"></td>\n";
    		// MOVE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_move_.gif\" alt=\"".$GLOBALS["messages"]["movelink"]."\" title=\"";
    		echo $GLOBALS["messages"]["movelink"]."\"></td>\n";
    		// DELETE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_delete_.gif\" alt=\"".$GLOBALS["messages"]["dellink"]."\" title=\"";
    		echo $GLOBALS["messages"]["dellink"]."\"></td>\n";
    		// UPLOAD
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uplink"];
    		echo "\" title=\"".$GLOBALS["messages"]["uplink"]."\"></td>\n";
    	}
    
    	// ADMIN & LOGOUT
    	if($GLOBALS["require_login"]) {
    		echo "<td>::</td>";
    		// ADMIN
    		if($admin) {
    			echo "<td><a href=\"".make_link("admin",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_admin.gif\" alt=\"".$GLOBALS["messages"]["adminlink"]."\" title=\"";
    			echo $GLOBALS["messages"]["adminlink"]."\"></A></td>\n";
    		}
    		// LOGOUT
    		echo "<td><a href=\"".make_link("logout",NULL,NULL)."\">";
    		echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_logout.gif\" alt=\"".$GLOBALS["messages"]["logoutlink"]."\" title=\"";
    		echo $GLOBALS["messages"]["logoutlink"]."\"></a></td>\n";
    	}
    	// Logo
    	echo "<td style=\"padding-left:10px;\">";
    	//echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    	echo "<a href=\"".$GLOBALS['ext_home']."\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"ext_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('ext_logo', 60, 99, 500);\" onmouseout=\"opacity('ext_logo', 100, 60, 500);\" ";
    	echo "src=\""._EXT_URL."/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    	//echo "</div>";
    	echo "</td>\n";
    	
    	echo "</tr></table></td>\n";
    	
    	// Create File / Dir
    	
    	if($allow && is_writable($GLOBALS['home_dir'].'/'.$dir)) {
    		echo "<td align=\"right\"><table><form action=\"".make_link("mkitem",$dir,NULL)."\" method=\"post\">\n<tr><td>";
    		echo "<select name=\"mktype\"><option value=\"file\">".$GLOBALS["mimes"]["file"]."</option>";
    		echo "<option value=\"dir\">".$GLOBALS["mimes"]["dir"]."</option></select>\n";
    		echo "<input name=\"mkname\" type=\"text\" size=\"15\">";
    		echo "<input type=\"submit\" value=\"".$GLOBALS["messages"]["btncreate"];
    		echo "\"></td></tr></form></table></td>\n";
    	}
    	
    	echo "</tr></table>\n";
    	*/
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<table width=\"95%\" cellpadding=\"5\" cellspacing=\"2\"><tr class=\"sectiontableheader\">\n";
    echo "<th width=\"44%\"><b>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo "</a></b></td>\n<th width=\"10%\"><b>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\" ><b>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\"><b>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></b></th></tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"4\"><hr/></td></tr><tr>\n<td>&nbsp;</td>";
    echo "<td>" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " " . parse_file_size($tot_file_size) . "</td>\n";
    echo "<td>&nbsp;</td><td>&nbsp;</td>";
    echo "</tr>\n<tr><td colspan=\"4\"><hr/></td></tr></table>\n";
}
示例#16
0
function make_list($array)
{
    $list[''] = '';
    //first value of the list will be empty
    foreach ($array as $item) {
        $list[$item] = $item;
    }
    return $list;
}
echo form_open('home_c/upload', $form_attributes);
//echo form_label('Insect:', 'insect');
echo form_fieldset('Insect');
echo form_dropdown('insect', make_list($insects), '', 'required');
echo form_fieldset_close();
echo form_fieldset('Location');
echo form_dropdown('location', make_list($locations), '', 'required');
echo form_fieldset_close();
$date = ['name' => 'date', 'required' => 'required', 'type' => 'date'];
echo form_fieldset('Date');
echo form_input($date);
echo form_fieldset_close();
$file_data = ['name' => 'file', 'required' => 'required', 'accept' => ".csv"];
echo form_fieldset('File .csv');
echo form_upload($file_data);
echo form_fieldset_close();
echo form_submit(array('id' => 'submit', 'value' => 'Upload'));
echo form_close();
//echo validation_errors();
?>

</div>
示例#17
0
 function print_fieldsets($subclass)
 {
     $obj = cobalt_load_class($subclass);
     $lst_fields = '';
     foreach ($obj->fields as $field_name => $field_struct) {
         make_list($lst_fields, $field_name);
     }
     $settings = "        \$this->fieldsets = array(" . "\r\n" . "                                 'default'=>array(" . $lst_fields . ")" . "\r\n" . "                                );";
     echo '<pre>' . $settings . '</pre>';
 }
function make_list($parent, $editable_pages)
{
    // Get objects and vars from outside this function
    global $admin, $template, $database, $TEXT, $PCTEXT, $MESSAGE;
    ?>
	<ul id="p<?php 
    echo $parent;
    ?>
" <?php 
    if ($parent != 0) {
        echo 'class="page_list"';
    }
    ?>
>
	<?php 
    // Get page list from database
    $database = new database();
    $query = "SELECT * FROM " . TABLE_PREFIX . "pages WHERE parent = '{$parent}' AND visibility != 'deleted' ORDER BY position ASC";
    $get_pages = $database->query($query);
    // Insert values into main page list
    if ($get_pages->numRows() > 0) {
        while ($page = $get_pages->fetchRow()) {
            // Get user perms
            $admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
            $admin_users = explode(',', str_replace('_', '', $page['admin_users']));
            if (is_numeric(array_search($admin->get_group_id(), $admin_groups)) or is_numeric(array_search($admin->get_user_id(), $admin_users))) {
                if ($page['visibility'] == 'deleted') {
                    if (PAGE_TRASH == 'inline') {
                        $can_modify = true;
                        $editable_pages = $editable_pages + 1;
                    } else {
                        $can_modify = false;
                    }
                } elseif ($page['visibility'] != 'deleted') {
                    $can_modify = true;
                    $editable_pages = $editable_pages + 1;
                }
            } else {
                $can_modify = false;
            }
            // Work out if we should show a plus or not
            if (PAGE_TRASH != 'inline') {
                $get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM " . TABLE_PREFIX . "pages WHERE parent = '" . $page['page_id'] . "' AND visibility!='deleted'");
            } else {
                $get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM " . TABLE_PREFIX . "pages WHERE parent = '" . $page['page_id'] . "'");
            }
            if ($get_page_subs->numRows() > 0) {
                $display_plus = true;
            } else {
                $display_plus = false;
            }
            // Work out how many pages there are for this parent
            $num_pages = $get_pages->numRows();
            ?>
			
			<li id="p<?php 
            echo $page['parent'];
            ?>
" style="padding: 2px 0px 2px 0px;">
			<table width="720" cellpadding="1" cellspacing="0" border="0" style="background-color: #F0F0F0;">
			<tr>
				<td width="20" style="padding-left: <?php 
            echo $page['level'] * 20;
            ?>
px;">
					<?php 
            if ($display_plus == true) {
                ?>
					<a href="javascript: toggle_visibility('p<?php 
                echo $page['page_id'];
                ?>
');" title="<?php 
                echo $TEXT['EXPAND'] . '/' . $TEXT['COLLAPSE'];
                ?>
">
						<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/minus_16.png" onclick="toggle_plus_minus('<?php 
                echo $page['page_id'];
                ?>
');" name="plus_minus_<?php 
                echo $page['page_id'];
                ?>
" border="0" alt="+" />
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($admin->get_permission('pages_modify') == true and $can_modify == true) {
                ?>
				<td>
					<a href="<?php 
                echo WB_URL;
                ?>
/modules/pagecloner/tool_clone.php?pagetoclone=<?php 
                echo $page['page_id'];
                ?>
" title="<?php 
                echo $PCTEXT['CLONE_PAGE'];
                ?>
"><?php 
                echo $page['page_title'];
                ?>
</a>
				</td>
				<?php 
            } else {
                ?>
				<td>
					<?php 
                echo $page['page_title'];
                ?>
				</td>
				<?php 
            }
            ?>
				<td align="left" width="375">
					<font color="#999999"><?php 
            echo $page['menu_title'];
            ?>
</font>
				</td>
				<td align="center" valign="middle" width="130">
				<?php 
            if ($page['visibility'] == 'public') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/visible_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['PUBLIC'];
                ?>
" border="0" />
				<?php 
            } elseif ($page['visibility'] == 'private') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/private_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['PRIVATE'];
                ?>
" border="0" />
				<?php 
            } elseif ($page['visibility'] == 'registered') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/keys_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['REGISTERED'];
                ?>
" border="0" />
				<?php 
            } elseif ($page['visibility'] == 'hidden') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/hidden_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['HIDDEN'];
                ?>
" border="0" />
				<?php 
            } elseif ($page['visibility'] == 'none') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/none_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['NONE'];
                ?>
" border="0" />
				<?php 
            } elseif ($page['visibility'] == 'deleted') {
                ?>
					<img src="<?php 
                echo ADMIN_URL;
                ?>
/images/deleted_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['DELETED'];
                ?>
" border="0" />
				<?php 
            }
            ?>
				</td>
			</tr>
			</table>
			</li>
							
			<?php 
            // Get subs
            $editable_pages = make_list($page['page_id'], $editable_pages);
        }
    }
    ?>
	</ul>
	<?php 
    return $editable_pages;
}
示例#19
0
function list_dir($dir)
{
    // list directory contents
    global $QUIXPATH;
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header($GLOBALS["messages"]["actdir"] . ": /" . get_rel_item("", $s_dir));
    // Javascript functions:
    include $QUIXPATH . ".include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", $dir_up, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_up.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_home.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_refresh.gif\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_search.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    if ($allow) {
        // COPY
        echo "<TD><A HREF=\"javascript:Copy();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_copy.gif\" ALT=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["copylink"] . "\"></A></TD>\n";
        // MOVE
        echo "<TD><A HREF=\"javascript:Move();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_move.gif\" ALT=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></TD>\n";
        // DELETE
        echo "<TD><A HREF=\"javascript:Delete();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_delete.gif\" ALT=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></TD>\n";
        // UPLOAD
        if (get_cfg_var("file_uploads")) {
            echo "<TD><A HREF=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_upload.gif\" ALT=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></TD>\n";
        } else {
            echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_upload_.gif\" ALT=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></TD>\n";
        }
        // ARCHIVE
        if ($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) {
            echo "<TD><A HREF=\"javascript:Archive();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
            echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_archive.gif\" ALT=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["comprlink"] . "\"></A></TD>\n";
        }
    } else {
        // COPY
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_copy_.gif\" ALT=\"" . $GLOBALS["messages"]["copylink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></TD>\n";
        // MOVE
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_move_.gif\" ALT=\"" . $GLOBALS["messages"]["movelink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></TD>\n";
        // DELETE
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_delete_.gif\" ALT=\"" . $GLOBALS["messages"]["dellink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></TD>\n";
        // UPLOAD
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_upload_.gif\" ALT=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></TD>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<TD>::</TD>";
        // ADMIN
        if ($admin) {
            echo "<TD><A HREF=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_admin.gif\" ALT=\"" . $GLOBALS["messages"]["adminlink"] . "\" TITLE=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></TD>\n";
        }
        // LOGOUT
        echo "<TD><A HREF=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_logout.gif\" ALT=\"" . $GLOBALS["messages"]["logoutlink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></A></TD>\n";
    }
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if ($allow) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<SELECT name=\"mktype\"><option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $free = parse_file_size(disk_free_space(get_abs_dir($dir)));
    } elseif (function_exists("diskfreespace")) {
        $free = parse_file_size(diskfreespace(get_abs_dir($dir)));
    } else {
        $free = "?";
    }
    // echo "Total: ".parse_file_size(disk_total_space(get_abs_dir($dir))).", ";
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    for ($i = 0; $i < 4; ++$i) {
        echo "<TD class=\"header\"></TD>";
    }
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}
示例#20
0
 $show_edit_link = check_link($edit_link);
 $show_delete_link = check_link($delete_link);
 while ($row = $result->fetch_assoc()) {
     $separator_index = 0;
     if ($a % 2 == 0) {
         $class = 'listRowEven';
     } else {
         $class = 'listRowOdd';
     }
     $a++;
     extract($row);
     $pkey_string = '';
     if (is_array($arr_pkey_name)) {
         foreach ($arr_pkey_name as $pkey_name) {
             $enc_pkey = urlencode(${$pkey_name});
             make_list($pkey_string, $pkey_name . '=' . $enc_pkey, '&amp;', FALSE);
         }
     } else {
         cobalt_error_handler('Could not create primary key string.', 'arr_pkey_name is not an array. arr_pkey_name must be an array that contains at least one primary key field name.');
     }
     echo '<tr class="' . $class . '"><td class="oper_col" align="center">';
     if ($view_page != '') {
         echo "<a href=\"{$view_page}?filter_field_used={$enc_filter_field}&amp;filter_used={$enc_filter}&amp;filter_sort_asc={$enc_filter_sort_asc}&amp;filter_sort_desc={$enc_filter_sort_desc}&amp;page_from={$current_page}&amp;{$pkey_string}\"><img src=\"/" . BASE_DIRECTORY . "/images/" . $_SESSION['icon_set'] . "/view.png\" alt=\"View\" title=\"View\"></a>";
     }
     if ($edit_page != '') {
         if ($show_edit_link) {
             echo "&nbsp;&nbsp;<a href=\"{$edit_page}?filter_field_used={$enc_filter_field}&amp;filter_used={$enc_filter}&amp;filter_sort_asc={$enc_filter_sort_asc}&amp;filter_sort_desc={$enc_filter_sort_desc}&amp;page_from={$current_page}&amp;{$pkey_string}\"><img src=\"/" . BASE_DIRECTORY . "/images/" . $_SESSION['icon_set'] . "/edit.png\" alt=\"Edit\" title=\"Edit\"></a>";
         }
     }
     if ($delete_page != '') {
         if ($show_delete_link) {
示例#21
0
 function get_role_users($role_id)
 {
     $this->set_query_type('SELECT');
     $this->set_fields("username");
     $this->set_where("role_id = ?");
     $bind_params = array('i', $role_id);
     $this->stmt_prepare($bind_params);
     $this->stmt_execute()->stmt_fetch()->stmt->close();
     $this->lst_user = '';
     if (isset($this->dump['username']) && is_array($this->dump['username'])) {
         foreach ($this->dump['username'] as $user) {
             make_list($this->lst_user, $user);
         }
     }
     return $this;
 }
示例#22
0
function make_list($parent, $editable_pages)
{
    // Get objects and vars from outside this function
    global $admin, $template, $database, $TEXT, $MESSAGE;
    ?>
    <ul id="p<?php 
    echo $parent;
    ?>
" <?php 
    if ($parent != 0) {
        echo 'class="page_list"';
    }
    ?>
>
    <?php 
    // Get page list from database
    // $database = new database();
    $query = "SELECT * FROM " . TABLE_PREFIX . "pages WHERE parent = '{$parent}' AND visibility = 'deleted' ORDER BY position ASC";
    $get_pages = $database->query($query);
    // Insert values into main page list
    if ($get_pages->numRows() > 0) {
        while ($page = $get_pages->fetchRow()) {
            // Get user perms
            $admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
            $admin_users = explode(',', str_replace('_', '', $page['admin_users']));
            $in_old_group = FALSE;
            foreach ($admin->get_groups_id() as $cur_gid) {
                if (in_array($cur_gid, $old_admin_groups)) {
                    $in_old_group = TRUE;
                }
            }
            if (!$in_old_group or is_numeric(array_search($admin->get_user_id(), $admin_users))) {
                if ($page['visibility'] == 'deleted') {
                    $can_modify = true;
                    $editable_pages = $editable_pages + 1;
                } else {
                    $can_modify = false;
                }
            } else {
                $can_modify = false;
            }
            // Work out if we should show a plus or not
            $get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM " . TABLE_PREFIX . "pages WHERE parent = '" . $page['page_id'] . "'");
            if ($get_page_subs->numRows() > 0) {
                $display_plus = true;
            } else {
                $display_plus = false;
            }
            // Work out how many pages there are for this parent
            $num_pages = $get_pages->numRows();
            ?>
            
            <li id="p<?php 
            echo $page['parent'];
            ?>
">
            <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td width="20" style="padding-left: <?php 
            echo $page['level'] * 20;
            ?>
px;">
                    <?php 
            if ($display_plus == true) {
                ?>
                    <a href="javascript: toggle_visibility('p<?php 
                echo $page['page_id'];
                ?>
');" title="<?php 
                echo $TEXT['EXPAND'] . '/' . $TEXT['COLLAPSE'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/plus_16.png" onclick="toggle_plus_minus('<?php 
                echo $page['page_id'];
                ?>
');" name="plus_minus_<?php 
                echo $page['page_id'];
                ?>
" border="0" alt="+" />
                    </a>
                    <?php 
            }
            ?>
                </td>
                <?php 
            if ($admin->get_permission('pages_modify') == true and $can_modify == true and $page['visibility'] != 'heading') {
                ?>
                <td>
                    <a href="<?php 
                echo ADMIN_URL;
                ?>
/pages/modify.php?page_id=<?php 
                echo $page['page_id'];
                ?>
" title="<?php 
                echo $TEXT['MODIFY'];
                ?>
"><?php 
                echo $page['page_title'];
                ?>
</a>
                </td>
                <?php 
            } else {
                ?>
                <td>
                    <?php 
                if ($page['visibility'] != 'heading') {
                    echo $page['page_title'];
                } else {
                    echo '<b>' . $page['page_title'] . '</b>';
                }
                ?>
                </td>
                <?php 
            }
            ?>
                <td align="left" width="232">
                    <font color="#999999"><?php 
            echo $page['menu_title'];
            ?>
</font>
                </td>
                <td align="right" valign="middle" width="30" class="icon_col">
                <?php 
            if ($page['visibility'] == 'public') {
                ?>
                    <img src="<?php 
                echo THEME_URL;
                ?>
/images/visible_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['PUBLIC'];
                ?>
" border="0" />
                <?php 
            } elseif ($page['visibility'] == 'private') {
                ?>
                    <img src="<?php 
                echo THEME_URL;
                ?>
/images/private_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['PRIVATE'];
                ?>
" border="0" />
                <?php 
            } elseif ($page['visibility'] == 'registered') {
                ?>
                    <img src="<?php 
                echo THEME_URL;
                ?>
/images/keys_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['REGISTERED'];
                ?>
" border="0" />
                <?php 
            } elseif ($page['visibility'] == 'none') {
                ?>
                    <img src="<?php 
                echo THEME_URL;
                ?>
/images/hidden_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['NONE'];
                ?>
" border="0" />
                <?php 
            } elseif ($page['visibility'] == 'deleted') {
                ?>
                    <img src="<?php 
                echo THEME_URL;
                ?>
/images/deleted_16.png" alt="<?php 
                echo $TEXT['VISIBILITY'];
                ?>
: <?php 
                echo $TEXT['DELETED'];
                ?>
" border="0" />
                <?php 
            }
            ?>
                </td>
                <td width="20">
                    <?php 
            if ($page['visibility'] != 'deleted') {
                ?>
                        <?php 
                if ($admin->get_permission('pages_settings') == true and $can_modify == true) {
                    ?>
                        <a href="<?php 
                    echo ADMIN_URL;
                    ?>
/pages/settings.php?page_id=<?php 
                    echo $page['page_id'];
                    ?>
" title="<?php 
                    echo $TEXT['SETTINGS'];
                    ?>
">
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/modify_16.png" border="0" alt="<?php 
                    echo $TEXT['SETTINGS'];
                    ?>
" />
                        </a>
                        <?php 
                }
                ?>
                    <?php 
            } else {
                ?>
                        <a href="<?php 
                echo ADMIN_URL;
                ?>
/pages/restore.php?page_id=<?php 
                echo $page['page_id'];
                ?>
" title="<?php 
                echo $TEXT['RESTORE'];
                ?>
">
                            <img src="<?php 
                echo THEME_URL;
                ?>
/images/restore_16.png" border="0" alt="<?php 
                echo $TEXT['RESTORE'];
                ?>
" />
                        </a>
                    <?php 
            }
            ?>
                </td>
                <td width="20">
                <?php 
            if ($page['position'] != 1) {
                ?>
                    <?php 
                if ($page['visibility'] != 'deleted') {
                    ?>
                        <?php 
                    if ($admin->get_permission('pages_settings') == true and $can_modify == true) {
                        ?>
                        <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/move_up.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $TEXT['MOVE_UP'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL;
                        ?>
/images/up_16.png" border="0" alt="^" />
                        </a>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                </td>
                <td width="20">
                <?php 
            if ($page['position'] != $num_pages) {
                ?>
                    <?php 
                if ($page['visibility'] != 'deleted') {
                    ?>
                        <?php 
                    if ($admin->get_permission('pages_settings') == true and $can_modify == true) {
                        ?>
                        <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/move_down.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $TEXT['MOVE_DOWN'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL;
                        ?>
/images/down_16.png" border="0" alt="v" />
                        </a>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                </td>
                <td width="20">
                    <?php 
            if ($admin->get_permission('pages_delete') == true and $can_modify == true) {
                ?>
                    <a href="javascript: confirm_link('<?php 
                echo $MESSAGE['PAGES']['DELETE_CONFIRM'];
                ?>
?', '<?php 
                echo ADMIN_URL;
                ?>
/pages/delete.php?page_id=<?php 
                echo $page['page_id'];
                ?>
');" title="<?php 
                echo $TEXT['DELETE'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/delete_16.png" border="0" alt="X" />
                    </a>
                    <?php 
            }
            ?>
                </td>
            </tr>
            </table>
            </li>
                            
            <?php 
            // Get subs
            make_list($page['page_id'], $editable_pages);
        }
    }
    ?>
    </ul>
    <?php 
    return $editable_pages;
}
示例#23
0
 function export_to_csv()
 {
     $csv_contents = '';
     $result = $this->connect_db()->execute_query('SELECT * FROM ' . $this->tables, LOG_SELECT_QUERIES)->result;
     while ($data = $result->fetch_assoc()) {
         extract($data);
         $new_csv_line = '';
         foreach ($this->fields as $field_name => $field_data) {
             ${$field_name} = str_replace('"', "''", ${$field_name});
             make_list($new_csv_line, ${$field_name}, ',', TRUE, '"');
         }
         $csv_contents .= $new_csv_line . "\r\n";
     }
     return $csv_contents;
 }
function directory_list($atts)
{
    $attrs = shortcode_atts(array('org' => get_this_dept()), $atts);
    $json_address = "http://humanities.byu.edu/wp-json/posts?type=person&filter[posts_per_page]=-1&filter[taxonomy]=persondepartments&filter[term]=" . $attrs[org];
    //$json_address = "http://humanities.byu.edu/wp-json/posts?type=person&filter[posts_per_page]=-1";
    //$persons = file_get_contents($json_address);
    $personposts = json_decode(file_get_contents($json_address));
    return make_list($personposts, $attrs['org']);
}
function make_list($parent = 0, $editable_pages = 0)
{
    // Get objects and vars from outside this function
    global $admin, $template, $database, $TEXT, $MESSAGE, $HEADING, $par;
    print set_node($parent, $par);
    // Get page list from database
    $sql = 'SELECT * FROM `' . TABLE_PREFIX . 'pages` WHERE `parent` = ' . $parent . ' ';
    $sql .= PAGE_TRASH != 'inline' ? 'AND `visibility` != \'deleted\' ' : ' ';
    $sql .= 'ORDER BY `position` ASC';
    $get_pages = $database->query($sql);
    // Insert values into main page list
    if ($get_pages->numRows() > 0) {
        while ($page = $get_pages->fetchRow(MYSQLI_ASSOC)) {
            // Get user perms
            $admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
            $admin_users = explode(',', str_replace('_', '', $page['admin_users']));
            $in_group = FALSE;
            foreach ($admin->get_groups_id() as $cur_gid) {
                if (in_array($cur_gid, $admin_groups)) {
                    $in_group = TRUE;
                }
            }
            if ($in_group || is_numeric(array_search($admin->get_user_id(), $admin_users))) {
                if ($page['visibility'] == 'deleted') {
                    if (PAGE_TRASH == 'inline') {
                        $can_modify = true;
                        $editable_pages = $editable_pages + 1;
                    } else {
                        $can_modify = false;
                    }
                } elseif ($page['visibility'] != 'deleted') {
                    $can_modify = true;
                    $editable_pages = $editable_pages + 1;
                }
            } else {
                if ($page['visibility'] == 'private') {
                    continue;
                } else {
                    $can_modify = false;
                }
            }
            // Work out if we should show a plus or not
            $sql = 'SELECT `page_id`,`admin_groups`,`admin_users` FROM `' . TABLE_PREFIX . 'pages` WHERE `parent` = ' . $page['page_id'] . ' ';
            $sql .= PAGE_TRASH != 'inline' ? 'AND `visibility` != \'deleted\' ' : ' ';
            // $sql .= ' ORDER BY `position` ASC';
            $get_page_subs = $database->query($sql);
            $num_subs = $get_page_subs->numRows();
            $par['num_subs'] = $num_subs;
            /*
                        if(PAGE_TRASH != 'inline')
                        {
                            $get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."' AND visibility!='deleted'");
                        } else {
                            $get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."'");
                        }
            print '<pre  class="mod-pre rounded">function <span>'.__FUNCTION__.'( '.''.' );</span>  filename: <span>'.basename(__FILE__).'</span>  line: '.__LINE__.' -> <br />'; 
            print_r( $page ); print '</pre>'; flush (); //  ob_flush();;sleep(10); die(); 
            */
            if ($get_page_subs->numRows() > 0) {
                $display_plus = true;
            } else {
                $display_plus = false;
            }
            // Work out how many pages there are for this parent
            $num_pages = $get_pages->numRows();
            ?>
            <li class="p<?php 
            echo $page['parent'];
            ?>
">
            <table title="<?php 
            echo $TEXT['EXPAND'] . '/' . $TEXT['COLLAPSE'];
            ?>
" class="pages_view" >
            <tr>
                <td class="level_<?php 
            echo $page['level'];
            ?>
" style="width: 0.99525em; padding-left: <?php 
            if ($page['level'] > 0) {
                echo $page['level'] * 20;
            } else {
                echo '0';
            }
            ?>
px;">
                    <?php 
            if ($display_plus == true) {
                ?>
                    <a href="javascript:toggle_visibility('p<?php 
                echo $page['page_id'];
                ?>
');" title="<?php 
                echo $TEXT['EXPAND'] . '/' . $TEXT['COLLAPSE'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/<?php 
                if (isset($_COOKIE['p' . $page['page_id']]) && $_COOKIE['p' . $page['page_id']] == '1') {
                    echo 'minus';
                } else {
                    echo 'plus';
                }
                ?>
_16.png" onclick="toggle_plus_minus('<?php 
                echo $page['page_id'];
                ?>
');" name="plus_minus_<?php 
                echo $page['page_id'];
                ?>
" alt="+" />
                    </a>
                    <?php 
            } else {
                ?>
                    <img  src="<?php 
                echo THEME_URL;
                ?>
/images/blank.gif" width="16" />
                    <?php 
            }
            ?>
                </td>
                <?php 
            if ($admin->get_permission('pages_modify') == true && $can_modify == true) {
                ?>
                <td class="list_menu_title">
                    <a href="<?php 
                echo ADMIN_URL;
                ?>
/pages/modify.php?page_id=<?php 
                echo $page['page_id'];
                ?>
" title="<?php 
                echo $TEXT['MODIFY'];
                ?>
">
                        <?php 
                if ($page['visibility'] == 'public') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/visible_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['PUBLIC'];
                    ?>
" class="page_list_rights" />
                        <?php 
                } elseif ($page['visibility'] == 'private') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/private_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['PRIVATE'];
                    ?>
" class="page_list_rights" />
                        <?php 
                } elseif ($page['visibility'] == 'registered') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/keys_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['REGISTERED'];
                    ?>
" class="page_list_rights" />
                        <?php 
                } elseif ($page['visibility'] == 'hidden') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/hidden_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['HIDDEN'];
                    ?>
" class="page_list_rights" />
                        <?php 
                } elseif ($page['visibility'] == 'none') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/none_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['NONE'];
                    ?>
" class="page_list_rights" />
                        <?php 
                } elseif ($page['visibility'] == 'deleted') {
                    ?>
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/deleted_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['DELETED'];
                    ?>
" class="page_list_rights" />
                        <?php 
                }
                echo '<span class="modify_link">' . $page['menu_title'] . '</span>';
                ?>
                    </a>
                </td>
                <?php 
            } else {
                ?>
                <td class="list_menu_title">
                    <?php 
                if ($page['visibility'] == 'public') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/visible_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['PUBLIC'];
                    ?>
" class="page_list_rights" />
                    <?php 
                } elseif ($page['visibility'] == 'private') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/private_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['PRIVATE'];
                    ?>
" class="page_list_rights" />
                    <?php 
                } elseif ($page['visibility'] == 'registered') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/keys_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['REGISTERED'];
                    ?>
" class="page_list_rights" />
                    <?php 
                } elseif ($page['visibility'] == 'hidden') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/hidden_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['HIDDEN'];
                    ?>
" class="page_list_rights" />
                    <?php 
                } elseif ($page['visibility'] == 'none') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/none_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['NONE'];
                    ?>
" class="page_list_rights" />
                    <?php 
                } elseif ($page['visibility'] == 'deleted') {
                    ?>
                        <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/deleted_16.png" alt="<?php 
                    echo $TEXT['VISIBILITY'];
                    ?>
: <?php 
                    echo $TEXT['DELETED'];
                    ?>
" class="page_list_rights" />
                    <?php 
                }
                echo $page['menu_title'];
                ?>
                </td>
                <?php 
            }
            ?>
                <td class="list_page_title">
                    <?php 
            echo $page['page_title'];
            ?>
                </td>
                <td class="list_page_id">
                    <?php 
            echo $page['page_id'];
            ?>
                </td>

                <td class="list_actions">
                    <?php 
            if ($page['visibility'] != 'deleted' && $page['visibility'] != 'none') {
                ?>
                    <a href="<?php 
                echo $admin->page_link($page['link']);
                ?>
" target="_blank" title="<?php 
                echo $TEXT['VIEW'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/view_16.png" alt="<?php 
                echo $TEXT['VIEW'];
                ?>
" />
                    </a>
                    <?php 
            }
            ?>
                </td>
                <td class="list_actions">
                    <?php 
            if ($page['visibility'] != 'deleted') {
                ?>
                        <?php 
                if ($admin->get_permission('pages_settings') == true && $can_modify == true) {
                    ?>
                        <a href="<?php 
                    echo ADMIN_URL;
                    ?>
/pages/settings.php?page_id=<?php 
                    echo $page['page_id'];
                    ?>
" title="<?php 
                    echo $TEXT['SETTINGS'];
                    ?>
">
                            <img src="<?php 
                    echo THEME_URL;
                    ?>
/images/modify_16.png" alt="<?php 
                    echo $TEXT['SETTINGS'];
                    ?>
" />
                        </a>
                        <?php 
                }
                ?>
                    <?php 
            } else {
                ?>
                        <a href="<?php 
                echo ADMIN_URL;
                ?>
/pages/restore.php?page_id=<?php 
                echo $page['page_id'];
                ?>
" title="<?php 
                echo $TEXT['RESTORE'];
                ?>
">
                            <img src="<?php 
                echo THEME_URL;
                ?>
/images/restore_16.png" alt="<?php 
                echo $TEXT['RESTORE'];
                ?>
" />
                        </a>
                    <?php 
            }
            ?>
                </td>
                <!-- MANAGE SECTIONS AND DATES BUTTONS -->
                <td class="list_actions">
                <?php 
            // Work-out if we should show the "manage dates" link
            if (MANAGE_SECTIONS == 'enabled' && $admin->get_permission('pages_modify') == true && $can_modify == true) {
                $sql = 'SELECT `publ_start`, `publ_end` FROM `' . TABLE_PREFIX . 'sections` ';
                $sql .= 'WHERE `page_id` = ' . $page['page_id'] . ' AND `module` != \'menu_link\' ';
                // $query_sections = $database->query("SELECT publ_start, publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '{$page['page_id']}' AND module != 'menu_link'");
                if ($query_sections = $database->query($sql)) {
                    $mdate_display = false;
                    while ($mdate_res = $query_sections->fetchRow(MYSQLI_ASSOC)) {
                        if ($mdate_res['publ_start'] != '0' || $mdate_res['publ_end'] != '0') {
                            $mdate_display = true;
                            break;
                        }
                    }
                    if ($mdate_display == 1) {
                        $file = $admin->page_is_active($page) ? "clock_16.png" : "clock_red_16.png";
                        ?>
                            <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/sections.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $HEADING['MANAGE_SECTIONS'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL . "/images/{$file}";
                        ?>
" alt="<?php 
                        echo $HEADING['MANAGE_SECTIONS'];
                        ?>
" />
                            </a>
                        <?php 
                    } else {
                        ?>
                            <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/sections.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $HEADING['MANAGE_SECTIONS'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL;
                        ?>
/images/noclock_16.png" alt="<?php 
                        echo $HEADING['MANAGE_SECTIONS'];
                        ?>
" /></a>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                </td>
                <td class="list_actions">
                <?php 
            if ($page['position'] != 1) {
                ?>
                    <?php 
                if ($page['visibility'] != 'deleted') {
                    ?>
                        <?php 
                    if ($admin->get_permission('pages_settings') == true && $can_modify == true) {
                        ?>
                        <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/move_up.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $TEXT['MOVE_UP'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL;
                        ?>
/images/up_16.png" alt="<?php 
                        echo $TEXT['MOVE_UP'];
                        ?>
" />
                        </a>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                </td>
                <td class="list_actions">
                <?php 
            if ($page['position'] != $num_pages) {
                ?>
                    <?php 
                if ($page['visibility'] != 'deleted') {
                    ?>
                        <?php 
                    if ($admin->get_permission('pages_settings') == true && $can_modify == true) {
                        ?>
                        <a href="<?php 
                        echo ADMIN_URL;
                        ?>
/pages/move_down.php?page_id=<?php 
                        echo $page['page_id'];
                        ?>
" title="<?php 
                        echo $TEXT['MOVE_DOWN'];
                        ?>
">
                            <img src="<?php 
                        echo THEME_URL;
                        ?>
/images/down_16.png" alt="<?php 
                        echo $TEXT['MOVE_DOWN'];
                        ?>
" />
                        </a>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                </td>
                <td class="list_actions">
                    <?php 
            if ($admin->get_permission('pages_delete') == true && $can_modify == true) {
                // add IdKey
                ?>
                    <a href="javascript:confirm_link('<?php 
                echo $MESSAGE['PAGES_DELETE_CONFIRM'];
                ?>
?','<?php 
                echo ADMIN_URL;
                ?>
/pages/delete.php?page_id=<?php 
                echo $admin->getIDKEY($page['page_id']);
                ?>
');" title="<?php 
                echo $TEXT['DELETE'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/delete_16.png" alt="<?php 
                echo $TEXT['DELETE'];
                ?>
" />
                    </a>
                    <?php 
            }
            ?>
                </td>
                <?php 
            // eggsurplus: Add action to add a page as a child
            ?>
                <td class="list_actions">
                    <?php 
            if ($admin->get_permission('pages_add') == (true && $can_modify == true) && $page['visibility'] != 'deleted') {
                ?>
                    <a href="javascript:add_child_page('<?php 
                echo $page['page_id'];
                ?>
');" title="<?php 
                echo $HEADING['ADD_CHILD_PAGE'];
                ?>
">
                        <img src="<?php 
                echo THEME_URL;
                ?>
/images/siteadd.png" name="addpage_<?php 
                echo $page['page_id'];
                ?>
" alt="Add Child Page" />
                    </a>
                    <?php 
            }
            ?>
                </td>
                <?php 
            // end [IC] jeggers 2009/10/14: Add action to add a page as a child
            ?>

            </tr>
            </table>
            <?php 
            if ($page['parent'] == 0) {
                $page_tmp_id = $page['page_id'];
            }
            // Get subs
            $editable_pages = make_list($page['page_id'], $editable_pages);
            print '</li>' . "\n";
        }
    }
    $output = $par['num_subs'] ? '</ul>' . "\n" : '';
    $par['num_subs'] = empty($output) ? 1 : $par['num_subs'];
    print $output;
    return $editable_pages;
}
示例#26
0
    $cell_value = '';
    if ($total === '') {
        //triple equal needed above instead of double equal so that "0" does not get evaluated as the same as the empty string.
        //Do nothing if no aggregator total
    } else {
        $format = $arr_column_formats[$index];
        $decimal_places = substr($format, 13);
        $cell_value = number_format($total, $decimal_places);
    }
    //Screen output of cell value (aggregators / final row)
    echo '<th align="' . $alignment . '">';
    echo $cell_value;
    echo '</th>';
    //Same data, but for CSV
    $csv_field = str_replace('"', "''", $cell_value);
    make_list($new_csv_line, $csv_field, ',', TRUE, '"');
    //Same data, but for PDF
    $pdf_html_table .= <<<EOD
    <th align="{$alignment}"> {$cell_value} </th>
EOD;
}
//Screen output, end of row and end of table
echo '</tr>';
echo '</table>';
$html->draw_footer_printable();
//Same data, but for CSV (newline)
$csv_contents .= $new_csv_line . "\r\n";
//Same data, but for PDF
$pdf_html_table .= <<<EOD
</tr>
</table>
示例#27
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    ?>
	<script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
/includes/js/overlib_mini.js"></script>
	<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
	<?php 
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>/";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>/";
        }
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . $dir_links);
    // Javascript functions:
    include _QUIXPLORER_PATH . "/include/javascript.php";
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "yes";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    // PARENT DIR
    echo "<td>";
    if ($dir != "") {
        echo "<a href=\"" . make_link("list", $dir_up, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_up.png\" ";
        echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></a>";
    }
    echo "</td>\n";
    // HOME DIR
    echo "<td><a href=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_home.gif\" ";
    echo "alt=\"" . $GLOBALS["messages"]["homelink"] . "\" title=\"" . $GLOBALS["messages"]["homelink"] . "\"></a></td>\n";
    // RELOAD
    echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_refresh.gif\" alt=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" title=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></td>\n";
    // SEARCH
    if (!jx_isFTPMode()) {
        echo "<td><a href=\"" . make_link("search", $dir, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_search.gif\" ";
        echo "alt=\"" . $GLOBALS["messages"]["searchlink"] . "\" title=\"" . $GLOBALS["messages"]["searchlink"];
        echo "\"></a></td>\n";
    }
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    // Joomla Sysinfo
    echo "<td><a href=\"" . make_link("sysinfo", $dir, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/systeminfo.gif\" ";
    echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" . $GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    if ($allow) {
        // COPY
        echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_copy.gif\" alt=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" title=\"" . $GLOBALS["messages"]["copylink"] . "\"></a></td>\n";
        // MOVE
        echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_move.gif\" alt=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" title=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></td>\n";
        // DELETE
        echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_delete.gif\" alt=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" title=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></td>\n";
        // CHMOD
        echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
        // UPLOAD
        if (ini_get("file_uploads")) {
            echo "<td><a href=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></td>\n";
        } else {
            echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></td>\n";
        }
        // ARCHIVE
        if (($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) && !jx_isFTPMode()) {
            echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
            echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_archive.gif\" alt=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["comprlink"] . "\"></a></td>\n";
        }
    } else {
        // COPY
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_copy_.gif\" alt=\"" . $GLOBALS["messages"]["copylink"] . "\" title=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></td>\n";
        // MOVE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_move_.gif\" alt=\"" . $GLOBALS["messages"]["movelink"] . "\" title=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></td>\n";
        // DELETE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_delete_.gif\" alt=\"" . $GLOBALS["messages"]["dellink"] . "\" title=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></td>\n";
        // UPLOAD
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></td>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<td>::</td>";
        // ADMIN
        if ($admin) {
            echo "<td><a href=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_admin.gif\" alt=\"" . $GLOBALS["messages"]["adminlink"] . "\" title=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></td>\n";
        }
        // LOGOUT
        echo "<td><a href=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_logout.gif\" alt=\"" . $GLOBALS["messages"]["logoutlink"] . "\" title=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></a></td>\n";
    }
    // Logo
    echo "<td style=\"padding-left:10px;\">";
    //echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    echo "<a href=\"" . $GLOBALS['jx_home'] . "\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"jx_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('jx_logo', 60, 99, 500);\" onmouseout=\"opacity('jx_logo', 100, 60, 500);\" ";
    echo "src=\"" . _QUIXPLORER_URL . "/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    //echo "</div>";
    echo "</td>\n";
    echo "</tr></table></td>\n";
    // Create File / Dir
    if ($allow && @$GLOBALS['jx_File']->is_writable(get_abs_dir($dir))) {
        echo "<td align=\"right\">\n\t\t\t\t<form action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\" name=\"mkitemform\">\n\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<select name=\"mktype\" onchange=\"checkMkitemForm(this.options[this.selectedIndex])\">\n\t\t\t\t\t\t<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>\n\t\t\t\t\t\t<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option>";
        if (!jx_isFTPMode() && !$GLOBALS['isWindows']) {
            echo "\t\t\t<option value=\"symlink\">" . $GLOBALS["mimes"]["symlink"] . "</option>\n";
        }
        echo "\t\t</select>\n\t\t\t\t\t<input name=\"symlink_target\" type=\"hidden\" size=\"25\" title=\"{$GLOBALS['messages']['symlink_target']}\" value=\"{$GLOBALS['mosConfig_absolute_path']}\" />\n\t\t\t\t\t<input name=\"mkname\" type=\"text\" size=\"15\" title=\"{$GLOBALS['messages']['nameheader']}\" />\n\t\t\t\t\t<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"] . "\" />\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t<script type=\"text/javascript\">function checkMkitemForm( el ) { if( el.value =='symlink' ) document.mkitemform.symlink_target.type='text'; else document.mkitemform.symlink_target.type='hidden';} </script>\n\t\t\t\t</form>\n\t\t\t  </td>\n";
    } else {
        echo "<td align=\"right\">\n\t\t\t\t<table><tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr></table>\n\t\t\t </td>";
    }
    echo "</tr></table>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n";
    if (extension_loaded("posix")) {
        $owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . '&nbsp;';
        if (jx_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid'])));
        // new [mic]
        $owner_info .= "</th>\n";
        $colspan = 8;
    } else {
        $owner_info = "";
        $colspan = 7;
    }
    // Table Header
    echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo '</a>';
    echo "</th>\n\t<th width=\"10%\" class=\"title\">";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n";
    echo "</th>";
    echo $owner_info;
    echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>";
    echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n";
    echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n";
    for ($i = 0; $i < $colspan - 3; ++$i) {
        echo "<td class=\"title\"></td>";
    }
    echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>";
    ?>
<script type="text/javascript"><!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
	opacity('jx_logo', 10, 60, 2000);
// --></script>

<?php 
}
示例#28
0
/**
MAIN FUNCTION
*/
function list_dir($dir)
{
    _debug("list_dir: displaying directory {$dir}");
    if (!get_show_item($dir, NULL)) {
        show_error($GLOBALS["error_msg"]["accessdir"] . " : '{$dir}'");
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . _breadcrumbs($dir));
    // show_header($GLOBALS["messages"]["actdir"].": /".get_rel_item("",$s_dir));
    // Javascript functions:
    include "./_include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"_img/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", path_up($dir), NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["up"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["home"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["reload"] . "\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["search"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    // print the download button
    _print_link("download_selected", permissions_grant($dir, NULL, "read"), $dir, NULL);
    // print the edit buttons
    _print_edit_buttons($dir);
    // ADMIN & LOGOUT
    if (login_is_user_logged_in()) {
        echo "<TD>::</TD>";
        // ADMIN
        _print_link("admin", permissions_grant(NULL, NULL, "admin") || permissions_grant(NULL, NULL, "password"), $dir, NULL);
        // LOGOUT
        _print_link("logout", true, $dir, NULL);
    }
    echo "<TD>::</TD>";
    //Languages
    foreach ($GLOBALS["langs"] as $langs) {
        echo "<TD><A HREF=\"" . make_link("list", $dir, NULL, NULL, NULL, $langs[0]) . "\">";
        if (!file_exists($langs[1])) {
            echo "&nbsp;{$langs['0']} ";
        } else {
            echo "<IMG border=\"0\" width=\"16\" height=\"11\" ";
            echo "align=\"ABSMIDDLE\" src=\"" . $langs[1] . "\" ALT=\"" . $langs[0];
            echo "\" TITLE=\"" . $langs[2] . "\"/></A></TD>\n";
        }
        //list($slang,$img,$ext,$type)	= $mime;
        /*if(@eregi($ext,$item)) {
        			$mime_type	= $desc;
        			$image		= $img;
        			if($query=="img"){ return $image;}
        			else if($query=="ext"){ return $type;}
        			else return $mime_type;
        		*/
    }
    //
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if (permissions_grant($dir, NULL, "create")) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["add"] . "\" />";
        echo "<SELECT name=\"mktype\">";
        echo "<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list));
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    $free = parse_file_size(diskfreespace("/"));
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    echo "<TD class=\"header\" colspan=4></TD>";
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}
示例#29
0
function make_archive_list($basename, $archives_list = array(), $download_server = IONCUBE_DOWNLOADS_SERVER)
{
    if (empty($archives_list)) {
        $archives_list = array('tar.gz', 'tar.bz2', 'zip', 'ipf.zip');
    }
    foreach ($archives_list as $a) {
        $link_text = $a == 'ipf.zip' ? 'MS Windows installer' : $a;
        $ext_sep = $a == 'ipf.zip' ? '_' : '.';
        $archive_list[] = "<a href=\"{$download_server}/{$basename}{$ext_sep}{$a}\">{$link_text}</a>";
    }
    return make_list($archive_list, "ul");
}
if ($filter_sort_asc != '' || $filter_sort_desc != '') {
    $filter_string = '';
    $sort_order = '';
    if ($filter_sort_asc != '') {
        $key = $filter_sort_asc;
        $sort_order = 'ASC';
    } else {
        $key = $filter_sort_desc;
        $sort_order = 'DESC';
    }
    if (is_array($arr_fields[$key])) {
        foreach ($arr_fields[$key] as $filter_sort_field) {
            make_list($filter_string, $filter_sort_field . ' ' . $sort_order, ', ', FALSE);
        }
    } elseif (isset($arr_fields[$key])) {
        make_list($filter_string, $arr_fields[$key] . ' ' . $sort_order, ', ', FALSE);
    } else {
        //invalid field key, ignore
    }
    if ($filter_string != '') {
        $data_con->set_order($filter_string);
    }
} else {
    if (isset($default_sort_order)) {
        $data_con->set_order($default_sort_order);
    }
}
$data_con->make_query();
$total_records = $data_con->num_rows;
require_once 'paged_result_class.php';
$pager = new paged_result($total_records, $results_per_page);