mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Fix #1680 fallback to default skin if ncenterlite skin does not contain required template file
This commit is contained in:
parent
6780125174
commit
9a70726be2
1 changed files with 15 additions and 4 deletions
|
|
@ -38,7 +38,7 @@ class ncenterliteView extends ncenterlite
|
|||
Context::set('ncenterlite_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$this->setTemplateFile('NotifyList');
|
||||
$this->setTemplateFileOrDefault('NotifyList');
|
||||
}
|
||||
|
||||
function dispNcenterliteUserConfig()
|
||||
|
|
@ -92,7 +92,8 @@ class ncenterliteView extends ncenterlite
|
|||
Context::set('module_config', NcenterliteModel::getConfig());
|
||||
Context::set('sms_available', Rhymix\Framework\SMS::getDefaultDriver()->getName() !== 'Dummy');
|
||||
Context::set('push_available', count(Rhymix\Framework\Config::get('push.types') ?? []) > 0);
|
||||
$this->setTemplateFile('userconfig');
|
||||
|
||||
$this->setTemplateFileOrDefault('userconfig');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,7 +139,7 @@ class ncenterliteView extends ncenterlite
|
|||
Context::set('unsubscribe_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$this->setTemplateFile('unsubscribeList');
|
||||
$this->setTemplateFileOrDefault('unsubscribeList');
|
||||
}
|
||||
|
||||
function dispNcenterliteInsertUnsubscribe()
|
||||
|
|
@ -217,6 +218,16 @@ class ncenterliteView extends ncenterlite
|
|||
Context::set('text', $text);
|
||||
Context::set('type', $type);
|
||||
|
||||
$this->setTemplateFile('unsubscribe');
|
||||
$this->setTemplateFileOrDefault('unsubscribe');
|
||||
}
|
||||
|
||||
public function setTemplateFileOrDefault($filename)
|
||||
{
|
||||
$path = $this->getTemplatePath();
|
||||
if (!file_exists($path . $filename . '.html'))
|
||||
{
|
||||
$this->setTemplatePath(dirname($path) . '/default/');
|
||||
}
|
||||
$this->setTemplateFile($filename);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue