harmonize My class
This commit is contained in:
parent
ae8bb8deba
commit
82622dd7bf
2 changed files with 13 additions and 11 deletions
|
@ -42,10 +42,10 @@ class Frontend extends dcNsProcess
|
|||
}
|
||||
|
||||
$tplset = dcCore::app()->themes->moduleInfo(dcCore::app()->blog->settings->get('system')->get('theme'), 'tplset');
|
||||
if (!empty($tplset) && is_dir(implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', $tplset]))) {
|
||||
dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', $tplset]));
|
||||
if (!empty($tplset) && is_dir(implode(DIRECTORY_SEPARATOR, [My::path(), 'default-templates', $tplset]))) {
|
||||
dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::path(), 'default-templates', $tplset]));
|
||||
} else {
|
||||
dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', DC_DEFAULT_TPLSET]));
|
||||
dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::path(), 'default-templates', DC_DEFAULT_TPLSET]));
|
||||
}
|
||||
},
|
||||
// breacrumb addon
|
||||
|
|
18
src/My.php
18
src/My.php
|
@ -17,15 +17,15 @@ namespace Dotclear\Plugin\CategoriesPage;
|
|||
use dcCore;
|
||||
|
||||
/**
|
||||
* Plugin definitions
|
||||
* This module definitions.
|
||||
*/
|
||||
class My
|
||||
{
|
||||
/** @var string Required php version */
|
||||
/** @var string This module required php version */
|
||||
public const PHP_MIN = '7.4';
|
||||
|
||||
/**
|
||||
* This module id
|
||||
* This module id.
|
||||
*/
|
||||
public static function id(): string
|
||||
{
|
||||
|
@ -33,23 +33,25 @@ class My
|
|||
}
|
||||
|
||||
/**
|
||||
* This module name
|
||||
* This module name.
|
||||
*/
|
||||
public static function name(): string
|
||||
{
|
||||
return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name'));
|
||||
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
|
||||
|
||||
return __(is_string($name) ? $name : self::id());
|
||||
}
|
||||
|
||||
/**
|
||||
* This module root
|
||||
* This module path.
|
||||
*/
|
||||
public static function root(): string
|
||||
public static function path(): string
|
||||
{
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check php version
|
||||
* Check this module PHP version compliant.
|
||||
*/
|
||||
public static function phpCompliant(): bool
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue