Customising Message Boxes in Admin Mode

When adding controls to the Admin Toolbar or Organizer, there are several places in TUIX where you have the option to create confirmation boxes using the <confirm> tag that look like this:

Screen Shot 2014-07-24 at 12.37.08.png

where the message text, the text on the buttons and the icon can all be customised.

Any text that you output in your adminToolbarAJAX(), saveAdminBox() and storekeeperAJAX() methods will also be displayed in a similar-looking a popout message, usually like this:

Screen Shot 2014-07-24 at 12.43.13.png

where whatever output you made is displayed as the message text.

In this case, the icon is the "STOP" error icon and the text on the button says "OK", however these (and many other things) can be customised by including a control comment before your message.

The following HTML comments can be used as controls; they must appear at the very start of the output, and if you include more than one, they must appear in the following order:

<!--Message_Type:None-->

This removes the icon.

<!--Message_Type:Error-->

This shows the "STOP" error icon (which is the default behaviour).

<!--Message_Type:Success-->

This shows a green tick.

<!--Message_Type:Warning-->

This shows a yellow warning triangle.

<!--Message_Type:Question-->

This shows a blue question mark.

<!--Reload_Organizer-->

This will send the Admin to the Welcome page, then back to Organizer.

This will only work if the Admin is currently viewing Organizer, and should only be used in full mode.

Including this control will mean that the Admin won't actually see the popout message appear , however if there was a message after this control comment then it will be displayed to them using a browser alert() before the reload happens.

<!--Go_To_Organizer_Panel:path-->

This will send the Admin to a different panel in Organizer.

This will only work if the Admin is currently viewing Organizer.

Including this control will mean that the Admin won't actually see the popout message appear.

<!--Open_Admin_Box:path//id-->

This will open an Admin Box, using the specific path.

You can also specify the id of the key, by adding it after the path separated by two slashes.

Including this control will mean that the Admin won't actually see the popout message appear.

<!--Go_To_URL:url-->

This will direct the Admin to a URL.

If this is not an absolute URL, the URL base-path will be automatically added to it.

Including this control will mean that the Admin won't actually see the popout message appear.

<!--Button_HTML:html-->

You can use this tag to change the HTML for the buttons.

For example, the default value for error messages is:

<input type="button" class="submit" value="OK"/>

whereas a confirm message might look more like:

<input class="submit_selected" type="button" onclick="doSomething();" value="Logout">
<input type="button" value="Cancel">

<!--Logged_Out-->

This signals to the CMS that the Admin has been logged out.

This changes the behaviour of the buttons, so you cannot use both this control and the Button_HTML control.