postWidgetText/inc/lib.pwt.dashboard.php

62 lines
1.6 KiB
PHP
Raw Normal View History

2021-09-10 19:06:49 +00:00
<?php
2021-09-10 19:18:51 +00:00
/**
* @brief postWidgetText, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2021-09-10 19:06:49 +00:00
if (!defined('DC_CONTEXT_ADMIN')) {
2021-09-10 19:18:51 +00:00
return null;
2021-09-10 19:06:49 +00:00
}
/**
* @ingroup DC_PLUGIN_POSTWIDGETTEXT
* @brief postWidgetText - admin dashboard methods.
* @since 2.6
*/
class postWidgetTextDashboard
{
2021-09-10 19:18:51 +00:00
/**
* Favorites.
*
* @param dcCore $core dcCore instance
* @param arrayObject $favs Array of favorites
*/
public static function favorites(dcCore $core, $favs)
{
$favs->register('postWidgetText', array(
'title' => __('Post widget text'),
'url' => 'plugin.php?p=postWidgetText',
'small-icon' => 'index.php?pf=postWidgetText/icon.png',
'large-icon' => 'index.php?pf=postWidgetText/icon-big.png',
'permissions' => $core->auth->check(
'usage,contentadmin',
$core->blog->id
),
'active_cb' => array(
'postWidgetTextDashboard',
'active'
)
));
}
2021-09-10 19:06:49 +00:00
2021-09-10 19:18:51 +00:00
/**
* Favorites selection.
*
* @param string $request Requested page
* @param array $params Requested parameters
*/
public static function active($request, $params)
{
return $request == 'plugin.php'
&& isset($params['p'])
&& $params['p'] == 'postWidgetText';
}
2021-09-10 19:06:49 +00:00
}