Disable editing layouts unless they have already been edited #2121

This commit is contained in:
Kijin Sung 2023-06-19 00:20:57 +09:00
parent a266d39c2e
commit 3524c60435
7 changed files with 68 additions and 7 deletions

View file

@ -80,12 +80,16 @@ $lang->layout_manager['51'] = 'Reset';
$lang->layout_manager['52'] = 'Text';
$lang->layout_manager['53'] = 'Font';
$lang->layout_manager['54'] = 'Font Color';
$lang->layout_editing_deprecated_p1 = 'Layout editing is no longer supported. It is allowed for a limited time only for layouts that have already been edited, but this allowance may be removed completely in the future.';
$lang->layout_editing_deprecated_p2 = 'Layout editing is supported for a limited time only for layouts that have already been edited.<br />Using this screen to edit soure code is not recommended.<br />Please use FTP or a code editor to edit the HTML and CSS of the original layout source code.';
$lang->layout_editing_deprecated_p3 = 'For your information, edited source code is currently stored in the following files.';
$lang->layout_editing_deprecated_p4 = 'The original source code is stored in the following file, as well as any file included/referenced therein.';
$lang->layout_editing_deprecated_p5 = 'Caution: Clicking Reset will roll back the layout source code to the original. You cannot return to this screen afterward.<br />Please back up the edited source code below before clicking Reset.';
$lang->layout_image_repository = 'Layout Repository';
$lang->about_layout_image_repository = 'You can upload image/flash files for the selected layout. They will be included in exports.';
$lang->msg_layout_image_target = 'Only gif, png, jpg, swf, flv files are allowed';
$lang->layout_migration = 'Layout Migration';
$lang->about_layout_migration = 'You can export or import the editted layout as a tar file.
(So far only FaceOff supports exports/imports)';
$lang->about_layout_migration = 'You can export or import the editted layout as a tar file. (So far only FaceOff supports exports/imports)';
$lang->about_faceoff['title'] = 'Rhymix FaceOff Layout Manager';
$lang->about_faceoff['description'] = 'FaceOff Layout Manager willl help you design layout on the web easily.<br/>Please design your own layout with components and functions as shown below.';
$lang->about_faceoff['layout'] = 'FaceOff has HTML structure as above.<br/>You can arrange/align with CSS, or use Style to design.<br/>You can add widget from Extension(e1, e2), Neck and Knee.<br/>Also Body, Layout, Header, Body, Footer can designed by Style, and Content will display content.';

View file

@ -80,12 +80,16 @@ $lang->layout_manager['51'] = '초기화';
$lang->layout_manager['52'] = '글자';
$lang->layout_manager['53'] = '글자 폰트';
$lang->layout_manager['54'] = '글자 색';
$lang->layout_editing_deprecated_p1 = '레이아웃 편집 기능은 더이상 제공하지 않습니다. 이미 편집된 레이아웃에 한하여 편집을 허용하나, 추후 완전히 제거될 수 있습니다.';
$lang->layout_editing_deprecated_p2 = '레이아웃 편집 기능은 이미 편집된 레이아웃에 한하여 일시적으로 제공됩니다.<br />이 화면에서 레이아웃 소스를 직접 수정하는 것은 권장하지 않습니다.<br />FTP 또는 에디터를 사용하여 원본 레이아웃의 HTML, CSS 소스 코드를 직접 편집하시기 바랍니다.';
$lang->layout_editing_deprecated_p3 = '편집된 소스 코드는 아래의 경로에 저장되어 있으니 참고하십시오.';
$lang->layout_editing_deprecated_p4 = '원본 소스 코드는 아래의 경로에 있으며, 그곳에서 인클루드 또는 참조된 다른 파일이 더 있을 수 있습니다.';
$lang->layout_editing_deprecated_p5 = '주의: 초기화를 클릭하면 편집된 소스 코드가 원본으로 대체되며, 이 화면으로 다시 돌아올 수 없습니다.<br />초기화하기 전에 편집된 소스 코드를 백업해 두시기 바랍니다.';
$lang->layout_image_repository = '레이아웃 파일 저장소';
$lang->about_layout_image_repository = '선택한 레이아웃에 사용될 이미지/플래시파일 등을 올릴 수 있습니다. 내보내기에 같이 포함 됩니다.';
$lang->msg_layout_image_target = 'gif, png, jpg, swf, flv파일만 가능합니다.';
$lang->layout_migration = '레이아웃 내보내기/들이기';
$lang->about_layout_migration = '수정된 레이아웃을 tar 파일로 내보내거나 tar 파일로 저장된 것을 불러올 있습니다
(아직은 faceOff레이아웃만 내보내기/들이기가 됩니다.)';
$lang->about_layout_migration = '수정된 레이아웃을 tar 파일로 내보내거나 tar 파일로 저장된 것을 불러올 수 있습니다. (아직은 faceOff레이아웃만 내보내기/들이기가 됩니다.)';
$lang->about_faceoff['title'] = 'Rhymix FaceOff Layout 관리자';
$lang->about_faceoff['description'] = 'FaceOff Layout관리자로 웹상에서 쉽게 레이아웃을 꾸밀 수 있습니다.<br/>아래 그림을 보고 구성요소와 기능을 이용하여 원하는 레이아웃을 만드세요.';
$lang->about_faceoff['layout'] = 'FaceOff는 위와 같은 HTML 구조로 되어 있습니다.<br/>이 구조에서 CSS를 이용하여 형태/배열/정렬을 할 수 있고 또 Style을 이용하여 꾸밀 수 있습니다.<br/>위젯 추가는 Extension(e1, e2)과 Neck, Knee에서 가능합니다.<br/>이 외 Body, Layout, Header, Body, Footer는 Style을 꾸밀 수 있고 Content는 내용이 출력됩니다.';

