mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Merge branch 'rhymix:master' into master
This commit is contained in:
commit
d327bb1926
43 changed files with 588 additions and 221 deletions
|
|
@ -185,6 +185,11 @@ body>.x,
|
|||
height: 24px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.x .x_pagination {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
.x .btn {
|
||||
color: #333;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1299,7 +1299,7 @@ jQuery(function($){
|
|||
position = {x:event.pageX, y:event.pageY};
|
||||
offset = getOffset($tr.get(0), ofspar);
|
||||
|
||||
$clone = $tr.attr('target', true).clone(true).appendTo($table);
|
||||
$clone = $tr.attr('target', true).clone(true).find('input').removeAttr('id name').end().appendTo($table);
|
||||
|
||||
// get colspan
|
||||
cols = ($th=$table.find('thead th')).length;
|
||||
|
|
|
|||
|
|
@ -290,30 +290,30 @@ class BoardController extends Board
|
|||
public function procBoardRevertDocument()
|
||||
{
|
||||
$update_id = Context::get('update_id');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$update_id)
|
||||
if (!$update_id)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_no_update_id');
|
||||
}
|
||||
|
||||
$oDocumentController = DocumentController::getInstance();
|
||||
$update_log = DocumentModel::getUpdateLog($update_id);
|
||||
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
$Exists_log = DocumentModel::getUpdateLogAdminisExists($update_log->document_srl);
|
||||
if($Exists_log === true)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_admin_update_log');
|
||||
}
|
||||
}
|
||||
|
||||
if(!$update_log)
|
||||
if (!$update_log)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_no_update_log');
|
||||
}
|
||||
|
||||
$oDocument = DocumentModel::getDocument($update_log->document_srl);
|
||||
if (!$oDocument->isGranted())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted();
|
||||
}
|
||||
if (!$this->user->isAdmin())
|
||||
{
|
||||
if (DocumentModel::getUpdateLogAdminisExists($update_log->document_srl))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_admin_update_log');
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->title = $update_log->title;
|
||||
$obj->document_srl = $update_log->document_srl;
|
||||
|
|
@ -322,10 +322,19 @@ class BoardController extends Board
|
|||
$obj->content = $update_log->content;
|
||||
$obj->update_log_setting = 'Y';
|
||||
$obj->reason_update = lang('board.revert_reason_update');
|
||||
$oDocumentController = DocumentController::getInstance();
|
||||
$output = $oDocumentController->updateDocument($oDocument, $obj);
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'),'act', '', 'document_srl', $update_log->document_srl));
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->add('mid', Context::get('mid'));
|
||||
$this->add('document_srl', $update_log->document_srl);
|
||||
$this->setRedirectUrl(getNotEncodedUrl([
|
||||
'mid' => Context::get('mid'),
|
||||
'document_srl' => $update_log->document_srl,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1524,6 +1524,12 @@ class BoardView extends Board
|
|||
throw new Rhymix\Framework\Exception('msg_not_target');
|
||||
}
|
||||
|
||||
$features = Rhymix\Modules\Board\Models\Features::fromModuleInfo($this->module_info);
|
||||
if (!$features->{$target}->vote_log)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
}
|
||||
|
||||
$output = executeQueryArray($queryId, $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -1538,7 +1544,11 @@ class BoardView extends Board
|
|||
{
|
||||
if($log->point > 0)
|
||||
{
|
||||
if($log->member_srl == $vote_member_infos[$log->member_srl]->member_srl)
|
||||
if (isset($vote_member_infos[$log->member_srl]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!$features->{$target}->vote_up_log)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1546,7 +1556,11 @@ class BoardView extends Board
|
|||
}
|
||||
else
|
||||
{
|
||||
if($log->member_srl == $blame_member_infos[$log->member_srl]->member_srl)
|
||||
if (isset($blame_member_infos[$log->member_srl]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!$features->{$target}->vote_down_log)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1554,6 +1568,8 @@ class BoardView extends Board
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context::set('board_features', $features);
|
||||
Context::set('vote_member_info', $vote_member_infos);
|
||||
Context::set('blame_member_info', $blame_member_infos);
|
||||
$this->setTemplateFile('vote_log');
|
||||
|
|
|
|||
|
|
@ -61,8 +61,10 @@ class Features
|
|||
|
||||
// Document features
|
||||
$features->document->vote_up = ($document_config->use_vote_up ?? 'Y') !== 'N';
|
||||
$features->document->vote_up_log = ($document_config->use_vote_up ?? 'Y') === 'S';
|
||||
$features->document->vote_down = ($document_config->use_vote_down ?? 'Y') !== 'N';
|
||||
$features->document->vote_log = ($document_config->use_vote_up ?? 'Y') === 'S' || ($document_config->use_vote_down ?? 'Y') === 'S';
|
||||
$features->document->vote_down_log = ($document_config->use_vote_down ?? 'Y') === 'S';
|
||||
$features->document->vote_log = $features->document->vote_up_log || $features->document->vote_down_log;
|
||||
if (isset($document_config->allow_vote_cancel))
|
||||
{
|
||||
$features->document->cancel_vote = $document_config->allow_vote_cancel === 'Y';
|
||||
|
|
@ -92,8 +94,10 @@ class Features
|
|||
|
||||
// Comment features
|
||||
$features->comment->vote_up = ($comment_config->use_vote_up ?? 'Y') !== 'N';
|
||||
$features->comment->vote_up_log = ($comment_config->use_vote_up ?? 'Y') === 'S';
|
||||
$features->comment->vote_down = ($comment_config->use_vote_down ?? 'Y') !== 'N';
|
||||
$features->comment->vote_log = ($comment_config->use_vote_up ?? 'Y') === 'S' || ($comment_config->use_vote_down ?? 'Y') === 'S';
|
||||
$features->comment->vote_down_log = ($comment_config->use_vote_down ?? 'Y') === 'S';
|
||||
$features->comment->vote_log = $features->comment->vote_up_log || $features->comment->vote_down_log;
|
||||
if (isset($comment_config->allow_vote_cancel))
|
||||
{
|
||||
$features->comment->cancel_vote = $comment_config->allow_vote_cancel === 'Y';
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
<!--@if($board_features->document->vote_log)-->
|
||||
<a class="btn" href="{getUrl('', 'mid', $mid, 'act', 'dispBoardVoteLog', 'target_srl', $oDocument->document_srl, 'target', 'document')}"><i class="xi-list-ul"></i>{$lang->cmd_document_vote_user}</a>
|
||||
<!--@endif-->
|
||||
<!--@if($board_features->document->history)-->
|
||||
<!--@if($module_info->update_log == 'Y' && $grant->can('update_view'))-->
|
||||
<a cond="$update_view" class="btn" href="{getUrl('', 'mid', $mid, 'act', 'dispBoardUpdateLog', 'document_srl', $oDocument->document_srl)}"><i class="xi-list-ul"></i>{$lang->update_log}</a>
|
||||
<!--@endif-->
|
||||
<a cond="$oDocument->isEditable()" class="btn" href="{getUrl('', 'mid', $mid, 'act', 'dispBoardWrite', 'document_srl', $oDocument->document_srl)}"><i class="xi-eraser"></i>{$lang->cmd_modify}</a>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<column name="voted_count" type="number" size="11" default="0" notnull="notnull" index="idx_voted_count" />
|
||||
<column name="blamed_count" type="number" size="11" default="0" notnull="notnull" index="idx_blamed_count" />
|
||||
<column name="notify_message" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="password" type="varchar" size="60" />
|
||||
<column name="password" type="varchar" size="250" />
|
||||
<column name="user_id" type="varchar" size="80" />
|
||||
<column name="user_name" type="varchar" size="80" notnull="notnull" />
|
||||
<column name="nick_name" type="varchar" size="80" notnull="notnull" index="idx_nick_name" />
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<form action="./" class="x_pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
|
|
|
|||
|
|
@ -139,11 +139,11 @@ class CommunicationView extends communication
|
|||
|
||||
if ($message)
|
||||
{
|
||||
Context::addBrowserTitle($message->title);
|
||||
MemberView::setMemberPageBrowserTitle($message->title);
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::addBrowserTitle(lang('communication.message_box.' . $message_type));
|
||||
MemberView::setMemberPageBrowserTitle(lang('communication.message_box.' . $message_type));
|
||||
}
|
||||
|
||||
$this->setTemplateFile($template_filename);
|
||||
|
|
@ -186,7 +186,7 @@ class CommunicationView extends communication
|
|||
Context::set('message', $message);
|
||||
}
|
||||
|
||||
Context::addBrowserTitle($message->title ?? lang('cmd_view_message_box'));
|
||||
MemberView::setMemberPageBrowserTitle($message->title ?? lang('cmd_view_message_box'));
|
||||
$this->setTemplateFile('new_message');
|
||||
}
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ class CommunicationView extends communication
|
|||
$editor = $oEditorModel->getEditor(getNextSequence(), $option);
|
||||
$editor = $editor . "\n" . '<input type="hidden" name="temp_srl" value="" />' . "\n";
|
||||
Context::set('editor', $editor);
|
||||
Context::addBrowserTitle(lang('cmd_send_message'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('cmd_send_message'));
|
||||
$this->setTemplateFile('send_message');
|
||||
|
||||
// Fix for skins that don't support window_type=self
|
||||
|
|
@ -387,7 +387,7 @@ class CommunicationView extends communication
|
|||
Context::set('friend_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_friend'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('cmd_view_friend'));
|
||||
$this->setTemplateFile('friends');
|
||||
}
|
||||
|
||||
|
|
@ -460,7 +460,7 @@ class CommunicationView extends communication
|
|||
$friend_group_list = $oCommunicationModel->getFriendGroups();
|
||||
Context::set('friend_group_list', $friend_group_list);
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_add_friend'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('cmd_add_friend'));
|
||||
$this->setTemplateFile('add_friend');
|
||||
|
||||
// Fix for skins that don't support window_type=self
|
||||
|
|
@ -524,7 +524,7 @@ class CommunicationView extends communication
|
|||
}
|
||||
}
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_add_friend_group'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('cmd_add_friend_group'));
|
||||
$this->setTemplateFile('add_friend_group');
|
||||
|
||||
// Fix for skins that don't support window_type=self
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<column name="comment_count" type="number" size="11" default="0" notnull="notnull" index="idx_comment_count" />
|
||||
<column name="trackback_count" type="number" size="11" default="0" notnull="notnull" index="idx_trackback_count" />
|
||||
<column name="uploaded_count" type="number" size="11" default="0" notnull="notnull" index="idx_uploaded_count" />
|
||||
<column name="password" type="varchar" size="60" />
|
||||
<column name="password" type="varchar" size="250" />
|
||||
<column name="user_id" type="varchar" size="80" />
|
||||
<column name="user_name" type="varchar" size="80" notnull="notnull" />
|
||||
<column name="nick_name" type="varchar" size="80" notnull="notnull" index="idx_nick_name" />
|
||||
|
|
|
|||
|
|
@ -72,16 +72,15 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<div class="x_btn-group x_pull-right">
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="trash">{$lang->trash}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="delete">{$lang->delete}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="move">{$lang->move}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="copy">{$lang->copy}</a>
|
||||
</div>
|
||||
<div class="x_btn-group x_pull-right">
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="trash">{$lang->trash}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="delete">{$lang->delete}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="move">{$lang->move}</a>
|
||||
<a href="#manageForm" class="x_btn modalAnchor" data-value="copy">{$lang->copy}</a>
|
||||
</div>
|
||||
</form>
|
||||
<form action="./" class="x_pagination x_pull-left" style="margin:-36px 0 0 0">
|
||||
|
||||
<form action="./" class="x_pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
|
|
|
|||
|
|
@ -190,10 +190,15 @@ class Value
|
|||
{
|
||||
return $this->default;
|
||||
}
|
||||
elseif (is_array($this->options))
|
||||
|
||||
if (is_array($this->options))
|
||||
{
|
||||
return $this->default;
|
||||
}
|
||||
elseif ($this->default)
|
||||
{
|
||||
return array_first($this->getOptions());
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,7 @@ class FileController extends File
|
|||
{
|
||||
$adjusted['type'] = 'mp4';
|
||||
}
|
||||
elseif (!empty($config->image_autoconv[$image_info['type']]))
|
||||
elseif (!empty($config->image_autoconv[$image_info['type']]) && tobool($config->image_autoconv[$image_info['type']]))
|
||||
{
|
||||
$adjusted['type'] = $config->image_autoconv[$image_info['type']];
|
||||
}
|
||||
|
|
@ -1723,14 +1723,18 @@ class FileController extends File
|
|||
// Get a full list of attachments
|
||||
$args = new stdClass;
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('file.getModuleFiles', $args);
|
||||
if(!$output->toBool() || empty($file_list = $output->data))
|
||||
$output = executeQueryArray('file.getModuleFilesProper', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
if (!$output->data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete the file
|
||||
return $this->deleteFile($file_list);
|
||||
// Delete each file.
|
||||
return $this->deleteFile($output->data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1971,8 +1975,16 @@ class FileController extends File
|
|||
function triggerMoveDocument($obj)
|
||||
{
|
||||
$obj->upload_target_srls = $obj->document_srls;
|
||||
executeQuery('file.updateFileModule', $obj);
|
||||
executeQuery('file.updateFileModuleComment', $obj);
|
||||
$output = executeQuery('file.updateFileModule', $obj);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
$output = executeQuery('file.updateFileModuleComment', $obj);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function triggerAddCopyDocument(&$obj)
|
||||
|
|
|
|||
31
modules/file/queries/getModuleFilesProper.xml
Normal file
31
modules/file/queries/getModuleFilesProper.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<query id="getModuleFilesProper" action="select">
|
||||
<tables>
|
||||
<table name="files" />
|
||||
<table name="documents" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="files.upload_target_srl" default="documents.document_srl" />
|
||||
</conditions>
|
||||
</table>
|
||||
<table name="comments" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="files.upload_target_srl" default="comments.comment_srl" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="files.*" />
|
||||
<column name="documents.module_srl" alias="d_module_srl" />
|
||||
<column name="comments.module_srl" alias="c_module_srl" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="files.module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="documents.module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="null" column="documents.module_srl" pipe="or" />
|
||||
</group>
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="comments.module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="null" column="comments.module_srl" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<query id="updateFileModuleComment" action="update">
|
||||
<tables>
|
||||
<table name="files" />
|
||||
<table name="comments" />
|
||||
<table name="files" alias="f" />
|
||||
<table name="comments" alias="c" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="files.module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<column name="f.module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="files.upload_target_srl" default="comments.comment_srl" />
|
||||
<condition operation="in" column="comments.document_srl" var="upload_target_srls" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="f.upload_target_srl" default="c.comment_srl" />
|
||||
<condition operation="in" column="c.document_srl" var="upload_target_srls" filter="number" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<p>
|
||||
Copyright © Rhymix Developers and Contributors<br />
|
||||
Copyright © Poesis Inc. and Contributors<br />
|
||||
Copyright © <a href="https://navercorp.com/" target="_blank">NAVER</a> & <a href="https://www.xehub.io/" target="_blank">XEHub</a>
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<p>
|
||||
Copyright © Rhymix Developers and Contributors<br />
|
||||
Copyright © Poesis Inc. and Contributors<br />
|
||||
Copyright © <a href="https://navercorp.com/" target="_blank">NAVER</a> & <a href="https://www.xehub.io/" target="_blank">XEHub</a>
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) Rhymix <https://rhymix.org> */
|
||||
/**
|
||||
* The view class of the integration_search module
|
||||
*
|
||||
* @author Rhymix Developers and Contributors <devops@rhymix.org>
|
||||
*/
|
||||
|
||||
class integration_searchMobile extends integration_searchView
|
||||
{
|
||||
/**
|
||||
* Search Result
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function IS()
|
||||
{
|
||||
parent::IS();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -390,6 +390,7 @@ class LayoutAdminController extends Layout
|
|||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
|
||||
$filename = strtolower($source['name']);
|
||||
$filename = Rhymix\Framework\Filters\FilenameFilter::clean($filename);
|
||||
if($filename != urlencode($filename))
|
||||
{
|
||||
$ext = substr(strrchr($filename,'.'),1);
|
||||
|
|
@ -407,9 +408,19 @@ class LayoutAdminController extends Layout
|
|||
*/
|
||||
function procLayoutAdminUserImageDelete()
|
||||
{
|
||||
$filename = Context::get('filename');
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$this->removeUserLayoutImage($layout_srl,$filename);
|
||||
if (!$layout_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest();
|
||||
}
|
||||
|
||||
$filename = Context::get('filename');
|
||||
if (preg_match('!(\.\.|[/\\\\])!', $filename))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest();
|
||||
}
|
||||
|
||||
$this->removeUserLayoutImage($layout_srl, $filename);
|
||||
$this->setMessage('success_deleted');
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
|
@ -418,13 +429,19 @@ class LayoutAdminController extends Layout
|
|||
* delete image into user layout
|
||||
* @param int $layout_srl
|
||||
* @param string $filename
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
function removeUserLayoutImage($layout_srl,$filename)
|
||||
{
|
||||
$oLayoutModel = getModel('layout');
|
||||
$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
|
||||
@unlink($path . $filename);
|
||||
$path = FileHandler::getRealPath($path . Rhymix\Framework\Filters\FilenameFilter::clean($filename));
|
||||
if (!Rhymix\Framework\Storage::exists($path))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound();
|
||||
}
|
||||
|
||||
return Rhymix\Framework\Storage::delete($path);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
|
|
|
|||
|
|
@ -1788,7 +1788,10 @@ class MemberController extends Member
|
|||
$chk_args = new stdClass;
|
||||
$chk_args->member_srl = $member_info->member_srl;
|
||||
$output = executeQuery('member.chkAuthMail', $chk_args);
|
||||
if($output->toBool() && $output->data->count != '0') throw new Rhymix\Framework\Exception('msg_user_not_confirmed');
|
||||
if ($output->toBool() && $output->data->count > 0)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception(sprintf('msg_user_not_confirmed', $member_info->email_address));
|
||||
}
|
||||
}
|
||||
|
||||
// Get password reset method
|
||||
|
|
|
|||
|
|
@ -114,6 +114,24 @@ class MemberView extends Member
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the browser title for a page belonging to the member menu.
|
||||
*
|
||||
* @param string $title
|
||||
* @return void
|
||||
*/
|
||||
public static function setMemberPageBrowserTitle(string $title): void
|
||||
{
|
||||
$seo_title = config('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE';
|
||||
$seo_title = Context::replaceUserLang($seo_title);
|
||||
Context::setBrowserTitle($seo_title, array(
|
||||
'site_title' => Context::getSiteTitle(),
|
||||
'site_subtitle' => Context::getSiteSubtitle(),
|
||||
'subpage_title' => $title,
|
||||
'page' => Context::get('page') ?: 1,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Module index
|
||||
*/
|
||||
|
|
@ -181,7 +199,7 @@ class MemberView extends Member
|
|||
$member_info->group_list[$key] = Context::replaceUserLang($val, true);
|
||||
}
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_member_info'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_member_info'));
|
||||
Context::set('memberInfo', get_object_vars($member_info));
|
||||
|
||||
$extendForm = MemberModel::getCombineJoinForm($member_info);
|
||||
|
|
@ -376,7 +394,7 @@ class MemberView extends Member
|
|||
$member_config->agreement = $member_config->agreements[1]->content ?? '';
|
||||
|
||||
// Set a template file
|
||||
Context::addBrowserTitle(lang('cmd_signup'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_signup'));
|
||||
$this->setTemplateFile('signup_form');
|
||||
}
|
||||
|
||||
|
|
@ -413,7 +431,7 @@ class MemberView extends Member
|
|||
Context::set('identifierValue', $logged_info->user_id);
|
||||
}
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_modify_member_info'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_modify_member_info'));
|
||||
$this->setTemplateFile('rechecked_password');
|
||||
}
|
||||
|
||||
|
|
@ -499,7 +517,7 @@ class MemberView extends Member
|
|||
$this->addExtraFormValidatorMessage();
|
||||
|
||||
// Set a template file
|
||||
Context::addBrowserTitle(lang('cmd_modify_member_info'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_modify_member_info'));
|
||||
$this->setTemplateFile('modify_info');
|
||||
}
|
||||
|
||||
|
|
@ -550,7 +568,7 @@ class MemberView extends Member
|
|||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('document_list...title', 'search_target', 'search_keyword');
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_own_document'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_own_document'));
|
||||
$this->setTemplateFile('document_list');
|
||||
}
|
||||
|
||||
|
|
@ -598,7 +616,7 @@ class MemberView extends Member
|
|||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('search_target', 'search_keyword');
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_own_comment'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_own_comment'));
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
|
||||
|
|
@ -708,7 +726,7 @@ class MemberView extends Member
|
|||
$security = new Security($output->data);
|
||||
$security->encodeHTML('..nick_name');
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_scrapped_document'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_scrapped_document'));
|
||||
$this->setTemplateFile('scrapped_list');
|
||||
}
|
||||
|
||||
|
|
@ -743,7 +761,7 @@ class MemberView extends Member
|
|||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_saved_document'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_saved_document'));
|
||||
$this->setTemplateFile('saved_list');
|
||||
}
|
||||
|
||||
|
|
@ -783,7 +801,7 @@ class MemberView extends Member
|
|||
$output = executeQueryArray('member.getMemberDevice', $args);
|
||||
Context::set('registered_devices', $output->data);
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_view_active_logins'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_view_active_logins'));
|
||||
$this->setTemplateFile('active_logins');
|
||||
}
|
||||
|
||||
|
|
@ -822,7 +840,7 @@ class MemberView extends Member
|
|||
}
|
||||
|
||||
// Set a template file
|
||||
Context::addBrowserTitle(lang('cmd_login'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_login'));
|
||||
$this->setTemplateFile('login_form');
|
||||
}
|
||||
|
||||
|
|
@ -858,7 +876,7 @@ class MemberView extends Member
|
|||
Context::set('formValue', $member_info->email_address);
|
||||
}
|
||||
// Set a template file
|
||||
Context::addBrowserTitle(lang('cmd_modify_member_password'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_modify_member_password'));
|
||||
$this->setTemplateFile('modify_password');
|
||||
}
|
||||
|
||||
|
|
@ -893,7 +911,7 @@ class MemberView extends Member
|
|||
Context::set('formValue', $member_info->email_address);
|
||||
}
|
||||
// Set a template file
|
||||
Context::addBrowserTitle(lang('msg_leave_member'));
|
||||
self::setMemberPageBrowserTitle(lang('msg_leave_member'));
|
||||
$this->setTemplateFile('leave_form');
|
||||
}
|
||||
|
||||
|
|
@ -943,7 +961,7 @@ class MemberView extends Member
|
|||
Context::set('identifier', $this->member_config->identifier);
|
||||
Context::set('enable_find_account_question', 'N');
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_find_member_account'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_find_member_account'));
|
||||
$this->setTemplateFile('find_member_account');
|
||||
}
|
||||
|
||||
|
|
@ -962,7 +980,7 @@ class MemberView extends Member
|
|||
return;
|
||||
}
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_resend_auth_mail'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_resend_auth_mail'));
|
||||
$this->setTemplateFile('resend_auth_mail');
|
||||
}
|
||||
|
||||
|
|
@ -982,7 +1000,7 @@ class MemberView extends Member
|
|||
|
||||
$_SESSION['rechecked_password_step'] = 'INPUT_DATA';
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_modify_member_email_address'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_modify_member_email_address'));
|
||||
$this->setTemplateFile('modify_email_address');
|
||||
}
|
||||
|
||||
|
|
@ -1101,7 +1119,7 @@ class MemberView extends Member
|
|||
Context::set('nickname_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
Context::addBrowserTitle(lang('cmd_modify_nickname_log'));
|
||||
self::setMemberPageBrowserTitle(lang('cmd_modify_nickname_log'));
|
||||
$this->setTemplateFile('member_nick');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class NcenterliteView extends Ncenterlite
|
|||
Context::set('ncenterlite_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
Context::addBrowserTitle(lang('ncenterlite_my_list'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('ncenterlite_my_list'));
|
||||
$this->setTemplateFileOrDefault('NotifyList');
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ class NcenterliteView extends Ncenterlite
|
|||
Context::set('sms_available', Rhymix\Framework\SMS::getDefaultDriver()->getName() !== 'Dummy');
|
||||
Context::set('push_available', count(Rhymix\Framework\Config::get('push.types') ?? []) > 0);
|
||||
|
||||
Context::addBrowserTitle(lang('ncenterlite_my_settings'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('ncenterlite_my_settings'));
|
||||
$this->setTemplateFileOrDefault('userconfig');
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class NcenterliteView extends Ncenterlite
|
|||
Context::set('unsubscribe_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
Context::addBrowserTitle(lang('unsubscribe_list'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('unsubscribe_list'));
|
||||
$this->setTemplateFileOrDefault('unsubscribeList');
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ class NcenterliteView extends Ncenterlite
|
|||
Context::set('text', $text);
|
||||
Context::set('type', $type);
|
||||
|
||||
Context::addBrowserTitle(lang('unsubscribe_list'));
|
||||
MemberView::setMemberPageBrowserTitle(lang('unsubscribe_list'));
|
||||
$this->setTemplateFileOrDefault('unsubscribe');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -305,8 +305,17 @@ class PageAdminView extends Page
|
|||
Context::set('oDocument', $oDocument);
|
||||
Context::set('mid', $this->module_info->mid);
|
||||
|
||||
$this->setLayoutFile('');
|
||||
$this->setTemplateFile('article_content_modify');
|
||||
$this->setLayoutAndTemplatePaths($isMobile ? 'M' : 'P', $this->module_info);
|
||||
$skin_path = rtrim($this->getTemplatePath(), '/') . '/';
|
||||
if (file_exists($skin_path . 'content_modify.blade.php') || file_exists($skin_path . 'content_modify.html'))
|
||||
{
|
||||
$this->setTemplateFile('content_modify');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('article_content_modify');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ class PointModel extends Point
|
|||
}
|
||||
|
||||
// Get from file cache
|
||||
$cache_path = sprintf(RX_BASEDIR . 'files/member_extra_info/point/%s', getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl);
|
||||
if (!$from_db && !$use_cache)
|
||||
{
|
||||
$cache_path = sprintf(RX_BASEDIR . 'files/member_extra_info/point/%s', getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl);
|
||||
if (file_exists($cache_filename))
|
||||
{
|
||||
$point = trim(Rhymix\Framework\Storage::read($cache_filename));
|
||||
|
|
|
|||
|
|
@ -383,60 +383,49 @@ class WidgetController extends Widget
|
|||
$widget_cache = intval(floatval($widget_cache) * 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* Even if the cache number and value of the cache and return it to extract data
|
||||
*/
|
||||
// If widget cache is disabled, just execute the widget and return the result.
|
||||
if(!$ignore_cache && !$widget_cache)
|
||||
{
|
||||
$oWidget = $this->getWidgetObject($widget);
|
||||
if(!$oWidget || !method_exists($oWidget, 'proc')) return;
|
||||
if (!$oWidget || !method_exists($oWidget, 'proc'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$widget_content = $oWidget->proc($args);
|
||||
$widget_content = Context::replaceUserLang($widget_content);
|
||||
return $widget_content;
|
||||
return Context::replaceUserLang($widget_content);
|
||||
}
|
||||
|
||||
$cache_data = Rhymix\Framework\Cache::get('widget_cache:' . $widget_sequence);
|
||||
if ($cache_data)
|
||||
// If cached data exists, return it.
|
||||
$cache_key = 'widget_cache:' . $widget_sequence . ':' . $lang_type;
|
||||
$cache_data = Rhymix\Framework\Cache::get($cache_key);
|
||||
if (is_object($cache_data) && isset($cache_data->assets))
|
||||
{
|
||||
// Load the variables, need to load the LESS or SCSS files.
|
||||
if(is_object($cache_data))
|
||||
foreach ($cache_data->assets as $asset)
|
||||
{
|
||||
foreach ($cache_data->variables as $key => $value)
|
||||
{
|
||||
Context::set($key, $value);
|
||||
}
|
||||
$cache_data = $cache_data->content;
|
||||
Context::loadFile($asset);
|
||||
}
|
||||
return str_replace('<!--#Meta:', '<!--Meta:', $cache_data);
|
||||
return Context::replaceUserLang($cache_data->content);
|
||||
}
|
||||
|
||||
// Otherwise, execute the widget, cache the result, and return it.
|
||||
$oWidget = $this->getWidgetObject($widget);
|
||||
if(!$oWidget || !method_exists($oWidget,'proc')) return;
|
||||
if (!$oWidget || !method_exists($oWidget, 'proc'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oFrontEndFileHandler = FrontEndFileHandler::getInstance();
|
||||
$oFrontEndFileHandler->startLog();
|
||||
|
||||
$widget_content = $oWidget->proc($args);
|
||||
$widget_content = Context::replaceUserLang($widget_content);
|
||||
|
||||
Rhymix\Framework\Cache::set('widget_cache:' . $widget_sequence, $widget_content, $widget_cache, true);
|
||||
$cache_data = new stdClass;
|
||||
$cache_data->assets = $oFrontEndFileHandler->endLog();
|
||||
$cache_data->content = $widget_content;
|
||||
Rhymix\Framework\Cache::set($cache_key, $cache_data, $widget_cache, true);
|
||||
|
||||
// Keep the variables, need to load the LESS or SCSS files.
|
||||
if(preg_match_all('/<!--#Meta:([a-z0-9\_\-\/\.\@\:]+)(\?\$\_\_Context\-\>[a-z0-9\_\-\/\.\@\:]+)?-->/is', $widget_content, $widget_var_matches, PREG_SET_ORDER))
|
||||
{
|
||||
$cache_content = new stdClass();
|
||||
$cache_content->content = $widget_content;
|
||||
$cache_content->variables = new stdClass();
|
||||
foreach($widget_var_matches as $matches)
|
||||
{
|
||||
if(isset($matches[2]) && $matches[2])
|
||||
{
|
||||
$key = str_replace('?$__Context->', '', $matches[2]);
|
||||
$cache_content->variables->{$key} = Context::get($key);
|
||||
}
|
||||
}
|
||||
Rhymix\Framework\Cache::set('widget_cache:' . $widget_sequence, $cache_content, $widget_cache, true);
|
||||
}
|
||||
|
||||
return $widget_content;
|
||||
return Context::replaceUserLang($widget_content);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -450,14 +439,21 @@ class WidgetController extends Widget
|
|||
// Save for debug run-time widget
|
||||
$start = microtime(true);
|
||||
|
||||
// urldecode the value of args haejum
|
||||
$object_vars = get_object_vars($args);
|
||||
if(count($object_vars))
|
||||
// Type juggling
|
||||
if (is_array($args))
|
||||
{
|
||||
foreach($object_vars as $key => $val)
|
||||
$args = (object)$args;
|
||||
}
|
||||
|
||||
// Apply urldecode for backward compatibility
|
||||
if ($escaped)
|
||||
{
|
||||
foreach (get_object_vars($args) ?: [] as $key => $val)
|
||||
{
|
||||
if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue;
|
||||
if($escaped) $args->{$key} = utf8RawUrlDecode($val);
|
||||
if (!in_array($key, ['body', 'class', 'style', 'document_srl', 'widget', 'widget_sequence', 'widgetstyle', 'widgetbox_content', 'widget_padding_left', 'widget_padding_top', 'widget_padding_bottom', 'widget_padding_right']))
|
||||
{
|
||||
$args->{$key} = utf8RawUrlDecode($val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -810,10 +806,14 @@ class WidgetController extends Widget
|
|||
|
||||
if($vars->widget_sequence)
|
||||
{
|
||||
Rhymix\Framework\Cache::delete('widget_cache:' . $vars->widget_sequence);
|
||||
$lang_type = Context::getLangType();
|
||||
Rhymix\Framework\Cache::delete('widget_cache:' . $vars->widget_sequence . ':' . $lang_type);
|
||||
}
|
||||
|
||||
if($vars->widget_cache>0) $vars->widget_sequence = getNextSequence();
|
||||
if($vars->widget_cache > 0)
|
||||
{
|
||||
$vars->widget_sequence = getNextSequence();
|
||||
}
|
||||
|
||||
$attribute = array();
|
||||
foreach($vars as $key => $val)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue