Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2025-07-15 10:09:11 +09:00 committed by GitHub
commit e15c8f4e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 99 additions and 63 deletions

View file

@ -7,6 +7,7 @@ use MenuAdminController;
use MenuAdminModel;
use Rhymix\Framework\Cache;
use Rhymix\Framework\Storage;
use Rhymix\Framework\Exceptions\TargetNotFound;
use Rhymix\Modules\Admin\Models\AdminMenu as AdminMenuModel;
use Rhymix\Modules\Admin\Models\Favorite as FavoriteModel;
@ -64,6 +65,10 @@ class AdminMenu extends Base
{
// Check if favorite exists.
$module_name = Context::get('module_name');
if (!$module_name)
{
throw new TargetNotFound();
}
$output = FavoriteModel::isFavorite($module_name);
if(!$output->toBool())
{

View file

@ -117,7 +117,7 @@
<div class="x_control-group">
<label class="x_control-label" for="html_header">{$lang->input_header_script}</label>
<div class="x_controls">
<textarea name="html_header" id="html_header" rows="6" class="x_full-width">{$domain_info ? $domain_info->settings->html_header : ''}</textarea>
<textarea name="html_header" id="html_header" rows="6" class="x_full-width x_code-font">{$domain_info ? $domain_info->settings->html_header : ''}</textarea>
<div class="x_help-block">{$lang->detail_input_header_script}</div>
</div>
</div>
@ -125,7 +125,7 @@
<div class="x_control-group">
<label class="x_control-label" for="html_footer">{$lang->input_footer_script}</label>
<div class="x_controls">
<textarea name="html_footer" id="html_footer" rows="6" class="x_full-width">{$domain_info ? $domain_info->settings->html_footer : ''}</textarea>
<textarea name="html_footer" id="html_footer" rows="6" class="x_full-width x_code-font">{$domain_info ? $domain_info->settings->html_footer : ''}</textarea>
<div class="x_help-block">{$lang->detail_input_footer_script}</div>
</div>
</div>

View file

@ -220,7 +220,7 @@
{@ $conf_exists = config("sms.$driver_name.api_key")}
<select type="select" name="sms_{$driver_name}_{$conf_name}" id="sms_{$driver_name}_{$conf_name}">
<!--@foreach($driver_definition['api_urls'] as $api_url => $api_url_name)-->
<option value="{$api_url}" selected="selected"|cond="$conf_value === $api_url || (!$conf_value && $conf_exists && $api_url === array_last_key($driver_definition['api_urls']))">{$api_url_name}</option>
<option value="{$api_url}" selected="selected"|cond="$conf_value === $api_url || (!$conf_value && $conf_exists && $api_url === array_key_last($driver_definition['api_urls']))">{$api_url_name}</option>
<!--@endforeach-->
</select>
</div>

View file

@ -309,9 +309,10 @@
.x .x_uneditable-input{width:206px}
.x input.x_full-width,
.x textarea.x_full-width,
.x .x_uneditable-input.x_full-width{width:calc(100% - 14px)}
.x textarea.x_full-width.lang_code{width:calc(100% - 42px)}
.x textarea{height:auto;min-height:80px;resize:vertical}
.x .x_uneditable-input.x_full-width{width:calc(100% - 14px);resize:vertical}
.x textarea.x_full-width.lang_code{width:calc(100% - 42px);resize:vertical}
.x textarea.x_full-width + textarea.lang_code{width:calc(100% - 42px);resize:vertical}
.x textarea{height:auto;min-height:80px;}
.x textarea,
.x input[type="text"],
.x input[type="password"],
@ -372,6 +373,7 @@
.x textarea:-ms-input-placeholder{color:#999999}
.x input::-webkit-input-placeholder,
.x textarea::-webkit-input-placeholder{color:#999999}
.x textarea.x_code-font, .x textarea.x_code-font + textarea.lang_code { font-family: Consolas, SF Mono, monospace !important; }
.x .x_radio,
.x .x_checkbox{min-height:20px;padding-left:20px}
.x .x_radio input[type="radio"],

View file

@ -18,7 +18,7 @@ class Advanced_MailerController extends Advanced_Mailer
$recipients = $mail->message->getTo() ?: array();
if ($recipients)
{
$first_recipient = array_first_key($recipients);
$first_recipient = array_key_first($recipients);
if ($exception_driver = $this->getSendingMethodForEmailAddress($first_recipient, $config))
{
$driver_class = '\\Rhymix\\Framework\\Drivers\Mail\\' . $exception_driver;
@ -51,7 +51,7 @@ class Advanced_MailerController extends Advanced_Mailer
else
{
$sender = $mail->message->getFrom();
$original_sender_email = $sender ? array_first_key($sender) : null;
$original_sender_email = $sender ? array_key_first($sender) : null;
$original_sender_name = $sender ? array_first($sender) : null;
list($default_from, $default_name) = $this->getDefaultEmailIdentity();
if ($original_sender_email !== $default_from && $default_from)

View file

@ -19,11 +19,12 @@
<li>
<label for="nCategory">{$lang->category}</label>
<select name="category_srl" id="nCategory">
<!--@foreach($category_list as $val)-->
<option <!--@if(!$val->grant)-->disabled="disabled"<!--@endif--> value="{$val->category_srl}" <!--@if($val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl'))-->selected="selected"<!--@endif-->>
{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
<option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" disabled="disabled"|cond="!$val->grant" selected="selected"|cond="$val->grant && (($val->selected && !$oDocument->get('category_srl')) || $val->category_srl == $oDocument->get('category_srl'))">
{str_repeat('&nbsp;&nbsp;', $val->depth)} {$val->title} ({$val->document_count})
</option>
<!--@end-->
<!--@endforeach-->
</select>
</li>
<!--@end-->

View file

@ -14,11 +14,12 @@
<li>
<label for="nCategory" class="db fb">{$lang->category}</label>
<select name="category_srl" id="nCategory">
<!--@foreach($category_list as $val)-->
<option <!--@if(!$val->grant)-->disabled="disabled"<!--@endif--> value="{$val->category_srl}" <!--@if($val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl'))-->selected=="selected"<!--@endif-->>
{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
<option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" disabled="disabled"|cond="!$val->grant" selected="selected"|cond="$val->grant && (($val->selected && !$oDocument->get('category_srl')) || $val->category_srl == $oDocument->get('category_srl'))">
{str_repeat('&nbsp;&nbsp;', $val->depth)} {$val->title} ({$val->document_count})
</option>
<!--@end-->
<!--@endforeach-->
</select>
</li>
<!--@end-->

View file

@ -6,9 +6,11 @@
<div class="write_header">
<select name="category_srl" cond="$module_info->use_category=='Y'">
<option value="">{$lang->category}</option>
<option loop="$category_list => $val" disabled="disabled"|cond="!$val->grant" value="{$val->category_srl}" selected="selected"|cond="$val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl')">
{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
<!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" disabled="disabled"|cond="!$val->grant" selected="selected"|cond="$val->grant && (($val->selected && !$oDocument->get('category_srl')) || $val->category_srl == $oDocument->get('category_srl'))">
{str_repeat('&nbsp;&nbsp;', $val->depth)} {$val->title} ({$val->document_count})
</option>
<!--@endforeach-->
</select>
<input cond="$oDocument->getTitleText()" type="text" name="title" class="iText" title="{$lang->title}" value="{escape($oDocument->getTitleText(), false)}" />
<input cond="!$oDocument->getTitleText()" type="text" name="title" class="iText" title="{$lang->title}" />

View file

@ -6,9 +6,11 @@
<div class="write_header">
<select name="category_srl" cond="$module_info->use_category=='Y'">
<option value="">{$lang->category}</option>
<option loop="$category_list => $val" disabled="disabled"|cond="!$val->grant" value="{$val->category_srl}" selected="selected"|cond="$val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl')">
{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
<!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" disabled="disabled"|cond="!$val->grant" selected="selected"|cond="$val->grant && (($val->selected && !$oDocument->get('category_srl')) || $val->category_srl == $oDocument->get('category_srl'))">
{str_repeat('&nbsp;&nbsp;', $val->depth)} {$val->title} ({$val->document_count})
</option>
<!--@endforeach-->
</select>
<input cond="$oDocument->getTitleText()" type="text" name="title" class="iText" title="{$lang->title}" value="{escape($oDocument->getTitleText(), false)}" />
<input cond="!$oDocument->getTitleText()" type="text" name="title" class="iText" title="{$lang->title}" />

View file

@ -19,7 +19,7 @@
<select name="include_modules[]" id="include_modules" size="8" multiple="multiple">
<option value="">{$lang->cmd_board_include_modules_none}</option>
<!--@foreach($board_list as $board_info)-->
<option value="{$board_info->module_srl}" selected="selected"|cond="in_array($board_info->module_srl, $include_modules)">{$board_info->browser_title}</option>
<option value="{$board_info->module_srl}" selected="selected"|cond="in_array($board_info->module_srl, $include_modules)">{$board_info->browser_title} ({$board_info->mid})</option>
<!--@endforeach-->
</select>
<p class="x_help-block">{$lang->about_board_combined_board}</p>

View file

@ -104,14 +104,14 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_header_text">{$lang->header_text}</label>
<div class="x_controls">
<textarea name="header_text" id="header_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->header_text}</textarea>
<textarea name="header_text" id="header_text" class="x_full-width x_code-font lang_code" rows="8" cols="42">{$module_info->header_text}</textarea>
<p id="header_text_help" class="x_help-block">{$lang->about_header_text}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_footer_text">{$lang->footer_text}</label>
<div class="x_controls">
<textarea name="footer_text" id="footer_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->footer_text}</textarea>
<textarea name="footer_text" id="footer_text" class="x_full-width x_code-font lang_code" rows="8" cols="42">{$module_info->footer_text}</textarea>
<p id="footer_text_help" class="x_help-block">{$lang->about_footer_text}</p>
</div>
</div>
@ -178,14 +178,14 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_mobile_header_text">{$lang->mobile_header_text}</label>
<div class="x_controls">
<textarea name="mobile_header_text" id="mobile_header_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->mobile_header_text}</textarea>
<textarea name="mobile_header_text" id="mobile_header_text" class="x_full-width x_code-font lang_code" rows="8" cols="42">{$module_info->mobile_header_text}</textarea>
<p id="mobile_header_text_help" class="x_help-block">{$lang->about_mobile_header_text}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_mobile_footer_text">{$lang->mobile_footer_text}</label>
<div class="x_controls">
<textarea name="mobile_footer_text" id="mobile_footer_text" class="x_full-width lang_code" rows="8" cols="42">{$module_info->mobile_footer_text}</textarea>
<textarea name="mobile_footer_text" id="mobile_footer_text" class="x_full-width x_code-font lang_code" rows="8" cols="42">{$module_info->mobile_footer_text}</textarea>
<p id="mobile_footer_text_help" class="x_help-block">{$lang->about_mobile_footer_text}</p>
</div>
</div>

View file

@ -11,7 +11,7 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_header_text">{$lang->header_text}</label>
<div class="x_controls">
<textarea name="header_text" id="header_text" class="lang_code" rows="8" cols="42" placeholder="{$lang->about_header_text}">{htmlspecialchars($module_info->header_text)}</textarea>
<textarea name="header_text" id="header_text" class="x_code-font lang_code" rows="8" cols="42" placeholder="{$lang->about_header_text}">{htmlspecialchars($module_info->header_text)}</textarea>
<a href="#header_text_help" class="x_icon-question-sign" data-toggle style="vertical-align:top;margin-top:6px">{$lang->help}</a>
<p id="header_text_help" class="x_help-block" hidden>{$lang->about_header_text}</p>
</div>
@ -19,7 +19,7 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_footer_text">{$lang->footer_text}</label>
<div class="x_controls">
<textarea name="footer_text" id="footer_text" class="lang_code" rows="8" cols="42" placeholder="{$lang->about_footer_text}">{htmlspecialchars($module_info->footer_text)}</textarea>
<textarea name="footer_text" id="footer_text" class="x_code-font lang_code" rows="8" cols="42" placeholder="{$lang->about_footer_text}">{htmlspecialchars($module_info->footer_text)}</textarea>
<a href="#footer_text_help" class="x_icon-question-sign" data-toggle style="vertical-align:top;margin-top:6px">{$lang->help}</a>
<p id="footer_text_help" class="x_help-block" hidden>{$lang->about_footer_text}</p>
</div>

View file

@ -949,8 +949,8 @@ class DocumentController extends Document
{
$this->addGrant($obj->document_srl);
}
$output->add('document_srl',$obj->document_srl);
$output->add('category_srl',$obj->category_srl);
$output->add('document_srl', $obj->document_srl);
$output->add('category_srl', $obj->category_srl);
return $output;
}
@ -1397,7 +1397,8 @@ class DocumentController extends Document
// Remove the thumbnail file
Rhymix\Framework\Storage::deleteDirectory(RX_BASEDIR . sprintf('files/thumbnails/%s', getNumberingPath($obj->document_srl, 3)));
$output->add('document_srl',$obj->document_srl);
$output->add('document_srl', $obj->document_srl);
$output->add('category_srl', $obj->category_srl);
//remove from cache
self::clearDocumentCache($obj->document_srl);

View file

@ -83,7 +83,7 @@
<section class="section">
<h1>HTML<small> - layout.html</small></h1>
<div style="margin-right:14px">
<textarea name="code" rows="8" cols="42" style="width:100%;height:300px;font:12px 'DejaVu Sans Mono', monospace;">{$layout_code}</textarea>
<textarea name="code" rows="8" cols="42" style="width:100%;height:300px;font-size:12px" class="x_full-width x_code-font">{$layout_code}</textarea>
</div>
<div>
<block loop="$widget_list => $widget"> <i>|</i> <a href="{getUrl('','module','admin','act','dispWidgetAdminGenerateCode','selected_widget',$widget->widget)}" target="_blank">{$widget->title}</a></block>
@ -93,7 +93,7 @@
<section class="section">
<h1>CSS<small> - layout.css</small></h1>
<div style="margin-right:14px">
<textarea name="code_css" rows="8" cols="42" style="width:100%;height:300px;font:12px 'DejaVu Sans Mono', monospace;">{$layout_code_css}</textarea>
<textarea name="code_css" rows="8" cols="42" style="width:100%;height:300px;font-size:12px" class="x_full-width x_code-font">{$layout_code_css}</textarea>
</div>
</section>

View file

@ -60,7 +60,7 @@
<section class="section">
<h1>HTML<small> - layout.html</small></h1>
<div style="margin-right:14px">
<textarea name="code" rows="8" cols="42" style="width:100%; height:300px; font:12px 'DejaVu Sans Mono', monospace;">{$layout_code}</textarea>
<textarea name="code" rows="8" cols="42" style="width:100%; height:300px; font-size:12px" class="x_full-width x_code-font">{$layout_code}</textarea>
</div>
<div>
<block loop="$widget_list => $widget"> <i class="vr">|</i> <a href="{getUrl('','module','admin','act','dispWidgetAdminGenerateCode','selected_widget',$widget->widget)}" target="_blank">{$widget->title}</a></block>
@ -84,7 +84,7 @@
<section class="section">
<h1>CSS<small> - layout.css</small></h1>
<div style="margin-right:14px">
<textarea name="code_css" rows="8" cols="42" style="width:100%; height:300px; font:12px 'DejaVu Sans Mono', monospace;">{$layout_code_css}</textarea>
<textarea name="code_css" rows="8" cols="42" style="width:100%; height:300px; font-size:12px" class="x_full-width x_code-font">{$layout_code_css}</textarea>
</div>
</section>

View file

@ -45,7 +45,7 @@
<div class="x_control-group">
<label class="x_control-label" for="header_script">{$lang->header_script}</label>
<div class="x_controls">
<textarea name="header_script" id="header_script" rows="4" cols="42" class="x_full-width">{$selected_layout->header_script}</textarea>
<textarea name="header_script" id="header_script" rows="4" cols="42" class="x_full-width x_code-font">{$selected_layout->header_script}</textarea>
<span class="x_help-block">{$lang->about_header_script}</span>
</div>
</div>

View file

@ -174,11 +174,13 @@ class ModuleAdminModel extends Module
// Get a permission group granted to the current module
$selected_group = array();
$default_xml_grant = array();
$default_grant = array();
foreach ($grant_list as $key => $val)
{
if (!empty($val->default))
{
$default_xml_grant[$key] = $val->default;
$default_grant[$key] = $val->default;
}
}
@ -203,6 +205,7 @@ class ModuleAdminModel extends Module
}
}
Context::set('selected_group', $selected_group);
Context::set('default_xml_grant', $default_xml_grant);
Context::set('default_grant', $default_grant);
Context::set('module_srl', $module_srl);
// Extract admin ID set in the current module

View file

@ -78,7 +78,7 @@
<label class="x_control-label" for="lang_header_text">{$lang->header_text}</label>
<div class="x_controls">
{@$use_multilang_textarea=true}
<textarea id="header_text" name="header_text" class="lang_code" rows="8" cols="42"></textarea>
<textarea id="header_text" name="header_text" rows="8" cols="42" class="x_full-width x_code-font lang_code"></textarea>
<label class="x_inline" for="header_text_delete"><input name="header_text_delete" id="header_text_delete" type="checkbox" value="Y" /> {$lang->cmd_delete}</label>
<p class="x_help-block" style="vertical-align:top">{$lang->about_header_text}</p>
</div>
@ -86,7 +86,7 @@
<div class="x_control-group">
<label class="x_control-label" for="lang_footer_text">{$lang->footer_text}</label>
<div class="x_controls">
<textarea id="footer_text" name="footer_text" class="lang_code" rows="8" cols="42"></textarea>
<textarea id="footer_text" name="footer_text" rows="8" cols="42" class="x_full-width x_code-font lang_code"></textarea>
<label class="x_inline" for="footer_text_delete"><input name="footer_text_delete" id="footer_text_delete" type="checkbox" value="Y" /> {$lang->cmd_delete}</label>
<p class="x_help-block" style="vertical-align:top">{$lang->about_footer_text}</p>
</div>

View file

@ -58,9 +58,11 @@
<label for="{$grant_name}_default" class="x_control-label">{$grant_item->title}</label>
<div class="x_controls">
<select name="{$grant_name}_default" id="{$grant_name}_default" class="grant_default">
<!--@if($default_xml_grant[$grant_name] !== 'manager')-->
<option value="0" <!--@if(($default_grant[$grant_name] ?? '') == 'all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option>
<option value="-1" <!--@if(($default_grant[$grant_name] ?? '') == 'member' || ($default_grant[$grant_name] ?? '') == 'site')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option>
<option value="-4" <!--@if(($default_grant[$grant_name] ?? '') == 'not_member')-->selected="selected"<!--@end-->>{$lang->grant_to_non_login_user}</option>
<!--@endif-->
<option value="-3" <!--@if(($default_grant[$grant_name] ?? '') == 'manager')-->selected="selected"<!--@end-->>{$lang->grant_to_admin}</option>
<option value="" <!--@if(($default_grant[$grant_name] ?? '') == 'group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
</select>

View file

@ -46,14 +46,14 @@
<div class="x_control-group">
<label class="x_control-label" for="header_text">{$lang->header_text}</label>
<div class="x_controls">
<textarea name="header_text" id="header_text" rows="4" cols="42">{htmlspecialchars($module_info->header_text, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
<textarea name="header_text" id="header_text" rows="4" cols="42" class="x_full-width x_code-font">{htmlspecialchars($module_info->header_text, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
<p class="x_help-block" id="aboutHeaderText">{$lang->about_header_text}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="footer_text">{$lang->footer_text}</label>
<div class="x_controls">
<textarea name="footer_text" rows="4" cols="42">{htmlspecialchars($module_info->footer_text, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
<textarea name="footer_text" rows="4" cols="42" class="x_full-width x_code-font">{htmlspecialchars($module_info->footer_text, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
<p class="x_help-block" id="aboutFooterText">{$lang->about_footer_text}</p>
</div>
</div>
@ -68,5 +68,5 @@
<div class="x_modal-footer">
<input type="submit" class="x_btn x_btn-primary" value="{$lang->cmd_registration}" />
</div>
</form>

View file

@ -296,7 +296,10 @@ class PageAdminView extends Page
Context::set('oDocument', $oDocument);
Context::set('mid', $this->module_info->mid);
$this->setLayoutAndTemplatePaths($isMobile ? 'M' : 'P', $this->module_info);
if(config('view.manager_layout') !== 'admin')
{
$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'))
{