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 | |
---|
14 | # Behaviors |
---|
15 | $GLOBALS['core']->addBehavior('adminPageHTMLHead',array('tplDuctileThemeAdmin','adminPageHTMLHead')); |
---|
16 | |
---|
17 | class tplDuctileThemeAdmin |
---|
18 | { |
---|
19 | public static function adminPageHTMLHead() |
---|
20 | { |
---|
21 | global $core; |
---|
22 | if ($core->blog->settings->system->theme != 'ductile') { return; } |
---|
23 | |
---|
24 | echo "\n".'<!-- Header directives for Ductile configuration -->'."\n"; |
---|
25 | $core->auth->user_prefs->addWorkspace('accessibility'); |
---|
26 | if (!$core->auth->user_prefs->accessibility->nodragdrop) { |
---|
27 | echo |
---|
28 | dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). |
---|
29 | dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); |
---|
30 | echo <<<EOT |
---|
31 | <script type="text/javascript"> |
---|
32 | //<![CDATA[ |
---|
33 | $(function() { |
---|
34 | $("#stickerslist").sortable({'cursor':'move'}); |
---|
35 | $("#stickerslist tr").hover(function () { |
---|
36 | $(this).css({'cursor':'move'}); |
---|
37 | }, function () { |
---|
38 | $(this).css({'cursor':'auto'}); |
---|
39 | }); |
---|
40 | $('#theme_config').submit(function() { |
---|
41 | var order=[]; |
---|
42 | $("#stickerslist tr td input.position").each(function() { |
---|
43 | order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1')); |
---|
44 | }); |
---|
45 | $("input[name=ds_order]")[0].value = order.join(','); |
---|
46 | return true; |
---|
47 | }); |
---|
48 | $("#stickerslist tr td input.position").hide(); |
---|
49 | $("#stickerslist tr td.handle").addClass('handler'); |
---|
50 | }); |
---|
51 | //]]> |
---|
52 | </script> |
---|
53 | EOT; |
---|
54 | } |
---|
55 | |
---|
56 | } |
---|
57 | } |
---|