Add option to control whether to execute external page as PHP and/or Rhymix template

This commit is contained in:
Kijin Sung 2022-03-15 21:14:55 +09:00
parent af2c0bae95
commit 9edd52c328
4 changed files with 28 additions and 4 deletions

View file

@ -15,10 +15,14 @@ $lang->page_type_name['ARTICLE'] = 'Article Page';
$lang->page_type_name['WIDGET'] = 'Widget Page';
$lang->page_type_name['OUTSIDE'] = 'External Page';
$lang->about_page_type = 'Select Page Type to build a page. <ol><li>Widget: Create multiple widgets.</li><li>Article: Create articles with titles, contents and tags for posting page. </li><li>External Page: Use external HTML or PHP files in Rhymix.</li></ol>';
$lang->opage_path = 'Location of External Document';
$lang->opage_path = 'Location of External Document for PC';
$lang->about_opage = 'This module enables to use external html or php files in Rhymix. It allows absolute or relative path, and if the url starts with \'http://\' , it can display the external page of the server.';
$lang->about_opage_path = 'Please enter the location of external document. Both absolute path such as \'/path1/path2/sample.php\' or relative path such as \'../path2/sample.php\' can be used. If you input the path like \'http://url/sample.php\', the result will be received and then displayed. This is current Rhymix\'s absolute path. ';
$lang->opage_mobile_path = 'Location of External Document for Mobile View';
$lang->opage_mobile_path = 'Location of External Document for Mobile';
$lang->about_opage_mobile_path = 'Please enter the location of external document for mobile view. If not inputted, it uses the external document specified above. Both absolute path such as \'/path1/path2/sample.php\' or relative path such as \'../path2/sample.php\' can be used. If you input the path like \'http://url/sample.php\', the result will be received and then displayed. This is current Rhymix\'s absolute path. ';
$lang->opage_postprocessing = 'Postprocessing';
$lang->about_opage_postprocessing = 'Parse and execute the external document as a PHP script and/or Rhymix template. This does not apply to URL paths.<br />Beware that executing untrusted sources can lead to security problems.';
$lang->opage_proc_php = 'Execute PHP code';
$lang->opage_proc_tpl = 'Parse as Rhymix template';
$lang->page_management = 'Manage of page';
$lang->page_delete_warning = 'If you delete a page, the files of the page will be removed also.';

View file

@ -15,11 +15,15 @@ $lang->page_type_name['ARTICLE'] = '문서 페이지';
$lang->page_type_name['WIDGET'] = '위젯 페이지';
$lang->page_type_name['OUTSIDE'] = '외부 페이지';
$lang->about_page_type = '페이지 타입을 선택하여 원하는 화면을 구성할 수 있습니다. <ol><li>위젯형 : 여러가지 위젯들을 생성하여 화면을 구성합니다.</li><li>문서형 : 제목, 내용, 태그를 갖는 문서를 제작하여 포스팅 형식의 페이지를 작성합니다. </li><li>외부페이지형 : 외부 HTML 또는 PHP 파일을 Rhymix에서 사용할 수 있습니다.</li></ol>';
$lang->opage_path = '외부 문서 위치';
$lang->about_opage = 'Rhymix가 아닌 외부 HTML 또는 PHP 파일을 삽입할 수 있습니다. 절대경로, 상대경로를 이용할 수 있으며 http:// 로 시작할 경우 서버 외부의 페이지도 표시할 수 있습니다';
$lang->opage_path = 'PC용 외부 문서 위치';
$lang->about_opage = 'Rhymix가 아닌 외부 HTML 또는 PHP 파일을 삽입할 수 있습니다. 절대경로, 상대경로를 이용할 수 있으며 http:// 또는 https://로 시작할 경우 서버 외부의 페이지도 표시할 수 있습니다';
$lang->about_opage_path = '외부문서의 위치를 입력해주세요. /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다. http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다. 현재 Rhymix가 설치된 절대경로는 다음과 같습니다. ';
$lang->opage_mobile_path = '모바일용 외부 문서 위치';
$lang->about_opage_mobile_path = '모바일용 외부문서의 위치를 입력해주세요. 입력하지 않으면 위에서 지정한 외부문서 위치의 페이지를 이용합니다. /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다. http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다. 현재 Rhymix가 설치된 절대경로는 다음과 같습니다. ';
$lang->opage_postprocessing = '외부 문서 후처리';
$lang->about_opage_postprocessing = '외부 문서의 내용을 PHP 및 Rhymix 템플릿 문법에 따라 해석하도록 할 수 있습니다. http:// 또는 https://로 시작하는 외부 페이지에는 적용되지 않습니다.<br />신뢰할 수 없는 문서를 실행할 경우 보안상 위협의 될 수 있으니 주의하십시오.';
$lang->opage_proc_php = 'PHP 코드 실행';
$lang->opage_proc_tpl = '템플릿 해석';
$lang->page_management = '페이지 관리';
$lang->page_delete_warning = '페이지를 삭제할 때 파일도 함께 삭제합니다';
$lang->msg_not_selected_page = '선택한 페이지가 없습니다.';

View file

@ -28,6 +28,8 @@ class pageAdminController extends page
$args->mid = $args->page_name; //because if mid is empty in context, set start page mid
$args->path = (!$args->path) ? '' : $args->path;
$args->mpath = (!$args->mpath) ? '' : $args->mpath;
$args->opage_proc_php = $args->opage_proc_php ?? 'N';
$args->opage_proc_tpl = $args->opage_proc_tpl ?? 'N';
unset($args->page_name);
if($args->use_mobile != 'Y') $args->use_mobile = '';

View file

@ -99,6 +99,20 @@
<p class="x_help-block" id="aboutOpageMobilePath">{$lang->about_opage_mobile_path}<b>{realpath("./")}</b></p>
</div>
</div>
<div class="x_control-group" cond="$module_info->page_type == 'OUTSIDE'">
<label class="x_control-label">{$lang->opage_postprocessing}</label>
<div class="x_controls">
<label for="opage_proc_php" class="x_inline">
<input type="checkbox" name="opage_proc_php" id="opage_proc_php" value="Y" checked="checked"|cond="($module_info->opage_proc_php ?? 'Y') === 'Y'" />
{$lang->opage_proc_php}
</label>
<label for="opage_proc_tpl" class="x_inline">
<input type="checkbox" name="opage_proc_tpl" id="opage_proc_tpl" value="Y" checked="checked"|cond="($module_info->opage_proc_tpl ?? 'N') === 'Y'" />
{$lang->opage_proc_tpl}
</label>
<p class="x_help-block">{$lang->about_opage_postprocessing}</p>
</div>
</div>
<div class="x_control-group" cond="$module_info->page_type == 'ARTICLE'">
<label class="x_control-label" for="skin">{$lang->skin}</label>
<div class="x_controls">