2015-10-15 12:25:38 +02:00
|
|
|
<?php
|
|
|
|
|
2015-11-08 12:40:14 +01:00
|
|
|
/**
|
|
|
|
* Plugin addlink_toolbar.
|
|
|
|
* Adds the addlink input on the linklist page.
|
|
|
|
*/
|
|
|
|
|
2015-10-15 12:25:38 +02:00
|
|
|
/**
|
|
|
|
* When linklist is displayed, add play videos to header's toolbar.
|
|
|
|
*
|
|
|
|
* @param array $data - header data.
|
2015-11-08 12:40:14 +01:00
|
|
|
*
|
2015-10-15 12:25:38 +02:00
|
|
|
* @return mixed - header data with addlink toolbar item.
|
|
|
|
*/
|
2015-11-08 12:40:14 +01:00
|
|
|
function hook_addlink_toolbar_render_header($data)
|
|
|
|
{
|
2015-10-15 12:25:38 +02:00
|
|
|
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.
|
2015-11-08 12:40:14 +01:00
|
|
|
*
|
2015-10-15 12:25:38 +02:00
|
|
|
* @return mixed - includes data with markdown CSS file added.
|
|
|
|
*/
|
2015-11-08 12:40:14 +01:00
|
|
|
function hook_addlink_toolbar_render_includes($data)
|
|
|
|
{
|
2015-10-15 12:25:38 +02:00
|
|
|
if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
|
|
|
|
$data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
2016-08-13 14:22:22 +02:00
|
|
|
}
|