fixes #1841 register system activities

This commit is contained in:
plegall
2022-12-24 17:36:35 +01:00
parent b08fd91edc
commit bb69269239
15 changed files with 151 additions and 14 deletions
+10 -4
View File
@@ -96,6 +96,7 @@ class themes
$theme_maintain = self::build_maintain_class($theme_id);
$errors = array();
$activity_details = array('theme_id'=>$theme_id);
switch ($action)
{
@@ -144,6 +145,8 @@ INSERT INTO '.THEMES_TABLE.'
;';
pwg_query($query);
$activity_details['version'] = $this->fs_themes[$theme_id]['version'];
if ($this->fs_themes[$theme_id]['mobile'])
{
conf_update_param('mobile_theme', $theme_id);
@@ -236,6 +239,9 @@ DELETE
$this->set_default_theme($theme_id);
break;
}
pwg_activity('system', ACTIVITY_SYSTEM_THEME, $action, $activity_details);
return $errors;
}
@@ -577,7 +583,7 @@ SELECT
* @param string - remote revision identifier (numeric)
* @param string - theme id or extension id
*/
function extract_theme_files($action, $revision, $dest)
function extract_theme_files($action, $revision, $dest, &$theme_id=null)
{
global $logger;
@@ -614,13 +620,13 @@ SELECT
$root = dirname($main_filepath); // main.inc.php path in archive
if ($action == 'upgrade')
{
$extract_path = PHPWG_THEMES_PATH . $dest;
$theme_id = $dest;
}
else
{
$extract_path = PHPWG_THEMES_PATH . ($root == '.' ? 'extension_' . $dest : basename($root));
$theme_id = ($root == '.' ? 'extension_' . $dest : basename($root));
}
$extract_path = PHPWG_THEMES_PATH . $theme_id;
$logger->debug(__FUNCTION__.', $extract_path = '.$extract_path);
if (