noodles/inc/_default_noodles.php

105 lines
3.2 KiB
PHP
Raw Normal View History

2021-09-08 22:53:13 +00:00
<?php
/**
2021-09-08 23:05:05 +00:00
* @brief noodles, a plugin for Dotclear 2
*
* @package Dotclear
2021-09-08 23:05:05 +00:00
* @subpackage Plugin
*
2021-09-08 23:05:05 +00:00
* @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-09 07:12:31 +00:00
if (!defined('DC_RC_PATH')) {
return null;
}
2021-09-08 22:53:13 +00:00
2021-09-09 07:12:31 +00:00
require dirname(__FILE__) . '/class.noodles.php';
2021-09-08 22:53:13 +00:00
global $__default_noodles;
2021-11-01 09:28:22 +00:00
$__default_noodles = new noodles();
2021-09-08 22:53:13 +00:00
# Posts (by public behavior)
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('posts', __('Entries'), '', ['othersNoodles', 'publicPosts'])
->size(48)
->css('float:right;margin:4px;');
2021-09-08 22:53:13 +00:00
# Comments (by public behavior)
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('comments', __('Comments'), '', ['othersNoodles', 'publicComments'])
->active(true)
->size(48)
->css('float:left;margin:4px;');
2021-09-08 22:53:13 +00:00
# Block with post title link (like homepage posts)
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('titlesposts', __('Entries titles'), ['genericNoodles', 'postURL'])
->target('.post-title a')
->css('margin-right:2px;');
2021-09-08 22:53:13 +00:00
if ($core->plugins->moduleExists('widgets')) {
# Widget Selected entries
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('bestof', __('Selected entries'), ['genericNoodles', 'postURL'])
->target('.selected li a')
->css('margin-right:2px;');
# Widget Last entries
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('lastposts', __('Last entries'), ['genericNoodles', 'postURL'])
->target('.lastposts li a')
->css('margin-right:2px;');
2021-11-01 09:28:22 +00:00
# Widget Last comments
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('lastcomments', __('Last comments'), ['widgetsNoodles', 'lastcomments'])
->active(true)
->target('.lastcomments li a')
->css('margin-right:2px;');
2021-09-08 22:53:13 +00:00
}
# Plugin auhtorMode
if ($core->plugins->moduleExists('authorMode')
2021-09-09 07:12:31 +00:00
&& $core->blog->settings->authormode->authormode_active
) {
$__default_noodles
->add('authorswidget', __('Authors widget'), ['authormodeNoodles', 'authors'])
->target('#authors ul li a')
->css('margin-right:2px;');
$__default_noodles
->add('author', __('Author'), '', ['authormodeNoodles', 'author'])
->active(true)
->size(48)
->target('.dc-author #content-info h2')
->css('clear:left; float:left;margin-right:2px;');
$__default_noodles
->add('authors', __('Authors'), ['authormodeNoodles', 'authors'])
->active(true)
->size(32)
->target('.dc-authors .author-info h2 a')
->css('clear:left; float:left; margin:4px;');
2021-09-08 22:53:13 +00:00
}
# Plugin rateIt
if ($core->plugins->moduleExists('rateIt')
2021-09-09 07:12:31 +00:00
&& $core->blog->settings->rateit->rateit_active
) {
$__default_noodles
->add('rateitpostsrank', __('Top rated entries'), ['genericNoodles', 'postURL'])
->target('.rateitpostsrank.rateittypepost ul li a') // Only "post" type
->css('margin-right:2px;');
2021-09-08 22:53:13 +00:00
}
# Plugin lastpostsExtend
if ($core->plugins->moduleExists('lastpostsExtend')) {
2021-09-09 07:12:31 +00:00
$__default_noodles
->add('lastpostsextend', __('Last entries (extend)'), ['genericNoodles', 'postURL'])
->target('.lastpostsextend ul li a')
->css('margin-right:2px;');
2021-09-08 22:53:13 +00:00
}
# --BEHAVIOR-- initDefaultNoodles
2021-09-09 07:12:31 +00:00
$core->callBehavior('initDefaultNoodles', $__default_noodles);