view_action

Allows adding of custom content to HTML code generated by any instance of the helpdeskViewAction class.

Helpdesk

Input (passed by reference)

$params['action'] helpdeskViewAction Action class instance.
$params['view'] waSmarty3View Smarty template engine class instance.
… your plugin code …

Output

{$view_action.%plugin_id%}
Custom content to be returned to a browser.
Helpdesk

Plugin code example

PHP

public function viewAction($params)
{
    if ($params['action'] instanceof helpdeskRequestsInfoAction) {
        return '<div id="myplugin-template" style="display: none;">
                <h1>' . _wp('Hi!') . '</h1>
                <p>' . _wp('This dialog is displayed on every request-viewing page.') . '</p>
            </div>
            <script>
            $("#myplugin-template").clone().show().waDialog({
                buttons: "<a href=\"javascript:void(0);\" class=\"cancel button blue\">' . _wp('Close') . '</a>",
                height: "200px",
                width: "500px"
            });
            </script>';
    }
}