Remove references to old XeXmlParser in widget module

This commit is contained in:
Kijin Sung 2025-05-18 22:04:18 +09:00
parent 170e183f8f
commit 3f6dbf847d
2 changed files with 6 additions and 11 deletions

View file

@ -301,8 +301,7 @@ class WidgetController extends Widget
function transWidgetBox($matches) function transWidgetBox($matches)
{ {
$buff = preg_replace('/<div><div>(.*)$/i','</div>',$matches[0]); $buff = preg_replace('/<div><div>(.*)$/i','</div>',$matches[0]);
$oXmlParser = new XeXmlParser(); $xml_doc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString($buff);
$xml_doc = $oXmlParser->parse($buff);
$vars = $xml_doc->div->attrs; $vars = $xml_doc->div->attrs;
$widget = $vars->widget; $widget = $vars->widget;
@ -324,13 +323,11 @@ class WidgetController extends Widget
// Bringing widget cache sequence // Bringing widget cache sequence
preg_match_all('!<img([^\>]*)widget=([^\>]*?)\>!is', $content, $matches); preg_match_all('!<img([^\>]*)widget=([^\>]*?)\>!is', $content, $matches);
$oXmlParser = new XeXmlParser();
$cnt = count($matches[1]); $cnt = count($matches[1]);
for($i=0;$i<$cnt;$i++) for($i=0;$i<$cnt;$i++)
{ {
$buff = $matches[0][$i]; $buff = $matches[0][$i];
$xml_doc = $oXmlParser->parse(trim($buff)); $xml_doc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString(trim($buff));
$args = $xml_doc->img->attrs; $args = $xml_doc->img->attrs;
$widget = $args->widget; $widget = $args->widget;
if(!$args || !$widget || empty($args->widget_cache)) if(!$args || !$widget || empty($args->widget_cache))

View file

@ -137,9 +137,8 @@ class WidgetModel extends Widget
return $widget_info; return $widget_info;
} }
// If no cache file exists, parse the xml and then return the variable. // If no cache file exists, parse the xml and then return the variable.
$oXmlParser = new XeXmlParser(); $tmp_xml_obj = Rhymix\Framework\Parsers\XEXMLParser::loadXMLFile($xml_file);
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); $xml_obj = $tmp_xml_obj->widget ?? null;
$xml_obj = $tmp_xml_obj->widget;
if(!$xml_obj) return; if(!$xml_obj) return;
$buff = '$widget_info = new stdClass;'; $buff = '$widget_info = new stdClass;';
@ -287,9 +286,8 @@ class WidgetModel extends Widget
return $widgetStyle_info; return $widgetStyle_info;
} }
// If no cache file exists, parse the xml and then return the variable. // If no cache file exists, parse the xml and then return the variable.
$oXmlParser = new XeXmlParser(); $tmp_xml_obj = Rhymix\Framework\Parsers\XEXMLParser::loadXMLFile($xml_file);
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); $xml_obj = $tmp_xml_obj->widgetstyle ?? null;
$xml_obj = $tmp_xml_obj->widgetstyle;
if(!$xml_obj) return; if(!$xml_obj) return;
$buff = array(); $buff = array();