Fix undefined variables in several module config templates

This commit is contained in:
Kijin Sung 2023-11-09 01:37:38 +09:00
parent d54eb4f3d5
commit 8176bdb845
12 changed files with 38 additions and 31 deletions

View file

@ -833,7 +833,7 @@ class ModuleObject extends BaseObject
} }
// execute api methods of the module if view action is and result is XMLRPC or JSON // execute api methods of the module if view action is and result is XMLRPC or JSON
if($this->module_info->module_type == 'view' || $this->module_info->module_type == 'mobile') if(isset($this->module_info->module_type) && in_array($this->module_info->module_type, ['view', 'mobile']))
{ {
if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON')
{ {

View file

@ -16,13 +16,13 @@
<div class="x_control-group"> <div class="x_control-group">
<label class="x_control-label">{$lang->hide_category}</label> <label class="x_control-label">{$lang->hide_category}</label>
<div class="x_controls"> <div class="x_controls">
<label class="x_inline" for="hide_category"><input type="checkbox" name="hide_category" id="hide_category" value="Y" checked="checked"|cond="$module_info->hide_category == 'Y'" /> {$lang->about_hide_category}</label> <label class="x_inline" for="hide_category"><input type="checkbox" name="hide_category" id="hide_category" value="Y" checked="checked"|cond="($module_info->hide_category ?? '') == 'Y'" /> {$lang->about_hide_category}</label>
</div> </div>
</div> </div>
<div class="x_control-group"> <div class="x_control-group">
<label class="x_control-label">{$lang->allow_no_category}</label> <label class="x_control-label">{$lang->allow_no_category}</label>
<div class="x_controls"> <div class="x_controls">
<label class="x_inline" for="allow_no_category"><input type="checkbox" name="allow_no_category" id="allow_no_category" value="Y" checked="checked"|cond="$module_info->allow_no_category == 'Y'" /> {$lang->about_allow_no_category}</label> <label class="x_inline" for="allow_no_category"><input type="checkbox" name="allow_no_category" id="allow_no_category" value="Y" checked="checked"|cond="($module_info->allow_no_category ?? '') == 'Y'" /> {$lang->about_allow_no_category}</label>
</div> </div>
</div> </div>
</section> </section>

View file

@ -3,7 +3,7 @@
<h1> <h1>
{$lang->board_management} {$lang->board_management}
<span class="path" cond="$module_info->mid"> <span class="path" cond="$module_info->mid">
&gt; <a href="{getSiteUrl($module_info->domain,'','mid',$module_info->mid)}" target="_blank"|cond="$module=='admin'">{$module_info->mid}<block cond="$module_info->is_default=='Y'">({$lang->is_default})</block></a> &gt; <a href="{getSiteUrl($module_info->domain ?? '', '', 'mid', $module_info->mid)}" target="_blank"|cond="$module=='admin'">{$module_info->mid}<block cond="$module_info->is_default=='Y'">({$lang->is_default})</block></a>
</span> </span>
<a href="#aboutModule" data-toggle class="x_icon-question-sign">{$lang->help}</a> <a href="#aboutModule" data-toggle class="x_icon-question-sign">{$lang->help}</a>
</h1> </h1>

View file

@ -4,7 +4,7 @@
<input type="hidden" name="module" value="comment" /> <input type="hidden" name="module" value="comment" />
<input type="hidden" name="act" value="procCommentInsertModuleConfig" /> <input type="hidden" name="act" value="procCommentInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" /> <input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" /> <input type="hidden" name="target_module_srl" value="{!empty($module_info->module_srl) ? $module_info->module_srl : $module_srls}" />
<div class="x_control-group"> <div class="x_control-group">
<label for="comment_count" class="x_control-label">{$lang->comment_count}</label> <label for="comment_count" class="x_control-label">{$lang->comment_count}</label>
<div class="x_controls"> <div class="x_controls">
@ -23,8 +23,8 @@
<label for="comment_count" class="x_control-label">{$lang->comment_default_page}</label> <label for="comment_count" class="x_control-label">{$lang->comment_default_page}</label>
<div class="x_controls"> <div class="x_controls">
<select name="default_page" id="default_page"> <select name="default_page" id="default_page">
<option value="first" selected="selected"|cond="$comment_config->default_page === 'first'">{$lang->comment_default_page_first}</option> <option value="first" selected="selected"|cond="isset($comment_config->default_page) && $comment_config->default_page === 'first'">{$lang->comment_default_page_first}</option>
<option value="last" selected="selected"|cond="$comment_config->default_page !== 'first'">{$lang->comment_default_page_last}</option> <option value="last" selected="selected"|cond="!isset($comment_config->default_page) || $comment_config->default_page !== 'first'">{$lang->comment_default_page_last}</option>
</select> </select>
</div> </div>
</div> </div>
@ -32,11 +32,11 @@
<label for="use_comment_validation" class="x_control-label">{$lang->cmd_comment_validation}</label> <label for="use_comment_validation" class="x_control-label">{$lang->cmd_comment_validation}</label>
<div class="x_controls"> <div class="x_controls">
<label for="use_comment_validation_Y" class="x_inline"> <label for="use_comment_validation_Y" class="x_inline">
<input type="radio" id="use_comment_validation_Y" name="use_comment_validation" value="Y" checked="checked"|cond="$comment_config->use_comment_validation === 'Y'"> <input type="radio" id="use_comment_validation_Y" name="use_comment_validation" value="Y" checked="checked"|cond="isset($comment_config->use_comment_validation) && $comment_config->use_comment_validation === 'Y'">
{$lang->cmd_yes} {$lang->cmd_yes}
</label> </label>
<label for="use_comment_validation_N" class="x_inline"> <label for="use_comment_validation_N" class="x_inline">
<input type="radio" id="use_comment_validation_N" name="use_comment_validation" value="N" checked="checked"|cond="$comment_config->use_comment_validation !== 'Y'"> <input type="radio" id="use_comment_validation_N" name="use_comment_validation" value="N" checked="checked"|cond="!isset($comment_config->use_comment_validation) || $comment_config->use_comment_validation !== 'Y'">
{$lang->cmd_no} {$lang->cmd_no}
</label> </label>
<p class="x_help-inline">{$lang->about_comment_validation}</p> <p class="x_help-inline">{$lang->about_comment_validation}</p>

View file

@ -170,7 +170,7 @@ class DocumentView extends Document
{ {
$document_config = ModuleModel::getModulePartConfig('document', $current_module_srl); $document_config = ModuleModel::getModulePartConfig('document', $current_module_srl);
} }
if(!$document_config) if(!isset($document_config))
{ {
$document_config = new stdClass(); $document_config = new stdClass();
} }

View file

@ -4,7 +4,7 @@
<input type="hidden" name="module" value="document" /> <input type="hidden" name="module" value="document" />
<input type="hidden" name="act" value="procDocumentInsertModuleConfig" /> <input type="hidden" name="act" value="procDocumentInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" /> <input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" /> <input type="hidden" name="target_module_srl" value="{!empty($module_info->module_srl) ? $module_info->module_srl : $module_srls}" />
<div class="x_control-group"> <div class="x_control-group">
<label for="use_history" class="x_control-label">{$lang->history}</label> <label for="use_history" class="x_control-label">{$lang->history}</label>

View file

@ -2,14 +2,14 @@
<!--%import("filter/insert_extra_var.xml")--> <!--%import("filter/insert_extra_var.xml")-->
<!--%import("filter/delete_extra_var.xml")--> <!--%import("filter/delete_extra_var.xml")-->
<block cond="$selected_var_idx && $extra_keys[$selected_var_idx]"> <block cond="isset($selected_var_idx) && isset($extra_keys[$selected_var_idx])">
{@ $selected_var = $extra_keys[$selected_var_idx] } {@ $selected_var = $extra_keys[$selected_var_idx] }
</block> </block>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/document/tpl/extra_keys/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}"> <div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/document/tpl/extra_keys/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p> <p>{$XE_VALIDATOR_MESSAGE}</p>
</div> </div>
<!--@if($type == 'insertExtraForm' || $selected_var_idx)--> <!--@if((isset($type) && $type == 'insertExtraForm') || isset($selected_var_idx))-->
<section class="section"> <section class="section">
<h1>{$lang->extra_vars}</h1> <h1>{$lang->extra_vars}</h1>
<form ruleset="insertExtraVar" action="./" method="post" class="x_form-horizontal"> <form ruleset="insertExtraVar" action="./" method="post" class="x_form-horizontal">

View file

@ -4,7 +4,7 @@
<form action="./" method="post" class="section"> <form action="./" method="post" class="section">
<input type="hidden" name="act" value="procEditorInsertModuleConfig" /> <input type="hidden" name="act" value="procEditorInsertModuleConfig" />
<input type="hidden" name="module" value="editor" /> <input type="hidden" name="module" value="editor" />
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" /> <input type="hidden" name="target_module_srl" value="{!empty($module_info->module_srl) ? $module_info->module_srl : $module_srls}" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" /> <input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="xe_validator_id" value="modules/editor/addition_setup/1" /> <input type="hidden" name="xe_validator_id" value="modules/editor/addition_setup/1" />
<h1>{$lang->editor}</h1> <h1>{$lang->editor}</h1>

View file

@ -1803,13 +1803,20 @@ class ModuleModel extends Module
if(is_array($data)) if(is_array($data))
{ {
foreach($data as $key => $val) foreach($data as $key => $val)
{
if (isset($modules[$val->module_srl]))
{ {
$data[$key]->domain = $modules[$val->module_srl]->domain; $data[$key]->domain = $modules[$val->module_srl]->domain;
} }
elseif (!isset($data[$key]->domain))
{
$data[$key]->domain = null;
}
}
} }
else else
{ {
$data->domain = $modules[$data->module_srl]->domain; $data->domain = $modules[$data->module_srl]->domain ?? null;
} }
} }

View file

@ -103,7 +103,7 @@ class PageAdminView extends Page
// If you do not value module_srl just showing the index page // If you do not value module_srl just showing the index page
if(!$module_srl) return $this->dispPageAdminContent(); if(!$module_srl) return $this->dispPageAdminContent();
// If the layout is destined to add layout information haejum (layout_title, layout) // If the layout is destined to add layout information haejum (layout_title, layout)
if($module_info->layout_srl) if($module_info->layout_srl > 0)
{ {
$oLayoutModel = getModel('layout'); $oLayoutModel = getModel('layout');
$layout_info = $oLayoutModel->getLayout($module_info->layout_srl); $layout_info = $oLayoutModel->getLayout($module_info->layout_srl);

View file

@ -3,13 +3,13 @@
<h1> <h1>
{$lang->page_management} {$lang->page_management}
<span class="path" cond="$module_info->mid"> <span class="path" cond="$module_info->mid">
&gt; <a href="{getSiteUrl($module_info->domain,'','mid',$module_info->mid)}" target="_blank"|cond="$module=='admin'">{$module_info->mid}</a><block cond="$module_info->is_default=='Y'">({$lang->is_default})</block> &gt; <a href="{getSiteUrl($module_info->domain ?? '', '', 'mid', $module_info->mid)}" target="_blank"|cond="$module=='admin'">{$module_info->mid}</a><block cond="$module_info->is_default=='Y'">({$lang->is_default})</block>
</span> </span>
<a href="#aboutPage" class="x_icon-question-sign" data-toggle cond="!$module_info->mid"></a> <a href="#aboutPage" class="x_icon-question-sign" data-toggle cond="empty($module_info->mid)"></a>
</h1> </h1>
</div> </div>
<p id="aboutPage" class="x_alert x_alert-info" cond="!$module_info->mid" hidden>{nl2br($lang->about_page)}</p> <p id="aboutPage" class="x_alert x_alert-info" cond="empty($module_info->mid)" hidden>{nl2br($lang->about_page)}</p>
<ul class="x_nav x_nav-tabs" cond="$act != 'dispPageAdminDelete' && $module_info"> <ul class="x_nav x_nav-tabs" cond="$act != 'dispPageAdminDelete' && !empty($module_info)">
<li cond="$module=='admin'" class="x_active"|cond="$act=='dispPageAdminContent'"><a href="{getUrl('act','dispPageAdminContent','module_srl','')}">{$lang->cmd_list}</a></li> <li cond="$module=='admin'" class="x_active"|cond="$act=='dispPageAdminContent'"><a href="{getUrl('act','dispPageAdminContent','module_srl','')}">{$lang->cmd_list}</a></li>
<li cond="$module!='admin'"><a href="{getUrl('act','','module_srl','')}">{$lang->cmd_back}</a></li> <li cond="$module!='admin'"><a href="{getUrl('act','','module_srl','')}">{$lang->cmd_back}</a></li>
<block cond="$module_srl"> <block cond="$module_srl">

View file

@ -12,16 +12,16 @@
<input type="hidden" name="vid" value="{$vid}" /> <input type="hidden" name="vid" value="{$vid}" />
<input type="hidden" name="act" value="dispPageAdminContent" /> <input type="hidden" name="act" value="dispPageAdminContent" />
<select cond="count($module_category)" name="module_category_srl" title="{$lang->module_category}" style="margin-right:4px"> <select cond="count($module_category)" name="module_category_srl" title="{$lang->module_category}" style="margin-right:4px">
<option value="" selected="selected"|cond="!$module_category_srl">{$lang->all}</option> <option value="" selected="selected"|cond="empty($module_category_srl)">{$lang->all}</option>
<option value="0" selected="selected"|cond="$module_category_srl==='0'">{$lang->not_exists}</option> <option value="0" selected="selected"|cond="isset($module_category_srl) && $module_category_srl ==='0'">{$lang->not_exists}</option>
<option value="{$key}" loop="$module_category => $key,$val" selected="selected"|cond="$module_category_srl==$key">{$val->title}</option> <option value="{$key}" loop="$module_category => $key,$val" selected="selected"|cond="isset($module_category_srl) && $module_category_srl == $key">{$val->title}</option>
</select> </select>
<select name="search_target" id="search_target" style="margin-right:4px"> <select name="search_target" id="search_target" style="margin-right:4px">
<option value="s_mid" selected="selected"|cond="$search_target=='s_mid'">{$lang->mid}</option> <option value="s_mid" selected="selected"|cond="isset($search_target) && $search_target == 's_mid'">{$lang->mid}</option>
<option value="s_browser_title" selected="selected"|cond="$search_target=='s_browser_title'">{$lang->browser_title}</option> <option value="s_browser_title" selected="selected"|cond="isset($search_target) && $search_target == 's_browser_title'">{$lang->browser_title}</option>
<option cond="$module_category">{$lang->module_category}</option> <option cond="$module_category">{$lang->module_category}</option>
</select> </select>
<input type="search" name="search_keyword" title="Search" value="{htmlspecialchars($search_keyword, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" style="width:150px" /> <input type="search" name="search_keyword" title="Search" value="{escape($search_keyword ?? '', false)}" style="width:150px" />
<button class="x_btn x_btn-inverse" type="submit">{$lang->cmd_search}</button> <button class="x_btn x_btn-inverse" type="submit">{$lang->cmd_search}</button>
<a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a> <a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a>
</form> </form>