[435] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
[631] | 3 | # This file is part of Ductile, a theme for Dotclear |
---|
[435] | 4 | # |
---|
[631] | 5 | # Copyright (c) 2011 - Association Dotclear |
---|
[435] | 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 | { |
---|
[622] | 21 | global $core; |
---|
[1133] | 22 | if ($core->blog->settings->system->theme != 'ductile') { return; } |
---|
| 23 | |
---|
[435] | 24 | echo "\n".'<!-- Header directives for Ductile configuration -->'."\n"; |
---|
[1133] | 25 | $core->auth->user_prefs->addWorkspace('accessibility'); |
---|
| 26 | if (!$core->auth->user_prefs->accessibility->nodragdrop) { |
---|
| 27 | echo |
---|
[2495] | 28 | dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). |
---|
| 29 | dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); |
---|
[1133] | 30 | echo <<<EOT |
---|
[622] | 31 | <script type="text/javascript"> |
---|
| 32 | //<![CDATA[ |
---|
| 33 | $(function() { |
---|
[1133] | 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'); |
---|
[622] | 50 | }); |
---|
| 51 | //]]> |
---|
| 52 | </script> |
---|
| 53 | EOT; |
---|
| 54 | } |
---|
[1133] | 55 | |
---|
[435] | 56 | } |
---|
| 57 | } |
---|