Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom flash_message messages #881

Closed
Sama34 opened this issue Jul 5, 2014 · 0 comments
Closed

Allow custom flash_message messages #881

Sama34 opened this issue Jul 5, 2014 · 0 comments
Assignees
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Milestone

Comments

@Sama34
Copy link
Contributor

Sama34 commented Jul 5, 2014

With the following modification plug-in aturhos would be able to add custom alerts as follows.

$plugins->add_hook('admin_page_output_header', 'helloworld_admin_page_output_header');

function helloworld_admin_page_output_header()
{
    global $helloworld, $page;

    $message = 'Hello World! is up-to-date. Congratulations!';
    $type = 'success';

    if($helloworld->requires_update == true)
    {
        $message = 'Hello World! plug-in needs to be updated. Please click here to update the plug-in.';
        $type = 'error';
    }

    $page->extra_messages['helloworld'] = array('message' => $message, 'type' => $type);
}

Refference: http://community.mybb.com/thread-118099.html

@Sama34 Sama34 added this to the 1.8 Beta 3 milestone Jul 5, 2014
@Sama34 Sama34 self-assigned this Jul 5, 2014
@Sama34 Sama34 added fixed and removed feedback labels Jul 9, 2014
@Sama34 Sama34 closed this as completed Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

No branches or pull requests

1 participant