View file

@ -236,6 +236,12 @@ class layoutAdminView extends layout
// Error appears if there is no layout information is registered
if(!$layout_info) return $this->dispLayoutAdminInstalledList();
// Prevent editing if the layout has not already been edited #2121
if(!$layout_info->is_edited)
{
return new BaseObject(-1, 'layout.layout_editing_deprecated_p1');
}
// Get Layout Code
if($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
{

View file

@ -139,6 +139,16 @@ class layoutModel extends layout
{
foreach($output->data as $no => $iInfo)
{
if (file_exists(\RX_BASEDIR . 'files/faceOff/' . getNumberingPath($iInfo->layout_srl) . 'layout.html') ||
file_exists(\RX_BASEDIR . 'files/faceOff/' . getNumberingPath($iInfo->layout_srl) . 'layout.css'))
{
$iInfo->is_edited = true;
}
else
{
$iInfo->is_edited = false;
}
if($this->isExistsLayoutFile($iInfo->layout, $iInfo->layout_type) && $iInfo->layout_type === $layoutType)
{
$instanceList[] = $iInfo->layout;
@ -276,6 +286,17 @@ class layoutModel extends layout
// Return xml file informaton after listing up the layout and extra_vars
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
// Check if layout has been edited
if (file_exists(\RX_BASEDIR . 'files/faceOff/' . getNumberingPath($layout_srl) . 'layout.html') ||
file_exists(\RX_BASEDIR . 'files/faceOff/' . getNumberingPath($layout_srl) . 'layout.css'))
{
$layout_info->is_edited = true;
}
else
{
$layout_info->is_edited = false;
}
// Store in cache
Rhymix\Framework\Cache::set("layout:$layout_srl", $layout_info);
return $layout_info;

View file

@ -32,7 +32,13 @@
<td>{$item->title} ({$layout_name})</td>
<td>{zdate($item->regdate, "Y-m-d")}</td>
<td><a href="{getUrl('act', 'dispLayoutAdminModify', 'layout_srl', $item->layout_srl)}">{$lang->cmd_setup}</a></td>
<td><a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $item->layout_srl)}">{$lang->cmd_edit}</a></td>
<td>
<!--@if($item->is_edited)-->
<a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $item->layout_srl)}">{$lang->cmd_edit}</a>
<!--@else-->
<span style="color:#999">편집</span>
<!--@endif-->
</td>
<td><a href="{getUrl('', 'module', 'layout', 'act', 'dispLayoutAdminCopyLayout', 'layout_srl', $item->layout_srl)}" onclick="popopen(this.href);return false;" title="{$lang->cmd_copy}">{$lang->cmd_copy}</a></td>
<td class="rx_detail_marks">
<form cond="count($layout) > 1" class="layout_delete_form" ruleset="deleteLayout" action="./" method="post">

View file

@ -1,6 +1,20 @@
<include target="header.html" />
<load target="js/adminEdit.js" />
<p>{nl2br($lang->about_layout_code)}</p>
<div class="message error">
<p>{$lang->layout_editing_deprecated_p2}</p>
<p>{$lang->layout_editing_deprecated_p3}</p>
<ul>
<li>files/faceOff/{getNumberingPath($layout_srl)}/layout.html</li>
<li>files/faceOff/{getNumberingPath($layout_srl)}/layout.css</li>
</ul>
<p>{$lang->layout_editing_deprecated_p4}</p>
<ul>
<li>layouts/{$selected_layout->layout}/layout.html</li>
</ul>
<p>{$lang->layout_editing_deprecated_p5}</p>
</div>
<section class="section">
<h1>{$lang->layout_image_repository}</h1>
<p>{nl2br($lang->about_layout_image_repository)}</p>

View file

@ -27,7 +27,13 @@ xe.lang.confirm_delete = '{$lang->confirm_delete}';
<td class="title">{$layout->title}</td>
<td class="nowr">{zdate($layout->regdate, "Y-m-d")}</td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminModify', 'layout_srl', $layout->layout_srl)}">{$lang->cmd_setup}</a></td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $layout->layout_srl)}">{$lang->cmd_edit}</a></td>
<td class="nowr">
<!--@if($layout->is_edited)-->
<a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $layout->layout_srl)}">{$lang->cmd_edit}</a>
<!--@else-->
<span style="color:#999">편집</span>
<!--@endif-->
</td>
<td class="nowr"><a href="{getUrl('', 'module', 'layout', 'act', 'dispLayoutAdminCopyLayout', 'layout_srl', $layout->layout_srl)}" onclick="popopen(this.href);return false;" title="{$lang->cmd_copy}">{$lang->cmd_copy}</a></td>
<td class="nowr">
<form cond="$isDeletable" class="layout_delete_form" ruleset="deleteLayout" action="./" method="post">