Source for file LC_Page_Admin_Design_CSS.php
Documentation is available at LC_Page_Admin_Design_CSS.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 =
'design/subnavi.tpl';
$this->tpl_subno =
"css";
$this->tpl_subtitle =
'CSS編集';
if (isset
($_POST['css_name'])) {
$css_name =
$_POST['css_name'];
}else if (isset
($_GET['css_name'])){
$css_name =
$_GET['css_name'];
$this->css_name =
$css_name;
if (isset
($_POST['old_css_name'])) {
$old_css_name =
$_POST['old_css_name'];
}else if (isset
($_GET['css_name'])) {
$old_css_name =
$_GET['css_name'];
$this->old_css_name =
$old_css_name;
$css_dir =
USER_TEMPLATE_PATH .
TEMPLATE_NAME .
"/css/";
$css_path =
$css_dir .
$css_name .
'.css';
$css_data =
$objFileManager->sfReadFile($css_path);
$this->css_data =
$css_data;
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if(isset
($_POST['mode'])) {
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
if (count($this->arrErr) ==
0) {
if ($old_css_name !=
'' &&
$old_css_name !=
$css_name) {
$objFileManager->sfDeleteDir($css_dir .
$old_css_name .
'.css');
$objFileManager->sfWriteFile($css_path, $_POST['css']);
$this->old_css_name =
$css_name;
$this->css_data =
$_POST['css'];
// css_name が空でない場合にはdeleteを実行
if ($_POST['css_name'] !==
'') {
$objFileManager->sfDeleteDir($css_path);
* @param array $css_dir CSSディレクトリ
$arrFileList =
$objFileManager->sfGetFileList($css_dir);
foreach ($arrFileList as $key =>
$val) {
'file_name' =>
$val['file_name'],
'css_name' =>
preg_replace('/(.+)\.(.+?)$/','$1',$val['file_name']),
* @param array $arrData 入力データ
* @param array $css_dir CSSディレクトリ
$objErr->doFunc(array("CSSファイル名", "css_name", STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK"));
// 入力文字が英数字,"_","-"以外ならエラーを返す
if(!isset
($objErr->arrErr['css_name'])){
if(!ereg("^[a-zA-Z0-9_\.-]+$", $array['css_name'])) {
$objErr->arrErr['css_name'] =
'※ CSSファイル名は英数字と"_"および"-"だけを入力してください。<br />';
// 同一のファイル名が存在している場合にはエラー
if(!isset
($objErr->arrErr['css_name'])){
foreach ($arrCSSList as $key =>
$val) {
if ($val['css_name'] ==
$array['css_name']) {
if ($array['old_css_name'] ==
'' ||
$array['old_css_name'] !=
$array['css_name']) {
if ($errFlg) $objErr->arrErr['css_name'] =
'※ 同じファイル名のデータが存在しています。別の名称を付けてください。<br />';
Documentation generated on Tue, 28 Apr 2009 18:11:05 +0900 by phpDocumentor 1.4.2