Skip to content

Commit

Permalink
Preliminary support for MantisBT 2.0.x and ModernUI
Browse files Browse the repository at this point in the history
  • Loading branch information
SL-Gundam committed Oct 6, 2016
1 parent 8bf997a commit 4d58a78
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 29 deletions.
2 changes: 1 addition & 1 deletion EmailReporting.php
Expand Up @@ -63,7 +63,7 @@ function register()

$this->version = '0.9.3-DEV';
$this->requires = array(
'MantisCore' => '1.2.6, <1.3.99',
'MantisCore' => '1.2.6, <2.0.99',
);

$this->author = plugin_lang_get( 'plugin_author' );
Expand Down
35 changes: 35 additions & 0 deletions core/config_api.php
Expand Up @@ -98,6 +98,41 @@ function ERP_get_mailboxes( $p_mailbox_id = FALSE, $p_mailbox_plugin_content = T
}
}

# --------------------
# Page header en beginning.
function ERP_page_begin( $p_page = '' )
{
// MantisBT 2.0.x
if ( function_exists( 'layout_page_header' ) )
{
layout_page_header( $p_page );
layout_page_begin( 'manage_overview_page.php' );
print_manage_menu( 'manage_plugin_page.php' );
}
// pre-MantisBT 2.0.x
else
{
html_page_top( $p_page );
print_manage_menu();
}
}

# --------------------
# Page footer
function ERP_page_end( $p_page = '' )
{
// MantisBT 2.0.x
if ( function_exists( 'layout_page_end' ) )
{
layout_page_end();
}
// pre-MantisBT 2.0.x
else
{
html_page_bottom( $p_page );
}
}

# --------------------
# output the menu with the ERP menu links
function ERP_print_menu( $p_page = '' )
Expand Down
1 change: 1 addition & 0 deletions doc/CHANGELOG.txt
@@ -1,5 +1,6 @@
Changelog:
Jul 2016 - EmailReporting-0.9.3-DEV
- Preliminary support for MantisBT 2.0.x and ModernUI
- Fix possible fatal error on return value
- Added error when __construct is not run when it should have
- Added fallback in case of an unknown email priority
Expand Down
8 changes: 3 additions & 5 deletions pages/manage_config.php
Expand Up @@ -2,12 +2,10 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

layout_page_header( plugin_lang_get( 'plugin_title' ) );

layout_page_begin( 'manage_overview_page.php' );

plugin_require_api( 'core/config_api.php' );

ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

$t_this_page = 'manage_config';
ERP_print_menu( $t_this_page );

Expand Down Expand Up @@ -191,5 +189,5 @@
</form>

<?php
layout_page_end();
ERP_page_end( __FILE__ );
?>
4 changes: 2 additions & 2 deletions pages/manage_config_edit.php
Expand Up @@ -62,7 +62,7 @@
}
else
{
layout_page_header( plugin_lang_get( 'plugin_title' ) );
ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

echo '<br /><div class="center">';
echo plugin_lang_get( 'mail_bug_priority_array_failure' ) . ' ';
Expand All @@ -71,7 +71,7 @@

$t_notsuccesfull = TRUE;

layout_page_end();
ERP_page_end( __FILE__ );
}

if ( !isset( $t_notsuccesfull ) )
Expand Down
8 changes: 3 additions & 5 deletions pages/manage_mailbox.php
Expand Up @@ -2,12 +2,10 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

layout_page_header( plugin_lang_get( 'plugin_title' ) );

layout_page_begin( 'manage_overview_page.php' );

plugin_require_api( 'core/config_api.php' );

ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

$t_this_page = 'manage_mailbox';
ERP_print_menu( $t_this_page );

Expand Down Expand Up @@ -139,5 +137,5 @@
<form>

<?php
layout_page_end();
ERP_page_end( __FILE__ );
?>
4 changes: 2 additions & 2 deletions pages/manage_mailbox_edit.php
Expand Up @@ -73,7 +73,7 @@
{
$t_no_redirect = TRUE;

layout_page_header( plugin_lang_get( 'plugin_title' ) );
ERP_page_begin( plugin_lang_get( 'plugin_title' ) );
?>
<br /><div class="center">
<?php
Expand All @@ -100,7 +100,7 @@
?>
</div>
<?php
layout_page_end();
ERP_page_end( __FILE__ );
}
}

Expand Down
7 changes: 3 additions & 4 deletions pages/manage_rule.php
Expand Up @@ -2,11 +2,10 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

layout_page_header( plugin_lang_get( 'plugin_title' ) );
plugin_require_api( 'core/config_api.php' );

layout_page_begin( 'manage_overview_page.php' );
ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

plugin_require_api( 'core/config_api.php' );
require_api( 'custom_field_api.php' );

$t_this_page = 'manage_rule';
Expand Down Expand Up @@ -123,5 +122,5 @@
<form>

<?php
layout_page_end();
ERP_page_end( __FILE__ );
?>
8 changes: 3 additions & 5 deletions pages/view_changelog.php
Expand Up @@ -2,12 +2,10 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

layout_page_header( plugin_lang_get( 'plugin_title' ) );

layout_page_begin( 'manage_overview_page.php' );

plugin_require_api( 'core/config_api.php' );

ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

$t_this_page = 'view_changelog';
ERP_print_menu( $t_this_page );

Expand All @@ -20,5 +18,5 @@
</pre>

<?php
layout_page_end();
ERP_page_end( __FILE__ );
?>
8 changes: 3 additions & 5 deletions pages/view_readme.php
Expand Up @@ -2,12 +2,10 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

layout_page_header( plugin_lang_get( 'plugin_title' ) );

layout_page_begin( 'manage_overview_page.php' );

plugin_require_api( 'core/config_api.php' );

ERP_page_begin( plugin_lang_get( 'plugin_title' ) );

$t_this_page = 'view_readme';
ERP_print_menu( $t_this_page );

Expand All @@ -20,5 +18,5 @@
</pre>

<?php
layout_page_end();
ERP_page_end( __FILE__ );
?>

0 comments on commit 4d58a78

Please sign in to comment.