Skip to content
Code-Schnipsel Gruppen Projekte

Add QUIQQER Tooling

Geschlossen Jan Wennrich schlägt vor, feat-quiqqer-tooling in next-0.x zu mergen.
26 Dateien
+ 78
53
Änderungen vergleichen
  • Nebeneinander
  • In der Reihe
Dateien
26
@@ -32,22 +32,23 @@ public static function fetch($params, $Smarty)
$file = $params['template'];
$Project = QUI::getRewrite()->getProject();
if (!empty($params['Template'])
if (
!empty($params['Template'])
&& $params['Template'] instanceof QUI\Template
&& \method_exists($params['Template'], 'getTemplatePath')
) {
$templatePath = $params['Template']->getTemplatePath();
} else {
$templatePath = OPT_DIR.$Project->getAttribute('template').'/';
$templatePath = OPT_DIR . $Project->getAttribute('template') . '/';
}
if (!\file_exists($templatePath)) {
QUI\System\Log::addError('Template path "'.$templatePath.'" not found.');
QUI\System\Log::addError('Template path "' . $templatePath . '" not found.');
return '';
}
$file = $templatePath.$file;
$file = $templatePath . $file;
if (!\file_exists($file)) {
try {
@@ -55,7 +56,7 @@ public static function fetch($params, $Smarty)
$file = \str_replace(OPT_DIR, '', $file);
$file = \explode(DIRECTORY_SEPARATOR, $file);
$package = $file[0].DIRECTORY_SEPARATOR.$file[1];
$package = $file[0] . DIRECTORY_SEPARATOR . $file[1];
$Package = QUI::getPackage($package);
unset($file[0]);
@@ -69,19 +70,19 @@ public static function fetch($params, $Smarty)
return '';
}
$file = OPT_DIR.
$TemplateParent->getName().
DIRECTORY_SEPARATOR.
$file = OPT_DIR .
$TemplateParent->getName() .
DIRECTORY_SEPARATOR .
\implode(DIRECTORY_SEPARATOR, $file);
if (!file_exists($file)) {
QUI\System\Log::addError('Template file "'.$file.'" not found.');
QUI\System\Log::addError('Template file "' . $file . '" not found.');
return '';
}
}
} catch (\Exception $Exception) {
QUI\System\Log::addError('Template file "'.$file.'" not found.');
QUI\System\Log::addError('Template file "' . $file . '" not found.');
QUI\System\Log::addError($Exception->getMessage());
return '';