aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/addlink_toolbar/addlink_toolbar.php
blob: 826a0922fd3227308990f16406449aff812190fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

/**
 * When linklist is displayed, add play videos to header's toolbar.
 *
 * @param array $data - header data.
 * @return mixed - header data with addlink toolbar item.
 */
function hook_addlink_toolbar_render_header($data) {
    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
        $data['fields_toolbar'][] = file_get_contents(PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.html');
    }

    return $data;
}

/**
 * When link list is displayed, include markdown CSS.
 *
 * @param array $data - includes data.
 * @return mixed - includes data with markdown CSS file added.
 */
function hook_addlink_toolbar_render_includes($data) {
    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
        $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
    }

    return $data;
}