source: branches/feature-module-update/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php @ 16326

Revision 16326, 1.8 KB checked in by naka, 17 years ago (diff)

class_extendsディレクトリの追加

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8// {{{ requires
9require_once(CLASS_PATH . "pages/LC_Page.php");
10require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_FileManager_Ex.php");
11
12/**
13 * ファイル表示 のページクラス.
14 *
15 * @package Page
16 * @author LOCKON CO.,LTD.
17 * @version $Id$
18 */
19class LC_Page_Admin_Contents_FileView extends LC_Page {
20
21    // }}}
22    // {{{ functions
23
24    /**
25     * Page を初期化する.
26     *
27     * @return void
28     */
29    function init() {
30        parent::init();
31    }
32
33    /**
34     * Page のプロセス.
35     *
36     * @return void
37     */
38    function process() {
39        // ユーザー認証
40        SC_Utils_Ex::sfIsSuccess(new SC_Session());
41
42        // ソースとして表示するファイルを定義(直接実行しないファイル)
43        $arrViewFile = array(
44                             'html',
45                             'htm',
46                             'tpl',
47                             'php',
48                             'css',
49                             'js',
50                             );
51
52        // 拡張子取得
53        $arrResult = split('\.', $_GET['file']);
54        $ext = $arrResult[count($arrResult)-1];
55
56        // ファイル内容表示
57        if(in_array($ext, $arrViewFile)) {
58            $objFileManager = new SC_Helper_FileManager_Ex();
59            // ファイルを読み込んで表示
60            header("Content-type: text/plain\n\n");
61            print($objFileManager->sfReadFile(USER_PATH . $_GET['file']));
62        } else {
63            $this->sendRedirect(USER_URL . $_GET['file']);
64        }
65    }
66
67    /**
68     * デストラクタ.
69     *
70     * @return void
71     */
72    function destroy() {
73        parent::destroy();
74    }
75}
76?>
Note: See TracBrowser for help on using the repository browser.