From fcdfd7e3ba03d07c551c7b46de21315878fb9dfa Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 25 Sep 2021 21:13:56 +0200 Subject: [PATCH] fix module name to untranslated string, fix dcmin search --- inc/class.tweakstores.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/inc/class.tweakstores.php b/inc/class.tweakstores.php index 64aaf29..b173b0f 100644 --- a/inc/class.tweakstores.php +++ b/inc/class.tweakstores.php @@ -21,6 +21,7 @@ class tweakStores { $label = empty($module['label']) ? $id : $module['label']; $name = __(empty($module['name']) ? $label : $module['name']); + $oname = empty($module['name']) ? $label : $module['name']; return array_merge( # Default values @@ -42,7 +43,7 @@ class tweakStores 'sshot' => '', 'score' => 0, 'type' => null, - 'require' => [], + 'requires' => [], 'settings' => [], 'repository' => '', 'dc_min' => 0 @@ -55,6 +56,7 @@ class tweakStores 'sid' => self::sanitizeString($id), 'label' => $label, 'name' => $name, + 'oname' => $oname, 'sname' => self::sanitizeString($name) ] ); @@ -107,7 +109,7 @@ class tweakStores if (empty($module['name'])) { self::$failed[] = 'no module name set in _define.php'; } - $xml[] = sprintf('%s', html::escapeHTML($module['name'])); + $xml[] = sprintf('%s', html::escapeHTML($module['oname'])); # version if (empty($module['version'])) { @@ -140,11 +142,23 @@ class tweakStores } $xml[] = sprintf('%s', html::escapeHTML($file_pattern)); - # dc_min + # da dc_min or requires core + if (!empty($>module['requires']) && is_array($module['requires'])) { + foreach ($module['requires'] as $req) { + if (!is_array($req)) { + $req = [$req]; + } + if ($req[0] == 'core') { + $module['dc_min'] = $req[1]; + break; + } + } + } if (empty($module['dc_min'])) { self::$notice[] = 'no minimum dotclear version'; + } else { + $xml[] = sprintf('%s', html::escapeHTML($module['dc_min'])); } - $xml[] = sprintf('%s', html::escapeHTML($module['dc_min'])); # details if (empty($module['details'])) {