本文整理汇总了PHP中get_show_item函数的典型用法代码示例。如果您正苦于以下问题:PHP get_show_item函数的具体用法?PHP get_show_item怎么用?PHP get_show_item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_show_item函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: download_item
function download_item($dir, $item)
{
// download file
// Security Fix:
$item = basename($item);
if (($GLOBALS["permissions"] & 01) != 01) {
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"]);
}
$abs_item = get_abs_item($dir, $item);
$browser = id_browser();
header('Content-Type: ' . ($browser == 'IE' || $browser == 'OPERA' ? 'application/octetstream' : 'application/octet-stream'));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($abs_item));
if ($browser == 'IE') {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
@readfile($abs_item);
exit;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:32,代码来源:fun_down.php
示例2: find_item
/**
* @version $Id: search.php 98 2008-02-11 17:56:04Z soeren $
* @package eXtplorer
* @copyright soeren 2007
* @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
* @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 find_item($dir, $pat, &$list, $recur)
{
// find items
$homedir = realpath($GLOBALS['home_dir']);
$handle = @$GLOBALS['ext_File']->opendir(get_abs_dir($dir));
if ($handle === false && $dir == "") {
$handle = @$GLOBALS['ext_File']->opendir($homedir . $GLOBALS['separator']);
}
if ($handle === false) {
ext_Result::sendResult('search', false, $dir . ": " . $GLOBALS["error_msg"]["opendir"]);
}
while (($new_item = $GLOBALS['ext_File']->readdir($handle)) !== false) {
if (is_array($new_item)) {
$abs_new_item = $new_item;
} else {
$abs_new_item = get_abs_item($dir, $new_item);
}
if (!$GLOBALS['ext_File']->file_exists($abs_new_item)) {
continue;
}
if (!get_show_item($dir, $new_item)) {
continue;
}
// match?
if (@eregi($pat, $new_item)) {
$list[] = array($dir, $new_item);
}
// search sub-directories
if (get_is_dir($abs_new_item) && $recur) {
find_item(get_rel_item($dir, $new_item), $pat, $list, $recur);
}
}
$GLOBALS['ext_File']->closedir($handle);
}
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:65,代码来源:search.php
示例3: find_item
function find_item($dir, $pat, &$list, $recur)
{
// find items
$handle = @opendir(get_abs_dir($dir));
if ($handle === false) {
return;
}
// unable to open dir
while (($new_item = readdir($handle)) !== false) {
if (!@file_exists(get_abs_item($dir, $new_item))) {
continue;
}
if (!get_show_item($dir, $new_item)) {
continue;
}
// match?
if (@eregi($pat, $new_item)) {
$list[] = array($dir, $new_item);
}
// search sub-directories
if (get_is_dir($dir, $new_item) && $recur) {
find_item(get_rel_item($dir, $new_item), $pat, $list, $recur);
}
}
closedir($handle);
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:26,代码来源:fun_search.php
示例4: download_item
function download_item($dir, $item)
{
// Security Fix:
$item = basename($item);
while (@ob_end_clean()) {
}
ob_start();
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"]);
}
$abs_item = get_abs_item($dir, $item);
$browser = id_browser();
header('Content-Type: ' . ($browser == 'IE' || $browser == 'OPERA' ? 'application/octetstream' : 'application/octet-stream'));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize(realpath($abs_item)));
//header("Content-Encoding: none");
if ($browser == 'IE') {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
@set_time_limit(0);
@readfile($abs_item);
ob_end_flush();
exit;
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:34,代码来源:fun_down.php
示例5: execAction
function execAction($dir)
{
// delete files/dirs
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('delete', false, $GLOBALS["error_msg"]["accessfunc"]);
}
// CSRF Security Check
if (!ext_checkToken($GLOBALS['__POST']["token"])) {
ext_Result::sendResult('tokencheck', false, 'Request failed: Security Token not valid.');
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = basename(stripslashes($GLOBALS['__POST']["selitems"][$i]));
if (ext_isFTPMode()) {
$abs = get_item_info($dir, $items[$i]);
} else {
$abs = get_abs_item($dir, $items[$i]);
}
if (!@$GLOBALS['ext_File']->file_exists($abs)) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
if (ext_isFTPMode()) {
$abs = str_replace('\\', '/', get_abs_item($dir, $abs));
}
$ok = $GLOBALS['ext_File']->remove($abs);
if ($ok === false || PEAR::isError($ok)) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
if (PEAR::isError($ok)) {
$error[$i] .= ' [' . $ok->getMessage() . ']';
}
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . ".\n";
}
ext_Result::sendResult('delete', false, $err_msg);
}
ext_Result::sendResult('delete', true, $GLOBALS['messages']['success_delete_file']);
}
开发者ID:ejailesb,项目名称:repo_empr,代码行数:58,代码来源:delete.php
示例6: del_items
function del_items($dir)
{
$mainframe =& JFactory::getApplication();
// delete files/dirs
if (($GLOBALS["permissions"] & 01) != 01) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
if (nx_isFTPMode()) {
$abs = get_item_info($dir, $items[$i]);
} else {
$abs = get_abs_item($dir, $items[$i]);
}
if (!@$GLOBALS['nx_File']->file_exists($abs)) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
if (nx_isFTPMode()) {
$abs = get_abs_item($dir, $abs);
}
$ok = $GLOBALS['nx_File']->remove($abs);
if ($ok === false || PEAR::isError($ok)) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
if (PEAR::isError($ok)) {
$error[$i] .= ' [' . $ok->getMessage() . ']';
}
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<br/>\n";
}
show_error($err_msg);
}
$mainframe->redirect(make_link("list", $dir, null), $GLOBALS['messages']['success_delete_file']);
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:55,代码来源:fun_del.php
示例7: download_item
function download_item($dir, $item, $unlink = false)
{
// download file
global $action, $mosConfig_cache_path;
// Security Fix:
$item = basename($item);
while (@ob_end_clean()) {
}
ob_start();
if (jx_isFTPMode()) {
$abs_item = $dir . '/' . $item;
} else {
$abs_item = get_abs_item($dir, $item);
if (!strstr($abs_item, realpath($GLOBALS['home_dir']))) {
$abs_item = realpath($GLOBALS['home_dir']) . $abs_item;
}
}
if (($GLOBALS["permissions"] & 01) != 01) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
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 (jx_isFTPMode()) {
$abs_item = jx_ftp_make_local_copy($abs_item);
$unlink = true;
}
$browser = id_browser();
header('Content-Type: ' . ($browser == 'IE' || $browser == 'OPERA' ? 'application/octetstream' : 'application/octet-stream'));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize(realpath($abs_item)));
//header("Content-Encoding: none");
if ($browser == 'IE') {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
@set_time_limit(0);
@readFileChunked($abs_item);
if ($unlink == true) {
unlink($abs_item);
}
ob_end_flush();
jx_exit();
}
开发者ID:Caojunkai,项目名称:arcticfox,代码行数:53,代码来源:fun_down.php
示例8: _is_download_allowed
function _is_download_allowed($dir, $items)
{
foreach ($items as $file) {
if (!permissions_grant($dir, $file, "read")) {
return false;
}
if (!get_show_item($dir, $file)) {
return false;
}
if (!file_exists(get_abs_item($dir, $file))) {
return false;
}
}
return true;
}
开发者ID:gilshwartz,项目名称:quixplorer,代码行数:15,代码来源:fun_down.php
示例9: download_item
function download_item($dir, $item)
{
// Security Fix:
$item = basename($item);
if (!permissions_grant($dir, $item, "read")) {
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"]);
}
$abs_item = get_abs_item($dir, $item);
_download($abs_item, $item);
}
开发者ID:rterbush,项目名称:nas4free,代码行数:16,代码来源:down.php
示例10: find_item
/**
* @version $Id: search.php 201 2011-06-27 09:45:09Z soeren $
* @package eXtplorer
* @copyright soeren 2007-2013
* @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 find_item($dir, $pat, &$list, $recur, $content)
{
// find items
$homedir = realpath($GLOBALS['home_dir']);
$opendir = $dir;
if (!is_dir($dir)) {
$opendir = get_abs_dir($dir);
}
$handle = @$GLOBALS['ext_File']->opendir($opendir);
if ($handle === false && $dir == "") {
$handle = @$GLOBALS['ext_File']->opendir($homedir . $GLOBALS['separator']);
}
if ($handle === false) {
ext_Result::sendResult('search', false, $opendir . ": " . $GLOBALS["error_msg"]["opendir"]);
}
while (($new_item = $GLOBALS['ext_File']->readdir($handle)) !== false) {
if (is_array($new_item)) {
$abs_new_item = $new_item;
} else {
$abs_new_item = get_abs_item($dir, $new_item);
}
//if(!$GLOBALS['ext_File']->file_exists($abs_new_item)) continue;
if (!get_show_item($dir, $new_item)) {
continue;
}
$isDir = get_is_dir($abs_new_item);
// match?
if (@preg_match('@' . $pat . '@is', $new_item) > 0) {
$list[] = array($dir, $new_item);
} else {
if (!$isDir) {
if ($content && $GLOBALS['ext_File']->filesize($abs_new_item) < 524288) {
$data = $GLOBALS['ext_File']->file_get_contents($abs_new_item);
//$data = fread($handle, 524288); // Only read first 512kb
if (preg_match('@' . $pat . '@is', $data) > 0) {
$list[] = array($dir, $new_item);
}
}
}
}
// search sub-directories
if ($isDir && $recur) {
find_item($abs_new_item, $pat, $list, $recur, $content);
}
}
$GLOBALS['ext_File']->closedir($handle);
}
开发者ID:eldersxavier,项目名称:online_editor_code,代码行数:78,代码来源:search.php
示例11: del_items
function del_items($dir)
{
// check if user is allowed to delete files
if (!permissions_grant($dir, NULL, "delete")) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$abs = get_abs_item($dir, $items[$i]);
if (!@file_exists(get_abs_item($dir, $items[$i]))) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
$ok = remove(get_abs_item($dir, $items[$i]));
if ($ok === false) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
}
show_error($err_msg);
}
miwoftp_redirect(make_link("list", $dir, NULL));
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:44,代码来源:fun_del.php
示例12: del_items
function del_items($dir)
{
// delete files/dirs
if (($GLOBALS["permissions"] & 01) != 01) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$abs = get_abs_item($dir, $items[$i]);
if (!@file_exists(get_abs_item($dir, $items[$i]))) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
$ok = remove(get_abs_item($dir, $items[$i]));
if ($ok === false) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
}
show_error($err_msg);
}
header("Location: " . make_link("list", $dir, NULL));
}
开发者ID:Zhi2014,项目名称:cogs,代码行数:44,代码来源:fun_del.php
示例13: download_item
function download_item($dir, $item)
{
// download file
// Security Fix:
$item = base_name($item);
if (($GLOBALS["permissions"] & 01) != 01) {
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"]);
}
$abs_item = get_abs_item($dir, $item);
$browser = id_browser();
header('Content-Type: ' . ($browser == 'IE' || $browser == 'OPERA' ? 'application/octetstream' : 'application/octet-stream'));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . get_file_size($dir, $item));
header('Content-Description: File Download');
if ($browser == 'IE') {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
//@readfile($abs_item);
flush();
$fp = popen("tail -c " . get_file_size($dir, $item) . " {$abs_item} 2>&1", "r");
while (!feof($fp)) {
// Send the current file part to the browser.
print fread($fp, 1024);
// Flush the content to the browser.
flush();
}
fclose($fp);
exit;
}
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:42,代码来源:fun_down.php
示例14: execAction
function execAction($dir, $item, $unlink = false)
{
// Security Fix:
$item = basename($item);
while (@ob_end_clean()) {
}
ob_start();
if (ext_isFTPMode()) {
$abs_item = $dir . '/' . $item;
} else {
$abs_item = get_abs_item($dir, $item);
//if( !strstr( $abs_item, $GLOBALS['home_dir']) )
// $abs_item = realpath($GLOBALS['home_dir']).$abs_item;
}
if (!$GLOBALS['ext_File']->file_exists($abs_item)) {
ext_Result::sendResult('download', false, $item . ": " . $GLOBALS["error_msg"]["fileexist"]);
return false;
}
if (!get_show_item($dir, $item)) {
ext_Result::sendResult('download', false, $item . ": " . $GLOBALS["error_msg"]["accessfile"]);
return false;
}
@set_time_limit(0);
if (ext_isFTPMode()) {
$abs_item = ext_ftp_make_local_copy($abs_item);
$unlink = true;
}
$browser = id_browser();
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize(realpath($abs_item)));
//header("Content-Encoding: none");
if (isset($_GET['action2']) && $_GET['action2'] == 'view') {
$content_disposition = 'inline';
include_once _EXT_PATH . '/libraries/Archive/file.php';
$extension = extFile::getExt($item);
switch (strtolower($extension)) {
case 'doc':
case 'dot':
$extension = 'msword';
break;
case 'docx':
case 'dotx':
$extension = 'vnd.openxmlformats-officedocument.wordprocessingml.template';
break;
case 'docm':
$extension = 'vnd.ms-word.document.macroEnabled.12';
break;
case 'docm':
$extension = 'vnd.ms-word.template.macroEnabled.12';
break;
case 'xls':
case 'xlt':
case 'xla':
$extension = 'vnd.ms-excel';
break;
case 'xlsx':
$extension = 'vnd.openxmlformats-officedocument.spreadsheetml.sheet';
break;
case 'xltx':
$extension = 'vnd.openxmlformats-officedocument.spreadsheetml.template';
break;
case 'xlsm':
$extension = 'vnd.ms-excel.sheet.macroEnabled.12';
break;
case 'xltm':
$extension = 'vnd.ms-excel.template.macroEnabled.12';
break;
case 'xlam':
$extension = 'vnd.ms-excel.addin.macroEnabled.12';
break;
case 'xlsb':
$extension = 'vnd.ms-excel.sheet.binary.macroEnabled.12';
break;
case 'ppt':
case 'pot':
case 'pps':
case 'ppa':
$extension = 'vnd.ms-powerpoint';
break;
case 'pptx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.presentation';
break;
case 'potx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.template';
break;
case 'ppsx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.slideshow';
break;
case 'ppam':
$extension = 'vnd.ms-powerpoint.addin.macroEnabled.12';
break;
case 'pptm':
$extension = 'vnd.ms-powerpoint.presentation.macroEnabled.12';
break;
case 'potm':
$extension = 'vnd.ms-powerpoint.template.macroEnabled.12';
break;
case 'ppsm':
$extension = 'vnd.ms-powerpoint.slideshow.macroEnabled.12';
//.........这里部分代码省略.........
开发者ID:chajianku,项目名称:admin_eXtplorer,代码行数:101,代码来源:download.php
示例15: 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
示例16: list_dir
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 = " <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";
//.........这里部分代码省略.........
开发者ID:Caojunkai,项目名称:arcticfox,代码行数:101,代码来源:fun_list.php
示例17: copy_move_items
//.........这里部分代码省略.........
if ($first == "y") {
$newitem = $selitem;
}
} else {
$newitem = $selitem;
}
$s_item = $selitem;
if (strlen($s_item) > 50) {
$s_item = substr($s_item, 0, 47) . "...";
}
echo "<tr><td><img src=\"" . _QUIXPLORER_URL . "/images/information.png\" align=\"absmiddle\" alt=\"\">";
// old name
echo "<input type=\"hidden\" name=\"selitems[]\" value=\"";
echo $selitem . "\"> " . $s_item . " ";
// New Name
echo "</td><td><input type=\"text\" size=\"25\" name=\"newitems[]\" value=\"";
echo $newitem . "\"></td></tr>\n";
}
// Submit & Cancel
echo "</table><br /><table><tr>\n<td>";
echo "<input type=\"submit\" value=\"";
echo $action != "move" ? $GLOBALS["messages"]["btncopy"] : $GLOBALS["messages"]["btnmove"];
echo "\" onclick=\"javascript:Execute();\"></td>\n<td>";
echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
echo "\" onclick=\"javascript:location='" . make_link("list", $dir, NULL);
echo "';\"></td>\n</tr></table><br /></form>\n";
return;
}
// DO COPY/MOVE
// ALL OK?
if (!@$GLOBALS['nx_File']->file_exists(get_abs_dir($new_dir))) {
show_error(get_abs_dir($new_dir) . ": " . $GLOBALS["error_msg"]["targetexist&qu
|
请发表评论