Dotclear

source: plugins/blogroll/_widgets.php @ 3731:3770620079d4

Revision 3731:3770620079d4, 1.6 KB checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

Simplify licence block at the beginning of each file

Line 
1<?php
2/**
3 * @brief blogroll, a plugin for Dotclear 2
4 *
5 * @package Dotclear
6 * @subpackage Plugins
7 *
8 * @copyright Olivier Meunier & Association Dotclear
9 * @copyright GPL-2.0-only
10 */
11
12if (!defined('DC_RC_PATH')) {return;}
13
14$core->addBehavior('initWidgets', array('blogrollWidgets', 'initWidgets'));
15$core->addBehavior('initDefaultWidgets', array('blogrollWidgets', 'initDefaultWidgets'));
16
17class blogrollWidgets
18{
19    public static function initWidgets($w)
20    {
21        $w->create('links', __('Blogroll'), array('tplBlogroll', 'linksWidget'), null, 'Blogroll list');
22        $w->links->setting('title', __('Title (optional)') . ' :', __('Links'));
23
24        $br         = new dcBlogroll($GLOBALS['core']->blog);
25        $h          = $br->getLinksHierarchy($br->getLinks());
26        $h          = array_keys($h);
27        $categories = array(__('All categories') => '');
28        foreach ($h as $v) {
29            if ($v) {
30                $categories[$v] = $v;
31            }
32        }
33        unset($br, $h);
34        $w->links->setting('category', __('Category'), '', 'combo', $categories);
35
36        $w->links->setting('homeonly', __('Display on:'), 1, 'combo',
37            array(
38                __('All pages')           => 0,
39                __('Home page only')      => 1,
40                __('Except on home page') => 2
41            )
42        );
43        $w->links->setting('content_only', __('Content only'), 0, 'check');
44        $w->links->setting('class', __('CSS class:'), '');
45        $w->links->setting('offline', __('Offline'), 0, 'check');
46    }
47
48    public static function initDefaultWidgets($w, $d)
49    {
50        $d['extra']->append($w->links);
51    }
52}
Note: See TracBrowser for help on using the repository browser.

Sites map