Dotclear

source: themes/ductile/_prepend.php @ 3874:ab8368569446

Revision 3874:ab8368569446, 1.7 KB checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

short notation for array (array() → [])

Line 
1<?php
2/**
3 * @brief Ductile, a theme for Dotclear 2
4 *
5 * @package Dotclear
6 * @subpackage Themes
7 *
8 * @copyright Olivier Meunier & Association Dotclear
9 * @copyright GPL-2.0-only
10 */
11
12namespace themes\ductile;
13
14if (!defined('DC_RC_PATH')) {return;}
15// public part below
16
17if (!defined('DC_CONTEXT_ADMIN')) {return false;}
18// admin part below
19
20# Behaviors
21$GLOBALS['core']->addBehavior('adminPageHTMLHead', [__NAMESPACE__ . '\tplDuctileThemeAdmin', 'adminPageHTMLHead']);
22
23class tplDuctileThemeAdmin
24{
25    public static function adminPageHTMLHead()
26    {
27        global $core;
28        if ($core->blog->settings->system->theme != 'ductile') {return;}
29
30        echo "\n" . '<!-- Header directives for Ductile configuration -->' . "\n";
31        $core->auth->user_prefs->addWorkspace('accessibility');
32        if (!$core->auth->user_prefs->accessibility->nodragdrop) {
33            echo
34            \dcPage::jsLoad('js/jquery/jquery-ui.custom.js') .
35            \dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');
36            echo <<<EOT
37<script type="text/javascript">
38$(function() {
39    $('#stickerslist').sortable({'cursor':'move'});
40    $('#stickerslist tr').hover(function () {
41        $(this).css({'cursor':'move'});
42    }, function () {
43        $(this).css({'cursor':'auto'});
44    });
45    $('#theme_config').submit(function() {
46        var order=[];
47        $('#stickerslist tr td input.position').each(function() {
48            order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1'));
49        });
50        $('input[name=ds_order]')[0].value = order.join(',');
51        return true;
52    });
53    $('#stickerslist tr td input.position').hide();
54    $('#stickerslist tr td.handle').addClass('handler');
55});
56</script>
57EOT;
58        }
59
60    }
61}
Note: See TracBrowser for help on using the repository browser.

Sites map