1 | <?php |
||
25 | class Button extends InlineKeyboard |
||
26 | { |
||
27 | /** |
||
28 | * \addtogroup InlineKeyboard InlineKeyboard |
||
29 | * \brief Handle an inline keyboard to send along with messages. |
||
30 | * @{ |
||
31 | */ |
||
32 | |||
33 | /** \brief Stores a reference to the bot that's using the inline keyboard. */ |
||
34 | protected $bot; |
||
35 | |||
36 | /** |
||
37 | * \brief Create an inline keyboard object with localizated buttons. |
||
38 | * @param CoreBot $bot References to the bot that's using the inline keyboard. |
||
39 | * @param array $buttons Buttons passed as inizialization. |
||
40 | */ |
||
41 | 1 | public function __construct(CoreBot &$bot, array $buttons = array()) |
|
48 | |||
49 | |||
50 | /** |
||
51 | * \brief Get a simple Back button with back as <code>callback_data</code>. |
||
52 | * @param $json_serialized return a json serialized string, or an array. |
||
53 | * @return string|array A button with written "back". |
||
54 | */ |
||
55 | public function getBackButton(bool $json_serialized = true) |
||
76 | |||
77 | /** |
||
78 | * \brief Get a Back and a Skip buttons inthe same row. |
||
79 | * \details Back button has callback_data "back" and Skip button has callback_data "skip". |
||
80 | * @param bool $json_serialized return a json serialized string, or an array. |
||
81 | * @return string|array A button with written "back" and one with written "Skip". |
||
82 | */ |
||
83 | public function getBackSkipKeyboard(bool $json_serialized = true) |
||
107 | |||
108 | /** |
||
109 | * \brief Get various buttons for set various languages. |
||
110 | * \details Create a button for each language contained in <code>$localization['languages']</code> variable of $bot object. |
||
111 | * There will be a button per row. |
||
112 | * |
||
113 | * The button's label will include the target language and the current one. |
||
114 | * The callback data for each button will be "cl/key" where key is the key in <code>$localization['languages']</code>. |
||
115 | * @param $prefix Prefix followed by '/' and the language index (en, it..). |
||
116 | * @param $json_serialized Get a JSON-serialized string or an array. |
||
117 | * @return string|array The buttons in the selected type. |
||
118 | */ |
||
119 | public function getChooseLanguageKeyboard(string $prefix = 'cl', bool $json_serialized = true) |
||
160 | |||
161 | /** @} */ |
||
162 | } |
||
163 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.