Skip to content

Commit

Permalink
refactor for hcpp_render_body, hcpp_render_panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Aug 16, 2023
1 parent f3fe9f1 commit b775546
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hooks/pluginable.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ function str_starts_with($haystack, $needle) {
});

// List plugins in HestiaCP's Configure Server UI
$hcpp->add_action( 'hcpp_render_page', function( $args ) {
$hcpp->add_action( 'hcpp_render_body', function( $args ) {
global $hcpp;
$content = $args['content'];
if ( false == ($args['page'] == 'edit_server' && $args['TAB'] == 'SERVER' ) ) {
Expand Down
12 changes: 11 additions & 1 deletion hooks/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ $hcpp->patch_file(
'include $__template_dir . "header.php";',
"include \$__template_dir . \"header.php\";\n\t\$args = [ 'TAB' => \$TAB, 'page' => \$page, 'user' => \$user, 'content' => ob_get_clean() ];\n echo \$hcpp->do_action('hcpp_render_header', \$args)['content'];\n"
);
$hcpp->patch_file(
'/usr/local/hestia/web/inc/main.php',
"// Panel",
"// Panel\n\tob_start();\n"
);
$hcpp->patch_file(
'/usr/local/hestia/web/inc/main.php',
"// Policies controller",
"\t\$args['content'] = ob_get_clean();\n\techo \$hcpp->do_action('hcpp_render_panel', \$args)['content'];\n\n\t// Policies controller"
);
$hcpp->patch_file(
'/usr/local/hestia/web/inc/main.php',
"// Body",
Expand All @@ -112,7 +122,7 @@ $hcpp->patch_file(
$hcpp->patch_file(
'/usr/local/hestia/web/inc/main.php',
"// Footer",
"\t\$args['content'] = ob_get_clean();\n\techo \$hcpp->do_action('hcpp_render_page', \$args)['content'];\n\n\t// Footer"
"\t\$args['content'] = ob_get_clean();\n\techo \$hcpp->do_action('hcpp_render_body', \$args)['content'];\n\n\t// Footer"
);
$hcpp->patch_file(
'/usr/local/hestia/web/inc/main.php',
Expand Down

0 comments on commit b775546

Please sign in to comment.