Source for file LC_Page_Admin_Contents_FileManager.php
Documentation is available at LC_Page_Admin_Contents_FileManager.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH .
"pages/LC_Page.php");
require_once(CLASS_EX_PATH .
"helper_extends/SC_Helper_FileManager_Ex.php");
* @author LOCKON CO.,LTD.
$this->tpl_subnavi =
'contents/subnavi.tpl';
$this->tpl_subno =
"file";
$this->tpl_subtitle =
'ファイル管理';
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if($_POST['mode'] !=
"") {
$now_dir =
$_POST['now_file'];
// 初期表示はルートディレクトリ(user_data/)を表示
if(is_dir($_POST['select_file'])) {
///$now_dir = $_POST['select_file'];
// ツリー遷移用のjavascriptを埋め込む
$arrErr['select_file'] =
"※ ディレクトリを表示することは出来ません。<br/>";
// javascriptで別窓表示(テンプレート側に渡す)
$file_url =
ereg_replace(USER_PATH, "", $_POST['select_file']);
$this->tpl_onload =
"win02('./file_view.php?file=".
$file_url .
"', 'user_data', '600', '400');";
if(is_dir($_POST['select_file'])) {
// ディレクトリの場合はjavascriptエラー
$arrErr['select_file'] =
"※ ディレクトリをダウンロードすることは出来ません。<br/>";
$objFileManager->sfDownloadFile($_POST['select_file']);
$objFileManager->sfDeleteDir($_POST['select_file']);
if(!$objFileManager->sfCreateFile($create_dir.
"/".
$_POST['create_file'], 0755)) {
$arrErr['create_file'] =
"※ ".
$_POST['create_file'].
"の作成に失敗しました。<br/>";
$ret =
$objUpFile->makeTempFile('upload_file', false);
$arrErr['upload_file'] =
$ret;
$this->tpl_onload .=
"alert('ファイルをアップロードしました。');";
if($top_dir_check ==
$now_dir_check) $is_top_dir =
true;
$this->arrFileList =
$objFileManager->sfGetFileList($now_dir);
$this->tpl_is_top_dir =
$is_top_dir;
$this->tpl_parent_dir =
$parent_dir;
$this->tpl_now_dir =
$now_dir;
$this->tpl_now_file =
basename($now_dir);
$this->arrErr = isset
($arrErr) ?
$arrErr :
"";
$this->arrParam =
$_POST;
// ツリーを表示する divタグid, ツリー配列変数名, 現在ディレクトリ, 選択ツリーhidden名, ツリー状態hidden名, mode hidden名
$treeView =
"fnTreeView('tree', arrTree, '$now_dir', 'tree_select_file', 'tree_status', 'move');";
if (!isset
($_POST['tree_status'])) $_POST['tree_status'] =
"";
$arrTree =
$objFileManager->sfGetFileTree($top_dir, $_POST['tree_status']);
foreach($arrTree as $arrVal) {
$this->tpl_javascript .=
"arrTree[".
$arrVal['count'].
"] = new Array(".
$arrVal['count'].
", '".
$arrVal['type'].
"', '".
$arrVal['path'].
"', ".
$arrVal['rank'].
",";
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
$objErr->doFunc(array("ファイル", "select_file"), array("SELECT_CHECK"));
* 関数名:lfCreateErrorCheck()
$objErr->doFunc(array("作成ファイル名", "create_file"), array("EXIST_CHECK", "FILE_NAME_CHECK_BY_NOUPLOAD"));
$objUpFile->addFile("ファイル", 'upload_file', array(), FILE_SIZE, true, 0, 0, false);
* 説明:選択ディレクトリがUSER_PATH以下かチェック
if (preg_match("@^\Q".
$top_dir.
"\E@", $dir) >
0) {
// 相対パスがある場合、USER_PATHを返す.
// 相対パスがない場合、そのままディレクトリパスを返す.
// USER_PATH以下でない場合、USER_PATHを返す.
$arrDir =
split('/', $dir);
foreach($arrDir as $val) {
Documentation generated on Tue, 28 Apr 2009 18:10:56 +0900 by phpDocumentor 1.4.2