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)
|
|
|
|
{
|
2021-10-29 23:12:43 +00:00
|
|
|
$favs->register('postWidgetText', [
|
|
|
|
'title' => __('Post widget text'),
|
|
|
|
'url' => $core->adminurl->get('admin.plugin.postWidgetText'),
|
|
|
|
'small-icon' => dcPage::getPF('postWidgetText/icon.png'),
|
|
|
|
'large-icon' => dcPage::getPF('postWidgetText/icon-big.png'),
|
|
|
|
'permissions' => $core->auth->check('usage,contentadmin', $core->blog->id),
|
|
|
|
'active_cb' => ['postWidgetTextDashboard', 'active']
|
|
|
|
]);
|
2021-09-10 19:18:51 +00:00
|
|
|
}
|
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
|
|
|
}
|