From 13c074f8b8f8340efc7c5912c615b6cfa693409d Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 22 May 2024 19:20:57 +0200 Subject: Module\Setup: Pass all required params for the template. Non-existing keys in the array passed to the template causes a warning. Also make optional parts of the template actually optional by skipping them if the value is empty. --- Zotlabs/Module/Setup.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index 647415385..a4204afd7 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -215,9 +215,11 @@ class Setup extends \Zotlabs\Web\Controller { $tpl = get_markup_template('install.tpl'); return replace_macros($tpl, array( '$title' => $install_title, + '$icon' => null, '$pass' => '', '$status' => t('Permission denied.'), '$text' => '', + '$what_next' => null, )); } } -- cgit v1.2.3 From c7ec3159ead30c2306a84d060ecc63e60e5c9084 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 22 May 2024 20:01:34 +0200 Subject: Module\Rbmark: Specify all fields in the template. The `field_select` sub template wants five elements in the `field` array. --- Zotlabs/Module/Rbmark.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Rbmark.php b/Zotlabs/Module/Rbmark.php index b1aea2590..8ac23a4e4 100644 --- a/Zotlabs/Module/Rbmark.php +++ b/Zotlabs/Module/Rbmark.php @@ -73,6 +73,7 @@ class Rbmark extends \Zotlabs\Web\Controller { false, '', $this->get_bookmark_folders(intval($channel_id)), + null, ]; return replace_macros(get_markup_template('rbmark.tpl'), array( -- cgit v1.2.3 From ffc2455bea61df2fb0ecf1b39bc596541cb84c40 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 22 May 2024 20:30:44 +0200 Subject: Module\Rbmark: Pass all fields to input field templates. --- Zotlabs/Module/Rbmark.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Rbmark.php b/Zotlabs/Module/Rbmark.php index 8ac23a4e4..df32a97c2 100644 --- a/Zotlabs/Module/Rbmark.php +++ b/Zotlabs/Module/Rbmark.php @@ -78,12 +78,12 @@ class Rbmark extends \Zotlabs\Web\Controller { return replace_macros(get_markup_template('rbmark.tpl'), array( '$header' => t('Save Bookmark'), - '$url' => array('url',t('URL of bookmark'),$_REQUEST['url']), - '$title' => array('title',t('Description'),$_REQUEST['title']), + '$url' => array('url',t('URL of bookmark'),$_REQUEST['url'], null, null, null), + '$title' => array('title',t('Description'),$_REQUEST['title'], null, null, null), '$ischat' => ((x($_REQUEST,'ischat')) ? intval($_REQUEST['ischat']) : 0), '$private' => ((x($_REQUEST,'private')) ? intval($_REQUEST['private']) : 0), '$submit' => t('Save'), - '$menu_name' => array('menu_name',t('Or enter new bookmark folder name'),'',''), + '$menu_name' => array('menu_name',t('Or enter new bookmark folder name'),'','', null, null), '$menus' => $menu_select )); } -- cgit v1.2.3 From ad9fb4d530d02c4e432f14626c1f08fe827255c5 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 22 May 2024 20:40:56 +0200 Subject: Module\Help: Only variables can be passed by reference. Introduce an intermediate variable when extracting the file type from the file name. Otherwise we would try to pass a returned value as a reference. --- Zotlabs/Module/Help.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php index 5d52440a5..fd5cacee6 100644 --- a/Zotlabs/Module/Help.php +++ b/Zotlabs/Module/Help.php @@ -210,7 +210,8 @@ class Help extends \Zotlabs\Web\Controller { $content = preg_replace_callback( "/#include (.*?)\;/ism", function ($matches) { - $sub_file_type = array_pop(explode('.', $matches[1])); + $parts = explode('.', $matches[1]); + $sub_file_type = array_pop($parts); $included_content = $this->render_help_file($matches[1], $sub_file_type); return str_replace($matches[0], $included_content, $matches[0]); }, -- cgit v1.2.3 From ac1e20b1880d57aab2048e670449768d51dbc0b0 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 22 May 2024 20:44:27 +0200 Subject: Module\Setup: Don't access static variable as non static. --- Zotlabs/Module/Setup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index a4204afd7..7ca3f827c 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -46,9 +46,9 @@ class Setup extends \Zotlabs\Web\Controller { } if(x($_POST, 'pass')) { - $this->install_wizard_pass = intval($_POST['pass']); + self::$install_wizard_pass = intval($_POST['pass']); } else { - $this->install_wizard_pass = 1; + self::$install_wizard_pass = 1; } } @@ -239,7 +239,7 @@ class Setup extends \Zotlabs\Web\Controller { )); } - switch ($this->install_wizard_pass){ + switch (self::$install_wizard_pass){ case 1: { // System check $checks = array(); -- cgit v1.2.3