Class Dialog
Documentation of includes/core/dialog.class.php
Provides a comfortable, configurable styled Manialink dialog.
Methods
setStyles
Setup the style of the Dialog.
Description
void = setStyles ( array $params )
Parameters
-
textcolor
Color for the text in RGBA format, e.g.
09FF
. -
icon
Icon for the header, choose one from the Manialink styles.
-
height
The default height of the content box is
15.0
, you can change it here.
Example
// Setup the styles
$settings_style = array(
'textcolor' => '09FF',
'icon' => 'Icons64x64_1,ToolLeague1',
'height' => 20.0,
);
// Create the Dialog
$dialog = new Dialog();
$dialog->setStyles($settings_style);
setContent
Setup the content of the title and the main content to display.
Description
void = setContent ( array $params )
Parameters
-
title
Dialog title which will be shown right after the Icon.
-
message
Dialog message which will be shown inside of the dialog.
-
buttons
An array which each inner array reflects a button (
title
andaction
), the maximum amount of buttons is5
. More buttons will be ignored.
Example
// Setup title
$title = 'Initiating payment from server';
// Setup message
$message = 'Are you sure to pay 100.000 to "undef.de"?';
// Build the buttons
$buttons = array(
array(
'title' => 'Yes',
'action' => 'PluginDonate?Action=Payout&Answer=Confirm',
),
array(
'title' => 'No',
'action' => 'PluginDonate?Action=Payout&Answer=Cancel',
),
array(
'title' => 'Abort',
'action' => 'PluginDonate?Action=Payout&Answer=Cancel',
),
);
// Setup content
$settings_content = array(
'title' => $title,
'message' => $message,
'buttons' => $buttons,
);
// Create the Dialog
$dialog = new Dialog();
$dialog->setContent($settings_content);
send
Build, store and send the Dialog to the Player.
Description
void = send ( Class Player object $player, boolean $hideclick )
Parameters
-
$player
Class Player object
-
$hideclick
If set to
false
, then the Dialog stays open after the Player clicks on it. Default value istrue
.
Example
// Setup the styles
$settings_style = array(
'textcolor' => '09FF',
'icon' => 'Icons64x64_1,ToolLeague1',
'height' => 20.0,
);
// Setup title
$title = 'Initiating payment from server';
// Setup message
$message = 'Are you sure to pay 100.000 to "undef.de"?';
// Build the buttons
$buttons = array(
array(
'title' => 'Yes',
'action' => 'PluginDonate?Action=Payout&Answer=Confirm',
),
array(
'title' => 'No',
'action' => 'PluginDonate?Action=Payout&Answer=Cancel',
),
array(
'title' => 'Abort',
'action' => 'PluginDonate?Action=Payout&Answer=Cancel',
),
);
// Setup content
$settings_content = array(
'title' => $title,
'message' => $message,
'buttons' => $buttons,
);
// Create the Dialog
$dialog = new Dialog();
$dialog->setStyles($settings_style);
$dialog->setContent($settings_content);
$dialog->send($player, false);
Class Dialog
Documentation of includes/core/dialog.class.php
Provides a comfortable, configurable styled Manialink Dialog.
Properties
Members | Example data or description |
---|---|
$dialog->layout |
Array for the given layout |
$dialog->settings |
Array for the given settings |
$dialog->content |
Array for the given content |
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
Windows is a registered trademark of Microsoft Corporation.