[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; } |
---|
[2895] | 13 | // public part below |
---|
| 14 | |
---|
| 15 | if (!defined('DC_CONTEXT_ADMIN')) { return false; } |
---|
| 16 | // admin part below |
---|
[435] | 17 | |
---|
| 18 | # Behaviors |
---|
| 19 | $GLOBALS['core']->addBehavior('adminPageHTMLHead',array('tplDuctileThemeAdmin','adminPageHTMLHead')); |
---|
| 20 | |
---|
| 21 | class tplDuctileThemeAdmin |
---|
| 22 | { |
---|
| 23 | public static function adminPageHTMLHead() |
---|
| 24 | { |
---|
[622] | 25 | global $core; |
---|
[1133] | 26 | if ($core->blog->settings->system->theme != 'ductile') { return; } |
---|
| 27 | |
---|
[435] | 28 | echo "\n".'<!-- Header directives for Ductile configuration -->'."\n"; |
---|
[1133] | 29 | $core->auth->user_prefs->addWorkspace('accessibility'); |
---|
| 30 | if (!$core->auth->user_prefs->accessibility->nodragdrop) { |
---|
| 31 | echo |
---|
[2495] | 32 | dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). |
---|
| 33 | dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); |
---|
[1133] | 34 | echo <<<EOT |
---|
[622] | 35 | <script type="text/javascript"> |
---|
| 36 | //<![CDATA[ |
---|
| 37 | $(function() { |
---|
[1133] | 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'); |
---|
[622] | 54 | }); |
---|
| 55 | //]]> |
---|
| 56 | </script> |
---|
| 57 | EOT; |
---|
| 58 | } |
---|
[1133] | 59 | |
---|
[435] | 60 | } |
---|
| 61 | } |
---|