mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix error in NcenterliteModel::getColorsetList() when there are no colorsets
This commit is contained in:
parent
c6f8abe855
commit
4e192668a1
1 changed files with 13 additions and 7 deletions
|
|
@ -506,18 +506,24 @@ class NcenterliteModel extends Ncenterlite
|
|||
|
||||
function getColorsetList()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$skin = Context::get('skin');
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
for($i=0, $c=count($skin_info->colorset); $i<$c; $i++)
|
||||
$colorset_list = [];
|
||||
foreach ($skin_info->colorset ?? [] as $colorset)
|
||||
{
|
||||
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
|
||||
$colorset_list[] = $colorset;
|
||||
$colorset_list[] = sprintf('%s|@|%s', $colorset->name, $colorset->title);
|
||||
}
|
||||
|
||||
if (count($colorset_list))
|
||||
{
|
||||
$colorsets = implode("\n", $colorset_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
$colorsets = '';
|
||||
}
|
||||
|
||||
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
|
||||
$this->add('colorset_list', $colorsets);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue