myBlogNumbers/_widgets.php

131 lines
3.0 KiB
PHP
Raw Normal View History

2015-04-23 17:27:33 +00:00
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of myBlogNumbers, a plugin for Dotclear 2.
#
2021-08-27 16:24:02 +00:00
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
2015-04-23 17:27:33 +00:00
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
2021-08-27 16:24:02 +00:00
return null;
2015-04-23 17:27:33 +00:00
}
$core->addBehavior('initWidgets', 'myBlogNumbersWidgetAdmin');
function myBlogNumbersWidgetAdmin($w)
{
2021-08-27 16:24:02 +00:00
global $core;
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
$w
->create(
'myblognumbers',
__('My blog numbers'),
'myBlogNumbersWidgetPublic',
null,
__('Show some figures of your blog')
)
->addTitle(__('My blog numbers'))
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# Entry
->setting(
'entry_show',
__('Show entries count'),
1,
'check'
)
->setting(
'entry_title',
__('Title for entries count:'),
__('Entries:'),
'text'
)
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# Cat
->setting(
'cat_show',
__('Show categories count'),
1,
'check'
)
->setting(
'cat_title',
__('Title for categories count:'),
__('Categories:'),
'text'
)
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# Comment
->setting(
'comment_show',
__('Show comments count'),
1,
'check'
)
->setting(
'comment_title',
__('Title for comments count:'),
__('Comments:'),
'text'
)
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# Trackback
->setting(
'trackback_show',
__('Show trackbacks count'),
1,
'check'
)
->setting(
'trackback_title',
__('Title for trackbacks count:'),
__('Trackbacks:'),
'text'
);
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
if ($core->plugins->moduleExists('tags')) {
# Tag
$w->myblognumbers
->setting(
'tag_show',
__('Show tags count'),
1,
'check'
)
->setting(
'tag_title',
__('Title for tags count:'),
__('Tags:'),
'text'
);
}
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# Users (that post)
$w->myblognumbers
->setting(
'user_show',
__('Show users count'),
1,
'check'
)
->setting(
'user_title',
__('Title for users count:'),
__('Authors:'),
'text'
);
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# --BEHAVIOR-- myBlogNumbersWidgetInit
$core->callBehavior('myBlogNumbersWidgetInit',$w);
2015-04-23 17:27:33 +00:00
2021-08-27 16:24:02 +00:00
# widget option - page to show on
$w->myblognumbers
->addHomeOnly()
->addContentOnly()
->addClass()
->addOffline();
2015-04-23 17:27:33 +00:00
}