1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # This file is part of Ductile, a theme for Dotclear |
---|
4 | # |
---|
5 | # Copyright (c) 2011 - Association Dotclear |
---|
6 | # Licensed under the GPL version 2.0 license. |
---|
7 | # See LICENSE file or |
---|
8 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
9 | # |
---|
10 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
11 | |
---|
12 | if (!defined('DC_RC_PATH')) { return; } |
---|
13 | // public part below |
---|
14 | |
---|
15 | if (!defined('DC_CONTEXT_ADMIN')) { return false; } |
---|
16 | // admin part below |
---|
17 | |
---|
18 | # Behaviors |
---|
19 | $GLOBALS['core']->addBehavior('adminPageHTMLHead',array('tplDuctileThemeAdmin','adminPageHTMLHead')); |
---|
20 | |
---|
21 | class tplDuctileThemeAdmin |
---|
22 | { |
---|
23 | public static function adminPageHTMLHead() |
---|
24 | { |
---|
25 | global $core; |
---|
26 | if ($core->blog->settings->system->theme != 'ductile') { return; } |
---|
27 | |
---|
28 | echo "\n".'<!-- Header directives for Ductile configuration -->'."\n"; |
---|
29 | $core->auth->user_prefs->addWorkspace('accessibility'); |
---|
30 | if (!$core->auth->user_prefs->accessibility->nodragdrop) { |
---|
31 | echo |
---|
32 | dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). |
---|
33 | dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); |
---|
34 | echo <<<EOT |
---|
35 | <script type="text/javascript"> |
---|
36 | //<![CDATA[ |
---|
37 | $(function() { |
---|
38 | $("#stickerslist").sortable({'cursor':'move'}); |
---|
39 | $("#stickerslist tr").hover(function () { |
---|
40 | $(this).css({'cursor':'move'}); |
---|
41 | }, function () { |
---|
42 | $(this).css({'cursor':'auto'}); |
---|
43 | }); |
---|
44 | $('#theme_config').submit(function() { |
---|
45 | var order=[]; |
---|
46 | $("#stickerslist tr td input.position").each(function() { |
---|
47 | order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1')); |
---|
48 | }); |
---|
49 | $("input[name=ds_order]")[0].value = order.join(','); |
---|
50 | return true; |
---|
51 | }); |
---|
52 | $("#stickerslist tr td input.position").hide(); |
---|
53 | $("#stickerslist tr td.handle").addClass('handler'); |
---|
54 | }); |
---|
55 | //]]> |
---|
56 | </script> |
---|
57 | EOT; |
---|
58 | } |
---|
59 | |
---|
60 | } |
---|
61 | } |
---|