add checked url to ui

master
Jean-Christian Paul Denis 2021-11-05 01:16:44 +01:00
parent 8d1e145b40
commit 7725be7d68
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 11 additions and 8 deletions

View File

@ -71,10 +71,10 @@ class tweakStoresBehaviors
$file_pattern = $core->blog->settings->tweakStores->file_pattern; $file_pattern = $core->blog->settings->tweakStores->file_pattern;
# check dcstore repo # check dcstore repo
$file_content = ''; $url = '';
if (!empty($_POST['checkxml_id']) && in_array($_POST['checkxml_id'], $combo)) { if (!empty($_POST['checkxml_id']) && in_array($_POST['checkxml_id'], $combo)) {
if (empty($modules[$_POST['checkxml_id']]['repository'])) { if (empty($modules[$_POST['checkxml_id']]['repository'])) {
$file_content = __('This module has no repository set in its _define.php file.'); $url = __('This module has no repository set in its _define.php file.');
} else { } else {
try { try {
$url = $modules[$_POST['checkxml_id']]['repository']; $url = $modules[$_POST['checkxml_id']]['repository'];
@ -146,15 +146,18 @@ class tweakStoresBehaviors
$core->formNonce() . '</p>' . $core->formNonce() . '</p>' .
'</form>'; '</form>';
if (!empty($file_content)) { if (!empty($url)) {
echo echo
'<div class="fieldset">' . '<div class="fieldset">' .
'<h4>' . __('Repositiory contents') . '</h4>' . '<h4>' . __('Repositiory contents') . '</h4>' .
'<pre>' . form::textArea('file_xml', 165, 14, [ '<p>' . $url . '</p>' .
'default' => html::escapeHTML(str_replace('><', ">\n<", $file_content)), (empty($file_content) ? '' :
'class' => 'maximal', '<pre>' . form::textArea('file_xml', 165, 14, [
'extra_html' => 'readonly="true"' 'default' => html::escapeHTML(str_replace('><', ">\n<", $file_content)),
]) . '</pre>' . 'class' => 'maximal',
'extra_html' => 'readonly="true"'
]) . '</pre>'
) .
'</div>'; '</div>';
} }