Dotclear

source: themes/ductile/_prepend.php @ 2895:2e816f7f0ea4

Revision 2895:2e816f7f0ea4, 1.7 KB checked in by franck <carnet.franck.paul@…>, 11 years ago (diff)

Admin behaviour(s) should not be defined in public mode

Line 
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
12if (!defined('DC_RC_PATH')) { return; }
13// public part below
14
15if (!defined('DC_CONTEXT_ADMIN')) { return false; }
16// admin part below
17
18# Behaviors
19$GLOBALS['core']->addBehavior('adminPageHTMLHead',array('tplDuctileThemeAdmin','adminPageHTMLHead'));
20
21class 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>
57EOT;
58          }
59
60     }
61}
Note: See TracBrowser for help on using the repository browser.

Sites map