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) {
|
2016-12-01 11:38:21 +01:00
|
|
|
$form = array(
|
|
|
|
'attr' => array(
|
|
|
|
'method' => 'GET',
|
|
|
|
'action' => '',
|
|
|
|
'name' => 'addform',
|
|
|
|
'class' => 'addform',
|
|
|
|
),
|
|
|
|
'inputs' => array(
|
|
|
|
array(
|
|
|
|
'type' => 'text',
|
|
|
|
'name' => 'post',
|
|
|
|
'placeholder' => 'URI',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'submit',
|
|
|
|
'value' => 'Add link',
|
|
|
|
'class' => 'bigbutton',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
$data['fields_toolbar'][] = $form;
|
2015-10-15 12:25:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|