Use Rhymix action, not standalone .xml.php file, to load document category info

This commit is contained in:
Kijin Sung 2023-08-07 00:35:13 +09:00
parent a609478db4
commit 34f05b08de
4 changed files with 55 additions and 34 deletions

View file

@ -964,6 +964,27 @@ class DocumentModel extends Document
$this->add('categories', $output);
}
/**
* Get category list in tree format
*/
public function getDocumentCategoryTree()
{
$module_srl = Context::get('module_srl');
if ($module_srl <= 0)
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
$filename = self::getCategoryPhpFile($module_srl);
if (!$filename)
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
include $filename;
$this->add('categories', $menu->list ?? []);
}
/**
* Wanted to set document information
* @return object
@ -1003,10 +1024,6 @@ class DocumentModel extends Document
*/
public function getCategoryHTML($module_srl)
{
$category_xml_file = self::getCategoryXmlFile($module_srl);
Context::set('category_xml_file', $category_xml_file);
Context::loadJavascriptPlugin('ui.tree');
// Get a list of member groups