noodles/inc/_default_noodles.php

106 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
2022-11-17 20:00:42 +00:00
*
* @package Dotclear
2021-09-08 23:05:05 +00:00
* @subpackage Plugin
2022-11-17 20:00:42 +00:00
*
2021-09-08 23:05:05 +00:00
* @author Jean-Christian Denis and contributors
2022-11-17 20:00:42 +00:00
*
* @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
2022-11-17 20:00:42 +00:00
require __DIR__ . '/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
2022-11-17 20:00:42 +00:00
if (dcCore::app()->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
2022-11-17 20:00:42 +00:00
if (dcCore::app()->plugins->moduleExists('authorMode')
&& dcCore::app()->blog->settings->authormode->authormode_active
2021-09-09 07:12:31 +00:00
) {
$__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
2022-11-17 20:00:42 +00:00
if (dcCore::app()->plugins->moduleExists('rateIt')
&& dcCore::app()->blog->settings->rateit->rateit_active
2021-09-09 07:12:31 +00:00
) {
$__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
2022-11-17 20:00:42 +00:00
if (dcCore::app()->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
2022-11-17 20:00:42 +00:00
dcCore::app()->callBehavior('initDefaultNoodles', $__default_noodles);