Skip to content

Commit 4d3f7b8

Browse files
committed
Версия 1.1
1 parent 0c79d31 commit 4d3f7b8

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

quantummanagercontent.php

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,33 +160,38 @@ public function onAjaxQuantummanagercontent()
160160
}
161161
}
162162

163+
$template = '<a href="{file}" target="_blank">{name}</a>';
163164

164-
foreach ($scopesTemplate as $template)
165+
foreach ($scopesTemplate as $scopesTemplateCurrent)
165166
{
166167

167-
if($template->id === $scope)
168+
if($scopesTemplateCurrent->id === $scope)
168169
{
169170

170-
if(empty($template->template))
171+
if(empty($scopesTemplateCurrent->template))
171172
{
172-
$template->template = '<a href="{file}" target="_blank">{name}</a>';
173+
$template = '<a href="{file}" target="_blank">{name}</a>';
173174
}
174-
175-
$variablesFind = [];
176-
$variablesReplace = [];
177-
178-
foreach ($variables as $key => $value)
175+
else
179176
{
180-
$variablesFind[] = $key;
181-
$variablesReplace[] = $value;
177+
$template = $scopesTemplateCurrent->template;
182178
}
183179

184-
$html = str_replace($variablesFind, $variablesReplace, $template->template);
185-
$html = preg_replace("#[a-zA-Z]{1,}\=\"\"#isu", '', $html);
186-
187180
}
188181
}
189182

183+
$variablesFind = [];
184+
$variablesReplace = [];
185+
186+
foreach ($variables as $key => $value)
187+
{
188+
$variablesFind[] = $key;
189+
$variablesReplace[] = $value;
190+
}
191+
192+
$html = str_replace($variablesFind, $variablesReplace, $template);
193+
$html = preg_replace("#[a-zA-Z]{1,}\=\"\"#isu", '', $html);
194+
190195
echo $html;
191196

192197
$app->close();

quantummanagercontent.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<license>https://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
88
<authorEmail>cymbal@delo-design.ru</authorEmail>
99
<authorUrl>https://www.norrnext.com</authorUrl>
10-
<version>1.0</version>
10+
<version>1.1</version>
1111
<description>PLG_BUTTON_QUANTUMMANAGERCONTENT_DESCRIPTION</description>
1212
<scriptfile>script.php</scriptfile>
1313
<languages folder="language">

0 commit comments

Comments
 (0)