Code Quality

This commit is contained in:
cgfhtw
2023-03-10 09:28:04 +01:00
parent 555b8f4e6b
commit f9975eb530
7 changed files with 46 additions and 19 deletions
+11 -7
View File
@@ -2,6 +2,10 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \DateTime as DateTime;
use \DOMDocument as DOMDocument;
use \XSLTProcessor as XSLTProcessor;
/**
* TODO(chris): NEWS: edit & delete button links and confirm
* TODO(chris): NEWS: news_infoscreen xlst
@@ -97,14 +101,14 @@ class CmsLib
return $template;
$template = current(getData($template));
$XML = new \DOMDocument();
$XML = new DOMDocument();
$XML->loadXML($content->content);
$xsltemplate = new \DOMDocument();
$xsltemplate = new DOMDocument();
$xsltemplate->loadXML($template->xslt_xhtml_c4);
//Transformation
$processor = new \XSLTProcessor();
$processor = new XSLTProcessor();
$processor->importStylesheet($xsltemplate);
$content = $processor->transformToXML($XML);
@@ -214,7 +218,7 @@ class CmsLib
foreach ($news as $newsobj) {
if ($studiengang_kz && $edit && !$newsobj->studiengang_kz)
continue;
$date = new \DateTime($newsobj->datum);
$date = new DateTime($newsobj->datum);
$datum = '<datum><![CDATA[' . $date->format('d.m.Y') . ']]></datum>';
$datum .= '<datumdetail><![CDATA[' . $date->format('Y-m-d H:i') . ']]></datumdetail>';
$id = $edit ? '<news_id><![CDATA[' . $newsobj->news_id . ']]></news_id>' : '';
@@ -254,14 +258,14 @@ class CmsLib
return $template;
$template = current(getData($template));
$XML = new \DOMDocument();
$XML = new DOMDocument();
$XML->loadXML($xml);
$xsltemplate = new \DOMDocument();
$xsltemplate = new DOMDocument();
$xsltemplate->loadXML($template->xslt_xhtml_c4);
//Transformation
$processor = new \XSLTProcessor();
$processor = new XSLTProcessor();
$processor->importStylesheet($xsltemplate);
$content = $processor->transformToDoc($XML);