• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_rel_item函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_rel_item函数的典型用法代码示例。如果您正苦于以下问题:PHP get_rel_item函数的具体用法?PHP get_rel_item怎么用?PHP get_rel_item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_rel_item函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: dir_print

function dir_print($dir_list, $new_dir)
{
    // print list of directories
    // this list is used to copy/move items to a specific location
    // Link to Parent Directory
    $dir_up = dirname($new_dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    echo "<tr><td><a href=\"javascript:NewDir('" . $dir_up;
    echo "');\"><img border=\"0\" width=\"16\" height=\"16\"";
    echo " align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/arrow_turn_left.png\" alt=\"\">&nbsp;..</a></td></tr>\n";
    // Print List Of Target Directories
    if (!is_array($dir_list)) {
        return;
    }
    while (list($new_item, $info) = each($dir_list)) {
        if (is_array($info)) {
            $new_item = $info['name'];
        }
        $s_item = $new_item;
        if (strlen($s_item) > 40) {
            $s_item = substr($s_item, 0, 37) . "...";
        }
        echo "<tr><td><a href=\"javascript:NewDir('" . get_rel_item($new_dir, $new_item) . "');\"><img border=\"0\" width=\"16\" height=\"16\" align=\"absmiddle\" " . "src=\"" . _QUIXPLORER_URL . "/images/folder.png\" alt=\"\">&nbsp;" . $s_item . "</a></td></tr>\n";
    }
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:27,代码来源:fun_copy_move.php


示例2: edit_file

function edit_file($dir, $item)
{
    if (!permissions_grant($dir, $item, "change")) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (!get_is_file($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
    }
    if (!get_show_item($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
    }
    $fname = get_abs_item($dir, $item);
    if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
        // Save / Save As
        $item = basename(stripslashes($GLOBALS['__POST']["fname"]));
        $fname2 = get_abs_item($dir, $item);
        if (!isset($item) || $item == "") {
            show_error($GLOBALS["error_msg"]["miscnoname"]);
        }
        if ($fname != $fname2 && @file_exists($fname2)) {
            show_error($item . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
        }
        savefile($fname2);
        $fname = $fname2;
    }
    // open file
    $fp = @fopen($fname, "r");
    if ($fp === false) {
        show_error($item . ": " . $GLOBALS["error_msg"]["openfile"]);
    }
    // header
    $s_item = get_rel_item($dir, $item);
    if (strlen($s_item) > 50) {
        $s_item = "..." . substr($s_item, -47);
    }
    show_header($GLOBALS["messages"]["actedit"] . ": /" . $s_item);
    // Wordwrap (works only in IE)
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	function chwrap() {
		if(document.editfrm.wrap.checked) {
			document.editfrm.code.wrap="soft";
		} else {
			document.editfrm.code.wrap="off";
		}
	}
// -->
</script>

<script language="Javascript" type="text/javascript">
		// initialisation
		editAreaLoader.init({
			id: "txtedit"	// id of the textarea to transform		
			,start_highlight: true	// if start with highlight
			,allow_resize: "both"
			//,min_width = 400
			//,min_height = 100
			//,allow_resize: "y"
			,allow_toggle: true
			,word_wrap: true
			,language: "<?php 
    echo $GLOBALS["language"];
    ?>
"
			,syntax: "<?php 
    echo get_mime_type($dir, $item, "ext");
    ?>
"	
		});
</script>

<?php 
    // Form
    echo "<BR><FORM name=\"editfrm\" method=\"post\" action=\"" . make_link("edit", $dir, $item) . "\">\n";
    echo "<input type=\"hidden\" name=\"dosave\" value=\"yes\">\n";
    echo "<TEXTAREA NAME=\"code\" ID=\"txtedit\" rows=\"25\" cols=\"120\" wrap=\"off\">";
    // Show File In TextArea
    $buffer = "";
    while (!feof($fp)) {
        $buffer .= fgets($fp, 4096);
    }
    @fclose($fp);
    //echo htmlspecialchars($buffer);
    echo $buffer;
    echo "</TEXTAREA><BR>\n<TABLE><TR><TD>Wordwrap: (IE only)</TD><TD><INPUT type=\"checkbox\" name=\"wrap\" ";
    echo "onClick=\"javascript:chwrap();\" value=\"1\"></TD></TR></TABLE><BR>\n";
    echo "<TABLE><TR><TD><INPUT type=\"text\" name=\"fname\" value=\"" . $item . "\"></TD>";
    echo "<TD><input type=\"submit\" value=\"" . $GLOBALS["messages"]["btnsave"];
    echo "\"></TD>\n<TD><input type=\"reset\" value=\"" . $GLOBALS["messages"]["btnreset"] . "\"></TD>\n<TD>";
    echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnclose"] . "\" onClick=\"javascript:location='";
    echo make_link("list", $dir, NULL) . "';\"></TD></TR></FORM></TABLE><BR>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.editfrm) document.editfrm.code.focus();
// -->
</script><?php 
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:99,代码来源:fun_edit_editarea.php


示例3: get_result_array

function get_result_array($list)
{
    // print table of found items
    if (!is_array($list)) {
        return;
    }
    $cnt = count($list);
    $array = array();
    for ($i = 0; $i < $cnt; ++$i) {
        $dir = $list[$i][0];
        $item = $list[$i][1];
        $s_dir = str_replace($GLOBALS['home_dir'], '', $dir);
        if (strlen($s_dir) > 65) {
            $s_dir = substr($s_dir, 0, 62) . "...";
        }
        $s_item = $item;
        if (strlen($s_item) > 45) {
            $s_item = substr($s_item, 0, 42) . "...";
        }
        $link = "";
        $target = "";
        if (get_is_dir($dir, $item)) {
            $img = "dir.png";
            $link = ext_make_link("list", get_rel_item($dir, $item), NULL);
        } else {
            $img = get_mime_type($item, "img");
            //if(get_is_editable($dir,$item) || get_is_image($dir,$item)) {
            $link = $GLOBALS["home_url"] . "/" . get_rel_item($dir, $item);
            $target = "_blank";
            //}
        }
        $array[$i]['last_mtime'] = ext_isFTPMode() ? $GLOBALS['ext_File']->filemtime($GLOBALS['home_dir'] . '/' . $dir . '/' . $item) : filemtime($dir . '/' . $item);
        $array[$i]['file_id'] = md5($s_dir . $s_item);
        $array[$i]['dir'] = str_replace($GLOBALS['home_dir'], '', $dir);
        $array[$i]['s_dir'] = empty($s_dir) ? '' : $s_dir;
        $array[$i]['file'] = $s_item;
        $array[$i]['link'] = $link;
        $array[$i]['icon'] = _EXT_URL . "/images/{$img}";
    }
    return $array;
}
开发者ID:ejailesb,项目名称:repo_empr,代码行数:41,代码来源:search.php


示例4: edit_file

function edit_file($dir, $item)
{
    // edit file
    $mainframe =& JFactory::getApplication();
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    $fname = get_abs_item($dir, $item);
    if (!get_is_file($fname)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
    }
    if (!get_show_item($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
    }
    if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
        // Save / Save As
        $item = basename(stripslashes($GLOBALS['__POST']["fname"]));
        $fname2 = get_abs_item($dir, $item);
        if (!isset($item) || $item == "") {
            show_error($GLOBALS["error_msg"]["miscnoname"]);
        }
        if ($fname != $fname2 && @$GLOBALS['nx_File']->file_exists($fname2)) {
            show_error($item . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
        }
        savefile($fname2);
        $fname = $fname2;
        if (!empty($GLOBALS['__POST']['return_to'])) {
            $return_to = urldecode($GLOBALS['__POST']['return_to']);
            $mainframe->redirect($return_to);
        } elseif (!empty($GLOBALS['__POST']['return_to_dir'])) {
            $mainframe->redirect($_SERVER['PHP_SELF'] . '?option=com_osefileman&dir=' . $dir, 'The File ' . $item . ' was saved.');
        }
    }
    // header
    $s_item = get_rel_item($dir, $item);
    if (strlen($s_item) > 50) {
        $s_item = "..." . substr($s_item, -47);
    }
    show_header($GLOBALS["messages"]["actedit"] . ": /" . $s_item);
    $s_info = pathinfo($s_item);
    $s_extension = str_replace('.', '', $s_info['extension']);
    switch (strtolower($s_extension)) {
        case 'txt':
        case 'ini':
            $cp_lang = 'text';
            break;
        case 'cs':
            $cp_lang = 'csharp';
            break;
        case 'css':
            $cp_lang = 'css';
            break;
        case 'html':
        case 'htm':
        case 'xml':
        case 'xhtml':
            $cp_lang = 'html';
            break;
        case 'java':
            $cp_lang = 'java';
            break;
        case 'js':
            $cp_lang = 'javascript';
            break;
        case 'pl':
            $cp_lang = 'perl';
            break;
        case 'ruby':
            $cp_lang = 'ruby';
            break;
        case 'sql':
            $cp_lang = 'sql';
            break;
        case 'vb':
        case 'vbs':
            $cp_lang = 'vbscript';
            break;
        case 'php':
            $cp_lang = 'php';
            break;
        default:
            $cp_lang = 'generic';
    }
    // Form
    echo '<script type="text/javascript" src="components/com_osefileman/scripts/codepress/codepress.js"></script>';
    echo "<br/><form name=\"editfrm\" id=\"editfrm\" method=\"post\" action=\"" . make_link("edit", $dir, $item) . "\">\n";
    if (!empty($GLOBALS['__GET']['return_to'])) {
        $close_action = 'window.location=\'' . urldecode($GLOBALS['__GET']['return_to']) . '\';';
        echo "<input type=\"hidden\" name=\"return_to\" value=\"" . $GLOBALS['__GET']['return_to'] . "\" />\n";
    } else {
        $close_action = 'window.location=\'' . make_link('list', $dir, NULL) . "'";
    }
    $submit_action = ' document.editfrm.code.value=codearea_ta.getCode();document.editfrm.submit();';
    echo "\n<table class=\"adminform\">\n\t<tr>\n\t\t<td style=\"text-align: center;\">\n\t\t\t<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnsave"] . "\" onclick=\"{$submit_action}\" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\t\t\t<input type=\"reset\" value=\"" . $GLOBALS["messages"]["btnreset"] . "\" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\t\t\t<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnclose"] . "\" onclick=\"javascript:{$close_action}\" />\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td >\n\t\t\t<div id=\"positionIndicator\" style=\"width: 20%;float:left;\">" . $GLOBALS["messages"]["line"] . ": <input type=\"text\" name=\"txtLine\" class=\"inputbox\" size=\"6\" onchange=\"setCaretPosition(document.editfrm.code, this.value);return false;\" />&nbsp;&nbsp;&nbsp;" . $GLOBALS["messages"]["column"] . ": <input type=\"text\" name=\"txtColumn\" class=\"inputbox\" size=\"6\" readonly=\"readonly\" />\n          </div>\n\t\t\t<div style=\"width:70%;text-align: center;float:left;\">\n\t\t\t\t<input type=\"checkbox\" value=\"1\" name=\"return_to_dir\" id=\"return_to_dir\" />\n\t\t\t\t<label for=\"return_to_dir\">" . $GLOBALS["messages"]["returndir"] . "</label>\n\t\t\t</div>";
    echo "\n\t\t</td>\n\t</tr>\n\t<tr><td>";
    echo "<input type=\"hidden\" name=\"dosave\" value=\"yes\" />\n";
    // Show File In TextArea
    $content = $GLOBALS['nx_File']->file_get_contents($fname);
    if (get_magic_quotes_runtime()) {
        $content = stripslashes($content);
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:fun_edit.php


示例5: chmod_item

function chmod_item($dir, $item)
{
    // change permissions
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (!empty($GLOBALS['__POST']["selitems"])) {
        $cnt = count($GLOBALS['__POST']["selitems"]);
    } else {
        $GLOBALS['__POST']["selitems"][] = $item;
        $cnt = 1;
    }
    if (!empty($GLOBALS['__POST']['do_recurse'])) {
        $do_recurse = true;
    } else {
        $do_recurse = false;
    }
    // Execute
    if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
        $bin = '';
        for ($i = 0; $i < 3; $i++) {
            for ($j = 0; $j < 3; $j++) {
                $tmp = "r_" . $i . $j;
                if (isset($GLOBALS['__POST'][$tmp]) && $GLOBALS['__POST'][$tmp] == "1") {
                    $bin .= '1';
                } else {
                    $bin .= '0';
                }
            }
        }
        if ($bin == '0') {
            // Changing permissions to "none" is not allowed
            show_error($item . ": " . $GLOBALS["error_msg"]["permchange"]);
        }
        $old_bin = $bin;
        for ($i = 0; $i < $cnt; ++$i) {
            if (jx_isFTPMode()) {
                $mode = decoct(bindec($bin));
            } else {
                $mode = bindec($bin);
            }
            $item = $GLOBALS['__POST']["selitems"][$i];
            if (jx_isFTPMode()) {
                $abs_item = get_item_info($dir, $item);
            } else {
                $abs_item = get_abs_item($dir, $item);
            }
            if (!$GLOBALS['jx_File']->file_exists($abs_item)) {
                show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
            }
            if (!get_show_item($dir, $item)) {
                show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
            }
            if ($do_recurse) {
                $ok = $GLOBALS['jx_File']->chmodRecursive($abs_item, $mode);
            } else {
                if (get_is_dir($abs_item)) {
                    // when we chmod a directory we must care for the permissions
                    // to prevent that the directory becomes not readable (when the "execute bits" are removed)
                    $bin = substr_replace($bin, '1', 2, 1);
                    // set 1st x bit to 1
                    $bin = substr_replace($bin, '1', 5, 1);
                    // set  2nd x bit to 1
                    $bin = substr_replace($bin, '1', 8, 1);
                    // set 3rd x bit to 1
                    if (jx_isFTPMode()) {
                        $mode = decoct(bindec($bin));
                    } else {
                        $mode = bindec($bin);
                    }
                }
                $ok = @$GLOBALS['jx_File']->chmod($abs_item, $mode);
            }
            $bin = $old_bin;
        }
        if (!$ok || PEAR::isError($ok)) {
            show_error($abs_item . ": " . $GLOBALS["error_msg"]["permchange"]);
        }
        header("Location: " . make_link("link", $dir, NULL));
        return;
    }
    if (jx_isFTPMode()) {
        $abs_item = get_item_info($dir, $GLOBALS['__POST']["selitems"][0]);
    } else {
        $abs_item = get_abs_item($dir, $GLOBALS['__POST']["selitems"][0]);
    }
    $mode = parse_file_perms(get_file_perms($abs_item));
    if ($mode === false) {
        show_error($GLOBALS['__POST']["selitems"][0] . ": " . $GLOBALS["error_msg"]["permread"]);
    }
    $pos = "rwx";
    $text = "";
    for ($i = 0; $i < $cnt; ++$i) {
        $s_item = get_rel_item($dir, $GLOBALS['__POST']["selitems"][$i]);
        if (strlen($s_item) > 50) {
            $s_item = "..." . substr($s_item, -47);
        }
        $text .= ", " . $s_item;
    }
    show_header($GLOBALS["messages"]["actperms"]);
//.........这里部分代码省略.........
开发者ID:Caojunkai,项目名称:arcticfox,代码行数:101,代码来源:fun_chmod.php


示例6: execAction

    function execAction($dir, $item)
    {
        // edit file
        global $mainframe, $mosConfig_live_site;
        if (($GLOBALS["permissions"] & 01) != 01) {
            ext_Result::sendResult('edit', false, ext_Lang::err('accessfunc'));
        }
        $fname = ext_TextEncoding::fromUTF8(get_abs_item($dir, $item));
        if (!get_is_file($fname)) {
            ext_Result::sendResult('edit', false, ext_TextEncoding::toUTF8($item) . ": " . ext_Lang::err('fileexist'));
        }
        if (!get_show_item($dir, $item)) {
            ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('accessfile'));
        }
        if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
            // Save / Save As
            $item = basename(stripslashes($GLOBALS['__POST']["fname"]));
            $fname2 = ext_TextEncoding::fromUTF8(get_abs_item($dir, $item));
            if (!isset($item) || $item == "") {
                ext_Result::sendResult('edit', false, ext_Lang::err('miscnoname'));
            }
            if ($fname != $fname2 && @$GLOBALS['ext_File']->file_exists($fname2)) {
                ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('itemdoesexist'));
            }
            $this->savefile($fname2);
            $fname = $fname2;
            ext_Result::sendResult('edit', true, ext_Lang::msg('savefile') . ': ' . $item);
        }
        if (isset($GLOBALS['__POST']["doreopen"]) && $GLOBALS['__POST']["doreopen"] == "yes") {
            // File Reopen
            $extra = array();
            $content = $GLOBALS['ext_File']->file_get_contents($fname);
            if (get_magic_quotes_runtime()) {
                $content = stripslashes($content);
            }
            $langs = $GLOBALS["language"];
            if ($langs == "japanese") {
                $_encoding = $GLOBALS['__POST']["file_encoding"];
                if ($content) {
                    $content = mb_convert_encoding($content, "UTF-8", $_encoding);
                }
                $extra["file_encoding"] = $_encoding;
            }
            $extra["content"] = $content;
            ext_Result::sendResult('edit', true, ext_Lang::msg('reopenfile') . ': ' . $item, $extra);
        }
        // header
        $s_item = get_rel_item($dir, $item);
        if (strlen($s_item) > 50) {
            $s_item = "..." . substr($s_item, -47);
        }
        $id_hash = substr('f' . md5($s_item), 0, 10);
        $s_info = pathinfo($s_item);
        $s_extension = str_replace('.', '', $s_info['extension']);
        switch (strtolower($s_extension)) {
            case 'txt':
                $cp_lang = 'text';
                break;
            case 'cs':
                $cp_lang = 'csharp';
                break;
            case 'css':
                $cp_lang = 'css';
                break;
            case 'html':
            case 'htm':
            case 'xhtml':
                $cp_lang = 'html';
                break;
            case 'java':
                $cp_lang = 'java';
                break;
            case 'js':
                $cp_lang = 'js';
                break;
            case 'pl':
                $cp_lang = 'perl';
                break;
            case 'py':
                $cp_lang = 'python';
                break;
            case 'ruby':
                $cp_lang = 'ruby';
                break;
            case 'sql':
                $cp_lang = 'sql';
                break;
            case 'vb':
            case 'vbs':
                $cp_lang = 'vb';
                break;
            case 'php':
                $cp_lang = 'php';
                break;
            case 'xml':
                $cp_lang = 'xml';
                break;
            default:
                $cp_lang = '';
        }
//.........这里部分代码省略.........
开发者ID:A-Bush,项目名称:pprod,代码行数:101,代码来源:edit.php


示例7: print_table

function print_table($dir, $list, $allow)
{
    // print table of files
    global $dir_up;
    if (!is_array($list)) {
        return;
    }
    if ($dir != "" || strstr($dir, _EXT_PATH)) {
        echo "<tr class=\"sectiontableentry1\"><td valign=\"baseline\"><a href=\"" . make_link("list", $dir_up, NULL) . "\">";
        echo "<img border=\"0\" align=\"absmiddle\" src=\"" . _EXT_URL . "/images/up.png\" ";
        echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"/>&nbsp;&nbsp;..</a></td>\n";
        echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>";
        echo "</tr>";
    }
    $i = 0;
    while (list($item, ) = each($list)) {
        if ($item == 'index.html') {
            continue;
        }
        $abs_item = get_abs_item($dir, $item);
        $is_writable = is_writable($abs_item);
        $is_chmodable = $GLOBALS['ext_File']->is_chmodable($abs_item);
        $is_readable = is_readable($abs_item);
        $is_deletable = $GLOBALS['ext_File']->is_deletable($abs_item);
        $file_info = @stat($abs_item);
        $is_file = false;
        //if(is_link($abs_item)) $extra=" -> ".@readlink($abs_item);
        if (@is_dir($abs_item)) {
            $link = make_link("list", get_rel_item($dir, $item), NULL);
        } else {
            //if(get_is_editable($dir,$item) || get_is_image($dir,$item)) {
            $link = make_link("download", $dir, $item);
            $is_file = true;
        }
        //else $link = "";
        $class = $i % 2 ? 'sectiontableentry1' : 'sectiontableentry2';
        //echo "<tr class=\"rowdata\">"
        echo '<tr class="' . $class . '">';
        // Icon + Link
        echo "<td nowrap=\"nowrap\">";
        if ($is_readable) {
            echo "<a href=\"" . $link . "\"";
            if ($is_file) {
                echo " title=\"" . $GLOBALS["messages"]["downlink"] . ": " . $item . "\"";
            }
            echo ">";
        }
        //else echo "<A>";
        echo "<img border=\"0\" ";
        echo "align=\"absmiddle\" vspace=\"5\" hspace=\"5\" src=\"" . _EXT_URL . "/images/" . get_mime_type($abs_item, "img") . "\" alt=\"\">&nbsp;";
        $s_item = $item;
        if (strlen($s_item) > 50) {
            $s_item = substr($s_item, 0, 47) . "...";
        }
        $s_item = htmlspecialchars($s_item);
        if (!$is_file) {
            echo '<strong>' . $s_item . '</strong>';
        } else {
            echo $s_item;
        }
        if ($is_readable) {
            echo "</a>";
            // ...$extra...
        }
        echo "</td>\n";
        // Size
        echo "<td>" . parse_file_size(get_file_size($abs_item)) . "</td>\n";
        // type
        echo "<td>" . get_mime_type($abs_item, "type") . "</td>\n";
        // modified
        echo "<td>" . parse_file_date(get_file_date($abs_item)) . "</td>\n";
        // actions
        echo "</tr>\n";
        $i++;
    }
}
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:76,代码来源:extplorer.list.php


示例8: execAction

    function execAction($dir, $item)
    {
        // edit file
        global $mainframe, $mosConfig_live_site;
        if (($GLOBALS["permissions"] & 01) != 01) {
            ext_Result::sendResult('edit', false, ext_Lang::err('accessfunc'));
        }
        $fname = get_abs_item($dir, $item);
        if (!get_is_file(utf8_decode($fname))) {
            ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('fileexist'));
        }
        if (!get_show_item($dir, $item)) {
            ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('accessfile'));
        }
        if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
            // Save / Save As
            $item = basename(stripslashes($GLOBALS['__POST']["fname"]));
            $fname2 = get_abs_item($dir, $item);
            if (!isset($item) || $item == "") {
                ext_Result::sendResult('edit', false, ext_Lang::err('miscnoname'));
            }
            if ($fname != $fname2 && @$GLOBALS['ext_File']->file_exists($fname2)) {
                ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('itemdoesexist'));
            }
            $this->savefile($fname2);
            $fname = $fname2;
            ext_Result::sendResult('edit', true, ext_Lang::msg('savefile') . ': ' . $item);
        }
        // header
        $s_item = get_rel_item($dir, $item);
        if (strlen($s_item) > 50) {
            $s_item = "..." . substr($s_item, -47);
        }
        $s_info = pathinfo($s_item);
        $s_extension = str_replace('.', '', $s_info['extension']);
        switch (strtolower($s_extension)) {
            case 'txt':
                $cp_lang = 'text';
                break;
            case 'cs':
                $cp_lang = 'csharp';
                break;
            case 'css':
                $cp_lang = 'css';
                break;
            case 'html':
            case 'htm':
            case 'xml':
            case 'xhtml':
                $cp_lang = 'html';
                break;
            case 'java':
                $cp_lang = 'java';
                break;
            case 'js':
                $cp_lang = 'javascript';
                break;
            case 'pl':
                $cp_lang = 'perl';
                break;
            case 'ruby':
                $cp_lang = 'ruby';
                break;
            case 'sql':
                $cp_lang = 'sql';
                break;
            case 'vb':
            case 'vbs':
                $cp_lang = 'vbscript';
                break;
            case 'php':
                $cp_lang = 'php';
                break;
            default:
                $cp_lang = 'generic';
        }
        ?>
	<div style="width:auto;">
	    <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
	    <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
	
	        <h3 style="margin-bottom:5px;"><?php 
        echo $GLOBALS["messages"]["actedit"] . ": /" . $s_item . '&nbsp;&nbsp;&nbsp;&nbsp;';
        ?>
</h3>
    
	        <div id="adminForm">
	
	        </div>
	    </div></div></div>
	    <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
	</div>
	
	<?php 
        // Show File In TextArea
        $content = $GLOBALS['ext_File']->file_get_contents($fname);
        if (get_magic_quotes_runtime()) {
            $content = stripslashes($content);
        }
        //$content = htmlspecialchars( $content );
//.........这里部分代码省略.........
开发者ID:shamblett,项目名称:janitor,代码行数:101,代码来源:edit.php


示例9: chmod_item

function chmod_item($dir, $item)
{
    if (!permissions_grant($dir, NULL, "change")) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (!file_exists(get_abs_item($dir, $item))) {
        show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
    }
    if (!get_show_item($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
    }
    // Execute
    if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
        $bin = '';
        for ($i = 0; $i < 3; $i++) {
            for ($j = 0; $j < 3; $j++) {
                $tmp = "r_" . $i . $j;
                if (isset($GLOBALS['__POST'][$tmp]) && $GLOBALS['__POST'][$tmp] == "1") {
                    $bin .= '1';
                } else {
                    $bin .= '0';
                }
            }
        }
        if (!@chmod(get_abs_item($dir, $item), bindec($bin))) {
            show_error($item . ": " . $GLOBALS["error_msg"]["permchange"]);
        }
        header("Location: " . make_link("link", $dir, NULL));
        return;
    }
    $mode = parse_file_perms(get_file_perms($dir, $item));
    if ($mode === false) {
        show_error($item . ": " . $GLOBALS["error_msg"]["permread"]);
    }
    $pos = "rwx";
    $s_item = get_rel_item($dir, $item);
    if (strlen($s_item) > 50) {
        $s_item = "..." . substr($s_item, -47);
    }
    show_header($GLOBALS["messages"]["actperms"] . ": /" . $s_item);
    // Form
    echo "<BR><TABLE width=\"175\"><FORM method=\"post\" action=\"";
    echo make_link("chmod", $dir, $item) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"confirm\" value=\"true\">\n";
    // print table with current perms & checkboxes to change
    for ($i = 0; $i < 3; ++$i) {
        echo "<TR><TD>" . $GLOBALS["messages"]["miscchmod"][$i] . "</TD>";
        for ($j = 0; $j < 3; ++$j) {
            echo "<TD>" . $pos[$j] . "&nbsp;<INPUT type=\"checkbox\"";
            if ($mode[3 * $i + $j] != "-") {
                echo " checked";
            }
            echo " name=\"r_" . $i . $j . "\" value=\"1\"></TD>";
        }
        echo "</TR>\n";
    }
    // Submit / Cancel
    echo "</TABLE>\n<BR><TABLE>\n<TR><TD>\n<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btnchange"];
    echo "\"></TD>\n<TD><input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
    echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL) . "';\">\n</TD></TR></FORM></TABLE><BR>\n";
}
开发者ID:rterbush,项目名称:nas4free,代码行数:61,代码来源:chmod.php


