* Modify entity list and story list.

This commit is contained in:
sunguangming
2024-05-15 13:26:26 +08:00
parent 217a6d40c3
commit ac4e09974f
2 changed files with 28 additions and 7 deletions
+3 -7
View File
@@ -59,17 +59,13 @@ class entityList extends wg
protected function getItems()
{
global $lang;
$items = $this->prop('items', array());
$list = array();
foreach($items as $key => $entities)
foreach($items as $key => $entity)
{
$list[] = array('id' => $key, 'title' => $lang->story->typeList[$key]);
foreach($entities as $entity)
{
$list[] = $this->getItem($entity);
}
if(is_string($entity)) $entity = (object)array('id' => $key, 'title' => $entity);
$list[] = $this->getItem($entity);
}
return $list;
+25
View File
@@ -34,4 +34,29 @@ class storyList extends entitylist
return $item;
}
protected function getItems()
{
global $lang;
$items = $this->prop('items', array());
$list = array();
foreach($items as $key => $entity)
{
if(is_object($entity))
{
$list[] = $this->getItem($entity);
}
elseif(is_array($entity))
{
$list[] = array('id' => $key, 'title' => $lang->story->typeList[$key]);
foreach($entity as $subEntity)
{
$list[] = $this->getItem($subEntity);
}
}
}
return $list;
}
}