1 | <?php |
||
13 | class Pre_Connection_JITM extends JITM { |
||
14 | |||
15 | /** |
||
16 | * Filters and formats the messages for the client-side JS renderer |
||
17 | * |
||
18 | * @param string $message_path Current message path. |
||
19 | * |
||
20 | * @return array Formatted messages. |
||
21 | */ |
||
22 | private function filter_messages( $message_path ) { |
||
64 | |||
65 | /** |
||
66 | * Validates that each of the messages contains all of the required keys: |
||
67 | * - id |
||
68 | * - message_path |
||
69 | * - message |
||
70 | * - description |
||
71 | * - button_link |
||
72 | * - button_caption |
||
73 | * |
||
74 | * @param array $messages An array of JITM messages. |
||
75 | * |
||
76 | * @return array An array of JITM messages that contain all of the required keys. |
||
77 | */ |
||
78 | private function validate_messages( $messages ) { |
||
94 | |||
95 | /** |
||
96 | * Get the icon for the message. |
||
97 | * |
||
98 | * The message may contain an 'icon' key. If the value of the 'icon' key matches a supported icon (or empty string), the value is used. |
||
99 | * If the message does not contain an icon key or if the value does not match a supported icon, the Jetpack icon is used by default. |
||
100 | * |
||
101 | * @param array $message A pre-connection JITM. |
||
102 | * |
||
103 | * @return string The icon to use in the JITM. |
||
104 | */ |
||
105 | private function get_message_icon( $message ) { |
||
122 | |||
123 | /** |
||
124 | * Retrieve the current message to display keyed on query string and message path |
||
125 | * |
||
126 | * @param string $message_path The message path to ask for. |
||
127 | * @param string $query The query string originally from the front end. Unused in this subclass. |
||
128 | * @param bool $full_jp_logo_exists If there is a full Jetpack logo already on the page. |
||
129 | * |
||
130 | * @return array The JITMs to show, or an empty array if there is nothing to show |
||
131 | */ |
||
132 | public function get_messages( $message_path, $query, $full_jp_logo_exists ) { |
||
159 | |||
160 | /** |
||
161 | * Dismisses a JITM ID so that it will no longer be shown. |
||
162 | * |
||
163 | * @param string $id The id of the JITM that was dismissed. |
||
164 | * |
||
165 | * @return bool Always true |
||
166 | */ |
||
167 | public function dismiss( $id ) { |
||
171 | } |
||
172 |