Component Recite_Dialog

Methods used for managing dialog boxes in the Recite CMS Control Panel

Method: Recite_Dialog.Alert

<static> Recite_Dialog.Alert(alertOptions)

Show an alert box with a static message. Alert boxes are simply information boxes with a single Ok button.

  • Parameters:

    • Object alertOptions - The options used for displaying the dialog

    • String alertOptions.msg - The message to display in the alert box.

    • String alertOptions.title - Optional, Default: "Alert" - The text to use for the dialog title

    • String alertOptions.okText - Optional, Default: "Ok" - The text to use for the OK button

    • String|Integer alertOptions.width - Optional, Default: "500" - The width in pixels of the dialog

    • String|Integer alertOptions.height - Optional, Default: "auto" - The height in pixels of the dialog

  • Returns: Void

Method: Recite_Dialog.Confirm

<static> Recite_Dialog.Confirm(confirmOptions)

Show a confirmation dialog using a static message. A confirmation dialog is a dialog that typically shows two buttons: "Ok" and "Cancel".

  • Parameters:

    • Object confirmOptions - The options used for displaying the dialog

    • String confirmOptions.url - Optional - The URL to post to when OK is clicked (if custom onOk callback is not specified).

    • String confirmOptions.msg - The message to display in the confirmation box.

    • Object confirmOptions.data - Optional - Additional data to post when OK is clicked (if custom onOk callback is not specified).

    • String confirmOptions.method - Optional, Default: "GET" - Whether the request should be GET or POST

    • String confirmOptions.okText - Optional, Default: "Ok" - The text to use for the OK button

    • String confirmOptions.cancelText - Optional, Default: "Cancel" - The text to use for the cancel button

    • String confirmOptions.title - Optional, Default: "Please Confirm" - The text to use for the dialog title

    • Function confirmOptions.onOk - Optional - Function to execute when OK is clicked. Accepts dialog as its only argument. Dialog is not automatically closed if this is specified.

    • Function confirmOptions.onCancel - Optional - Function to execute when cancel is clicked. Accepts dialog as its only argument. Dialog is not automatically closed if this is specified.

  • Returns: Void

Method: Recite_Dialog.ConfirmFromUrl

<static> Recite_Dialog.ConfirmFromUrl(confirmOptions)

Show a confirmation dialog using content loaded via AjaxA confirmation dialog is a dialog that typically shows two buttons: "Ok" and "Cancel".

  • Parameters:

    • Object confirmOptions - The options used for displaying the dialog

    • String confirmOptions.url - Optional - The URL to post to when OK is clicked (if custom onOk callback is not specified).

    • Object confirmOptions.data - Optional - Additional data to post when OK is clicked (if custom onOk callback is not specified).

    • String confirmOptions.method - Optional, Default: "GET" - Whether the request should be GET or POST

    • String confirmOptions.msgUrl - The URL to retrieve the dialog message from

    • Object confirmOptions.msgData - Optional - Additional data to use in request for dialog message. If request is get and includes query parameters, this should not be specified.

    • String confirmOptions.okText - Optional, Default: "Ok" - The text to use for the OK button

    • String confirmOptions.cancelText - Optional, Default: "Cancel" - The text to use for the cancel button

    • String confirmOptions.title - Optional, Default: "Please Confirm" - The text to use for the dialog title

    • Function confirmOptions.onOk - Optional - Function to execute when OK is clicked. Accepts dialog as its only argument. Dialog is not automatically closed if this is specified.

    • Function confirmOptions.onCancel - Optional - Function to execute when cancel is clicked. Accepts dialog as its only argument. Dialog is not automatically closed if this is specified.

  • Returns: Void

Method: Recite_Dialog.FromAjax

<static> Recite_Dialog.FromAjax(url, data, method)

Fetch a dialog box and display it. The URL the dialog is fetch from must build a dialog using the PHP class Application_Cp_Ui_Dialog (or a sub-class) and return it accordingly.

  • Parameters:

    • String url - The URL to retrieve the dialog from

    • Object data - Optional - Any additional data to include in the Ajax request

    • String method - Optional, Default: "get" - The request method to use (get or post)

  • Returns: Void

Method: Recite_Dialog.SelectorFromJSON

<static> Recite_Dialog.SelectorFromJSON(selectorOptions)

Show a dialog box with a single dropdown box. Options are retrieved from the supplied URL, then the user must select an option. When they click Ok then selected option is passed to the supplied callback. The selector must return data generated by a PHP sub-class of Components_DriverSelector_Options_Abstract. Users can either select an option or cancel the dialog.

  • Parameters:

    • Object selectorOptions - The options used to generate the dialog

    • String selectorOptions.url - The URL to retrieve the options from.

    • String selectorOptions.emptyMsg - Optional - The message to display if no options are found

    • String selectorOptions.emptyTitle - Optional, Default: "No options found" - The title to use if no options are found

    • String selectorOptions.msg - Optional - The message to display above the dropdown

    • String selectorOptions.okText - Optional, Default: "Ok" - The text to display in the "Ok" button

    • String selectorOptions.cancelText - Optional, Default: "Cancel" - The text to display in the "Cancel" button

    • Function selectorOptions.select - The function that is called when an option is selected. The value of the selected option is passed as the only argument

  • Returns: Void