示例10: list_dir

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
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:101,代码来源:fun_list.php


示例11: dir_print

function dir_print($dir_list, $new_dir)
{
    // print list of directories
    // this list is used to copy/move items to a specific location
    // Link to Parent Directory
    $dir_up = dirname($new_dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    /*
      echo "<TR><TD><A HREF=\"javascript:NewDir('" . $dir_up;
      echo "');\"><IMG border=\"0\" width=\"16\" height=\"16\"";
      echo " align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["up"] . "\" ALT=\"\">&nbsp;..</A></TD></TR>\n";
    */
    // Print List Of Target Directories
    if (!is_array($dir_list)) {
        return;
    }
    while (list($new_item, ) = each($dir_list)) {
        $s_item = $new_item;
        if (strlen($s_item) > 40) {
            $s_item = substr($s_item, 0, 37) . "...";
        }
        if ($s_item == 'hn') {
            /*
             * echo "<TR><TD><A HREF=\"javascript:NewDir('" . get_rel_item($new_dir, $new_item) .
              "');\"><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" " .
              "src=\"_img/dir.gif\" ALT=\"\">&nbsp;" . $s_item . "</A></TD></TR>\n";
            */
            echo "<TR><TD>";
            echo "<A HREF=\"javascript:NewDir('" . get_rel_item($new_dir, $new_item) . "');\" style=\"color:#fff;background:#337ab7;display:inline-block;padding:6px 12px;font-size:16px;text-decoration:none;font-weight:400;line-height:1.4;text-align:center;white-space:nowrap;vertical-align:middle;border:1px solid #2e6da4;border-radius:4px;\">Pokračovať</A>";
            echo "<br><br>Chystáte sa rozbaľiť archív s názvom:</TD></TR>";
        }
    }
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:35,代码来源:fun_unzip.php


示例12: edit_file

function edit_file($dir, $item)
{
    // edit file
    global $mainframe, $mosConfig_live_site;
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    $fname = get_abs_item($dir, $item);
    if (!get_is_file($fname)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
    }
    if (!get_show_item($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
    }
    if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
        // Save / Save As
        $item = basename(stripslashes($GLOBALS['__POST']["fname"]));
        $fname2 = get_abs_item($dir, $item);
        if (!isset($item) || $item == "") {
            show_error($GLOBALS["error_msg"]["miscnoname"]);
        }
        if ($fname != $fname2 && @$GLOBALS['jx_File']->file_exists($fname2)) {
            show_error($item . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
        }
        savefile($fname2);
        $fname = $fname2;
        if (!empty($GLOBALS['__POST']['return_to'])) {
            $return_to = urldecode($GLOBALS['__POST']['return_to']);
            mosRedirect($return_to);
        } elseif (!empty($GLOBALS['__POST']['return_to_dir'])) {
            mosRedirect($_SERVER['PHP_SELF'] . '?option=com_joomlaxplorer&dir=' . $dir, 'The File ' . $item . ' was saved.');
        }
    }
    // header
    $s_item = get_rel_item($dir, $item);
    if (strlen($s_item) > 50) {
        $s_item = "..." . substr($s_item, -47);
    }
    show_header($GLOBALS["messages"]["actedit"] . ": /" . $s_item);
    $s_info = pathinfo($s_item);
    $s_extension = str_replace('.', '', $s_info['extension']);
    switch (strtolower($s_extension)) {
        case 'txt':
            $cp_lang = 'text';
            break;
        case 'cs':
            $cp_lang = 'csharp';
            break;
        case 'css':
            $cp_lang = 'css';
            break;
        case 'html':
        case 'htm':
        case 'xml':
        case 'xhtml':
            $cp_lang = 'html';
            break;
        case 'java':
            $cp_lang = 'java';
            break;
        case 'js':
            $cp_lang = 'javascript';
            break;
        case 'pl':
            $cp_lang = 'perl';
            break;
        case 'ruby':
            $cp_lang = 'ruby';
            break;
        case 'sql':
            $cp_lang = 'sql';
            break;
        case 'vb':
        case 'vbs':
            $cp_lang = 'vbscript';
            break;
        case 'php':
            $cp_lang = 'php';
            break;
        default:
            $cp_lang = 'generic';
    }
    // Form
    ec 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_rel_link函数代码示例发布时间:2022-05-15
下一篇:
PHP get_registered_nav_menus函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap