~automne-team/automne/4.2

« back to all changes in this revision

Viewing changes to automne/admin/template.php

  • Committer: sebastien
  • Date: 2008-11-26 17:12:36 UTC
  • Revision ID: sebastien_sebastien-20081126171236-16r3kxfuz2kmq2qe
Tags: V4_0_0a0
4.0.0a0 :
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
 
3
// +----------------------------------------------------------------------+
 
4
// | Automne (TM)                                                                                                                 |
 
5
// +----------------------------------------------------------------------+
 
6
// | Copyright (c) 2000-2009 WS Interactive                                                               |
 
7
// +----------------------------------------------------------------------+
 
8
// | Automne is subject to version 2.0 or above of the GPL license.               |
 
9
// | The license text is bundled with this package in the file                    |
 
10
// | LICENSE-GPL, and is available through the world-wide-web at                  |
 
11
// | http://www.gnu.org/copyleft/gpl.html.                                                                |
 
12
// +----------------------------------------------------------------------+
 
13
// | Author: S�bastien Pauchet <sebastien.pauchet@ws-interactive.fr>      |
 
14
// +----------------------------------------------------------------------+
 
15
//
 
16
// $Id: template.php,v 1.1.1.1 2008/11/26 17:12:05 sebastien Exp $
 
17
 
 
18
/**
 
19
  * PHP page : Load template detail window.
 
20
  * Used accross an Ajax request. Render template informations.
 
21
  * 
 
22
  * @package CMS
 
23
  * @subpackage admin
 
24
  * @author S�bastien Pauchet <sebastien.pauchet@ws-interactive.fr>
 
25
  */
 
26
 
 
27
require_once($_SERVER["DOCUMENT_ROOT"]."/cms_rc_admin.php");
 
28
 
 
29
define("MESSAGE_TOOLBAR_HELP",1073);
 
30
define("MESSAGE_PAGE_SAVE", 952);
 
31
define("MESSAGE_SELECT_PICTURE",528);
 
32
define("MESSAGE_IMAGE",803);
 
33
define("MESSAGE_SELECT_FILE",534);
 
34
 
 
35
$winId = sensitiveIO::request('winId', '', 'templateWindow');
 
36
$templateId = sensitiveIO::request('template', 'sensitiveIO::isPositiveInteger', 'createTemplate');
 
37
 
 
38
//load interface instance
 
39
$view = CMS_view::getInstance();
 
40
//set default display mode for this page
 
41
$view->setDisplayMode(CMS_view::SHOW_RAW);
 
42
 
 
43
//CHECKS user has templates clearance
 
44
if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDIT_TEMPLATES)) { //templates
 
45
        CMS_grandFather::raiseError('User has no rights template editions');
 
46
        $view->setActionMessage('Vous n\'avez pas le droit de g�rer les mod�les de pages ...');
 
47
        $view->show();
 
48
}
 
49
 
 
50
//load template if any
 
51
if (sensitiveIO::isPositiveInteger($templateId)) {
 
52
        $template = CMS_pageTemplatesCatalog::getByID($templateId);
 
53
        if (!$template || $template->hasError()) {
 
54
                CMS_grandFather::raiseError('Unknown template for given Id : '.$templateId);
 
55
                $view->show();
 
56
        }
 
57
} else {
 
58
        //create new user
 
59
        $template = new CMS_pageTemplate();
 
60
}
 
61
 
 
62
//MAIN TAB
 
63
 
 
64
//Need to sanitize all datas which can contain single quotes
 
65
$label = sensitiveIO::sanitizeJSString($template->getLabel());
 
66
$description = sensitiveIO::sanitizeJSString($template->getDescription());
 
67
$templateDefinition = $template->getDefinition();
 
68
$imageName = $template->getImage();
 
69
$templateGroups = $template->getGroups();
 
70
$websitesDenied = $template->getWebsitesDenied();
 
71
 
 
72
//image
 
73
$maxFileSize = CMS_file::getMaxUploadFileSize('K');
 
74
if ($imageName && file_exists(PATH_TEMPLATES_IMAGES_FS.'/'.$imageName)) {
 
75
        $image = new CMS_file(PATH_TEMPLATES_IMAGES_FS.'/'.$imageName);
 
76
        $imageDatas = array(
 
77
                'filename'              => $image->getName(false),
 
78
                'filepath'              => $image->getFilePath(CMS_file::WEBROOT),
 
79
                'filesize'              => $image->getFileSize(),
 
80
                'fileicon'              => $image->getFileIcon(CMS_file::WEBROOT),
 
81
                'extension'             => $image->getExtension(),
 
82
        );
 
83
} else {
 
84
        $imageDatas = array(
 
85
                'filename'              => '',
 
86
                'filepath'              => '',
 
87
                'filesize'              => '',
 
88
                'fileicon'              => '',
 
89
                'extension'             => '',
 
90
        );
 
91
}
 
92
$imageDatas = sensitiveIO::jsonEncode($imageDatas);
 
93
 
 
94
$fileDatas = array(
 
95
        'filename'              => '',
 
96
        'filepath'              => '',
 
97
        'filesize'              => '',
 
98
        'fileicon'              => '',
 
99
        'extension'             => '',
 
100
);
 
101
 
 
102
//Groups
 
103
$allGroups = CMS_pageTemplatesCatalog::getAllGroups();
 
104
$groupsfield = '';
 
105
if ($allGroups) {
 
106
        $columns = sizeof($allGroups) < 6 ? sizeof($allGroups) : 6;
 
107
        $groupsfield .= "{
 
108
                xtype:          'checkboxgroup',
 
109
                fieldLabel: '<span class=\"atm-help\" ext:qtip=\"Vous pouvez utiliser des groupes pour cat�goriser votre mod�le de page. Vous pourrez ainsi simplifier sa s�lection mais aussi associer des droits aux utilisateurs sur ces groupes. Ceci permettra de limiter l\'usage de certains mod�les sp�cifiques � certains profils d\'utilisateurs.\">Groupes</span>',
 
110
                columns:        {$columns},
 
111
                items: [";
 
112
                foreach ($allGroups as $aGroup) {
 
113
                        $groupsfield .= "{boxLabel: '{$aGroup}', inputValue:'{$aGroup}', name: 'groups[]', checked:".(isset($templateGroups[$aGroup]) ? 'true' : 'false')."},";
 
114
                }
 
115
                //remove last comma from groups
 
116
                $groupsfield = substr($groupsfield, 0, -1);
 
117
                $groupsfield .= "
 
118
                ]
 
119
        },";
 
120
}
 
121
 
 
122
//Websites
 
123
$websites = CMS_websitesCatalog::getAll();
 
124
$availableWebsites = $selectedWebsites = array();
 
125
foreach ($websites as $id => $website) {
 
126
        if (!isset($websitesDenied[$id])) {
 
127
                $selectedWebsites[] = array($id, $website->getLabel());
 
128
        } else {
 
129
                $availableWebsites[] = array($id, $website->getLabel());
 
130
        }
 
131
}
 
132
$availableWebsites = sensitiveIO::jsonEncode($availableWebsites);
 
133
$selectedWebsites = sensitiveIO::jsonEncode($selectedWebsites);
 
134
 
 
135
//DEFINITION TAB
 
136
$content = '
 
137
<textarea id="tpl-definition-'.$templateId.'" style="display:none;">'./*str_replace("\t", '    ', */(htmlspecialchars($templateDefinition)).'</textarea>';
 
138
$view->setContent($content);
 
139
 
 
140
$title = (sensitiveIO::isPositiveInteger($templateId)) ? 'Mod�le de page : '.$label : 'Cr�ation d\\\'un mod�le de page';
 
141
 
 
142
$rowsURL = PATH_ADMIN_WR.'/templates-rows.php';
 
143
 
 
144
$printTab = '';
 
145
if (USE_PRINT_PAGES) {
 
146
        $cstags = $template->getClientSpacesTags();
 
147
        if (!is_array($cstags)) {
 
148
                $cstags = array();
 
149
        }
 
150
        $clientspaces = array();
 
151
        $printableCS = array();
 
152
        $print_clientspaces = $template->getPrintingClientSpaces();
 
153
        foreach ($cstags as $tag) {
 
154
                $id = $tag->getAttribute("id");
 
155
                //$module = $tag->getAttribute("module");
 
156
                if (!in_array($id, $print_clientspaces)) {
 
157
                        $clientspaces[] = array($id);
 
158
                } else {
 
159
                        $printableCS[] =  array($id);
 
160
                }
 
161
        }
 
162
        $clientspaces = sensitiveIO::jsonEncode($clientspaces);
 
163
        $printableCS = sensitiveIO::jsonEncode($printableCS);
 
164
        
 
165
        $printTab = ",{
 
166
                id:                             'printcs-{$templateId}',
 
167
                title:                  'Impression',
 
168
                layout:                 'form',
 
169
                xtype:                  'atmForm',
 
170
                url:                    'templates-controler.php',
 
171
                bodyStyle:              'padding:5px',
 
172
                labelAlign:             'right',
 
173
                border:                 false,
 
174
                items:[{
 
175
                        xtype:                  'panel',
 
176
                        border:                 false,
 
177
                        html:                   'S�lectionnez les zones de contenu du mod�le que vous souhaitez voir apparaitre dans la page d\'impression. Choisissez aussi l\'ordre d\'affichage de ces zones de contenu.',
 
178
                        bodyStyle:              'padding:10px 0 10px 0'
 
179
                },{
 
180
                        xtype:                  'itemselector',
 
181
                        name:                   'printableCS',
 
182
                        fieldLabel:             'Zones de contenu imprimables',
 
183
                        dataFields:             ['code'],
 
184
                        toData:                 {$printableCS},
 
185
                        msWidth:                250,
 
186
                        msHeight:               130,
 
187
                        height:                 140,
 
188
                        valueField:             'code',
 
189
                        displayField:   'code',
 
190
                        toLegend:               'S�l�ctionn�s',
 
191
                        fromLegend:             'Disponibles',
 
192
                        fromData:               {$clientspaces}
 
193
                }],
 
194
                buttons:[{
 
195
                        text:                   '{$cms_language->getJSMessage(MESSAGE_PAGE_SAVE)}',
 
196
                        xtype:                  'button',
 
197
                        name:                   'submitAdmin',
 
198
                        handler:                function() {
 
199
                                var form = Ext.getCmp('printcs-{$templateId}').getForm();
 
200
                                form.submit({
 
201
                                        params:{
 
202
                                                action:         'printcs',
 
203
                                                templateId:     templateWindow.templateId
 
204
                                        },
 
205
                                        scope:this
 
206
                                });
 
207
                        }
 
208
                }]
 
209
        }";
 
210
}
 
211
 
 
212
$jscontent = <<<END
 
213
        var templateWindow = Ext.getCmp('{$winId}');
 
214
        templateWindow.templateId = '{$templateId}';
 
215
        //set window title
 
216
        templateWindow.setTitle('{$title}');
 
217
        //set help button on top of page
 
218
        templateWindow.tools['help'].show();
 
219
        //add a tooltip on button
 
220
        var propertiesTip = new Ext.ToolTip({
 
221
                target:          templateWindow.tools['help'],
 
222
                title:                   '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
 
223
                html:                    'Cette page vous permet de cr�er et modifier un mod�le de page. Les mod�les de page servent de base � la cr�ation des pages du site.',
 
224
                dismissDelay:   0
 
225
        });
 
226
        //editor var
 
227
        var editor;
 
228
        //create center panel
 
229
        var center = new Ext.TabPanel({
 
230
                activeTab:                       0,
 
231
                id:                                     'templatePanels-{$templateId}',
 
232
                region:                         'center',
 
233
                border:                         false,
 
234
                enableTabScroll:        true,
 
235
                listeners: {
 
236
                        'beforetabchange' : function(tabPanel, newTab, currentTab ) {
 
237
                                if (newTab.beforeActivate) {
 
238
                                        newTab.beforeActivate(tabPanel, newTab, currentTab);
 
239
                                }
 
240
                                return true;
 
241
                        },
 
242
                        'tabchange': function(tabPanel, newTab) {
 
243
                                if (newTab.afterActivate) {
 
244
                                        newTab.afterActivate(tabPanel, newTab);
 
245
                                }
 
246
                        }
 
247
                },
 
248
                items:[{
 
249
                        id:                                     'templateDatas-{$templateId}',
 
250
                        title:                          'Propri�t�s',
 
251
                        autoScroll:                     true,
 
252
                        url:                            'templates-controler.php',
 
253
                        layout:                         'form',
 
254
                        xtype:                          'atmForm',
 
255
                        labelWidth:                     120,
 
256
                        border:                         false,
 
257
                        labelAlign:                     'right',
 
258
                        defaultType:            'textfield',
 
259
                        bodyStyle:                      'padding:5px',
 
260
                        defaults: {
 
261
                                xtype:                          'textfield',
 
262
                                anchor:                         '97%',
 
263
                                allowBlank:                     true
 
264
                        },
 
265
                        items:[{
 
266
                                fieldLabel:             '* Libell�',
 
267
                                name:                   'label',
 
268
                                value:                  '{$label}',
 
269
                                allowBlank:             false
 
270
                        },{
 
271
                                fieldLabel:             'Description',
 
272
                                xtype:                  'textarea',
 
273
                                name:                   'description',
 
274
                                value:                  '{$description}'
 
275
                        },{$groupsfield}{
 
276
                                fieldLabel:             '<span class="atm-help" ext:qtip="Vous pouvez ajouter un ou plusieurs nouveaux groupes au mod�le de page en cours. Le nom du groupe ne doit contenir que des caract�res alphanum�riques. Les groupes doivent �tre s�par�s par des virgules ou des point-virgules.">Nouveaux groupes</span>',
 
277
                                name:                   'newgroup',
 
278
                                value:                  ''
 
279
                        },{
 
280
                                fieldLabel:             '',
 
281
                                labelSeparator: '',
 
282
                                xtype:                  'checkbox',
 
283
                                boxLabel:               '<span class="atm-help" ext:qtip="En cochant cette case, aucun utilisateur ne pourra voir ou utiliser ce mod�le tant qu\'ils n\'auront pas les droits sur les nouveaux groupes ajout�s ci-dessus.">Ne pas donner les droits de voir ces nouveaux groupes aux utilisateurs.</span>',
 
284
                                name:                   'nouserrights',
 
285
                                inputValue:             '1'
 
286
                        },{
 
287
                                xtype:                  "itemselector",
 
288
                                name:                   "websites",
 
289
                                fieldLabel:             '<span class="atm-help" ext:qtip="S�lectionnez les sites pour lesquels l\'utilisation de ce mod�le de page sera possible.">Sites</span>',
 
290
                                dataFields:             ["code", "desc"],
 
291
                                toData:                 {$selectedWebsites},
 
292
                                msWidth:                250,
 
293
                                msHeight:               130,
 
294
                                height:                 140,
 
295
                                valueField:             "code",
 
296
                                displayField:   "desc",
 
297
                                toLegend:               "Autoris�s",
 
298
                                fromLegend:             "Disponibles",
 
299
                                fromData:               {$availableWebsites}
 
300
                        },{
 
301
                                xtype:                  'atmImageUploadField',
 
302
                                emptyText:              '{$cms_language->getJsMessage(MESSAGE_SELECT_PICTURE)}',
 
303
                                fieldLabel:     '<span class="atm-help" ext:qtip="Utilisez une vignette repr�sentant le visuel du mod�le de page pour permettre une selection plus ais�e.">Vignette</span>',
 
304
                                name:                   'image',
 
305
                                uploadCfg:      {
 
306
                                        file_size_limit:                '{$maxFileSize}',
 
307
                                        file_types:                             '*.jpg;*.png;*.gif',
 
308
                                        file_types_description: '{$cms_language->getJsMessage(MESSAGE_IMAGE)} ...'
 
309
                                },
 
310
                                fileinfos:      {$imageDatas}
 
311
                        },{
 
312
                                xtype:                  'atmFileUploadField',
 
313
                                id:                     'form-file',
 
314
                                emptyText:              '{$cms_language->getJSMessage(MESSAGE_SELECT_FILE)}',
 
315
                                fieldLabel:     '<span class="atm-help" ext:qtip="Vous pouvez utiliser un fichier XML pour importer la d�finition XML � employer pour ce mod�le de page.">D�finition XML</span>',
 
316
                                name:                   'definitionfile',
 
317
                                uploadCfg:      {
 
318
                                        file_size_limit:                '{$maxFileSize}',
 
319
                                        file_types:                             '*.xml',
 
320
                                        file_types_description: 'Fichier XML ...'
 
321
                                },
 
322
                                fileinfos:      {$fileDatas}
 
323
                        }],
 
324
                        buttons:[{
 
325
                                text:                   '{$cms_language->getJSMessage(MESSAGE_PAGE_SAVE)}',
 
326
                                anchor:                 '',
 
327
                                scope:                  this,
 
328
                                handler:                function() {
 
329
                                        var form = Ext.getCmp('templateDatas-{$templateId}').getForm();
 
330
                                        form.submit({
 
331
                                                params:{
 
332
                                                        action:         'properties',
 
333
                                                        templateId:     templateWindow.templateId
 
334
                                                },
 
335
                                                success:function(form, action){
 
336
                                                        //if it is a successful user creation
 
337
                                                        if (action.result.success != false && isNaN(parseInt(templateWindow.templateId))) {
 
338
                                                                //set userId
 
339
                                                                templateWindow.templateId = action.result.success.templateId;
 
340
                                                                //display hidden elements
 
341
                                                                Ext.getCmp('templateDef-{$templateId}').enable();
 
342
                                                                Ext.getCmp('templateRows-{$templateId}').enable();
 
343
                                                                if (Ext.getCmp('print-{$templateId}')) {
 
344
                                                                        Ext.getCmp('print-{$templateId}').enable();
 
345
                                                                }
 
346
                                                        }
 
347
                                                },
 
348
                                                scope:this
 
349
                                        });
 
350
                                }
 
351
                        }]
 
352
                },{
 
353
                        id:                                     'templateDef-{$templateId}',
 
354
                        title:                          'D�finition XML',
 
355
                        autoScroll:                     true,
 
356
                        url:                            'templates-controler.php',
 
357
                        layout:                         'form',
 
358
                        xtype:                          'atmForm',
 
359
                        border:                         false,
 
360
                        bodyStyle:                      'padding:5px',
 
361
                        beforeActivate:         function(tabPanel, newTab, currentTab) {
 
362
                                if (Ext.get('defText-{$templateId}')) {
 
363
                                        //call server for definition update
 
364
                                        Automne.server.call({
 
365
                                                url:                    'page-templates-datas.php',
 
366
                                                scope:                  this,
 
367
                                                fcnCallback:    function(response, options, jsonResponse){
 
368
                                                        //update store
 
369
                                                        for(var i = 0; i < jsonResponse.total; i++) {
 
370
                                                                var data = jsonResponse.results[i];
 
371
                                                                Ext.get('defText-{$templateId}').dom.value = data.definition;
 
372
                                                        }
 
373
                                                },
 
374
                                                params:                 {
 
375
                                                        items:                  [{$templateId}],
 
376
                                                        definition:             1
 
377
                                                }
 
378
                                        });
 
379
                                }
 
380
                        },
 
381
                        defaults: {
 
382
                                anchor:                         '97%',
 
383
                                allowBlank:                     false,
 
384
                                hideLabel:                      true
 
385
                        },
 
386
                        items:[{
 
387
                                xtype:                  'panel',
 
388
                                html:                   'Vous pouvez modifier ici la structure XML de ce mod�le. Vous devez respecter la norme XML sous peine d\'erreur.<br /><strong>Attention</strong>, ne supprimez ni ne modifiez pas de tag &lt;atm-clientspace&gt; sous peine de perdre du contenu sur les pages employant d�j� le mod�le en cours.',
 
389
                                border:                 false,
 
390
                                bodyStyle:              'padding-bottom:10px'
 
391
                        }, {
 
392
                                xtype:                  'checkbox',
 
393
                                boxLabel:               'Activer la coloration syntaxique',
 
394
                                listeners:              {'check':function(field, checked) {
 
395
                                        if (checked) {
 
396
                                                editor = CodeMirror.fromTextArea('defText-{$templateId}', {
 
397
                                                        parserfile:     ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
 
398
                                                        stylesheet:     ["/automne/codemirror/css/xmlcolors.css", "/automne/codemirror/css/jscolors.css", "/automne/codemirror/css/csscolors.css"],
 
399
                                                        path:                   "/automne/codemirror/js/",
 
400
                                                        textWrapping:   false,
 
401
                                                        dumbTabs:               true,
 
402
                                                        content:                Ext.getCmp('defText-{$templateId}').getValue().replace(/\t/g, '    ')
 
403
                                                });
 
404
                                                field.disable();
 
405
                                        }
 
406
                                }, scope:this}
 
407
                        }, {
 
408
                                id:                             'defText-{$templateId}',
 
409
                                xtype:                  'textarea',
 
410
                                name:                   'definition',
 
411
                                cls:                    'atm-code',
 
412
                                anchor:                 '0, -70',
 
413
                                enableKeyEvents:true,
 
414
                                value:                  Ext.get('tpl-definition-{$templateId}').dom.value,
 
415
                                listeners:{'keypress': function(field, e){
 
416
                                        var k = e.getKey();
 
417
                                        //manage TAB press
 
418
                                        if(k == e.TAB) {
 
419
                                                e.stopEvent();
 
420
                                                var myValue = '    ';//'\t';
 
421
                                                var myField = field.el.dom;
 
422
                                                if (document.selection) {//IE support
 
423
                                                        myField.focus();
 
424
                                                        sel = document.selection.createRange();
 
425
                                                        sel.text = myValue;
 
426
                                                        myField.focus();
 
427
                                                } else if (myField.selectionStart || myField.selectionStart == '0') {
 
428
                                                        var startPos = myField.selectionStart;
 
429
                                                        var endPos = myField.selectionEnd;
 
430
                                                        var scrollTop = myField.scrollTop;
 
431
                                                        myField.value = myField.value.substring(0, startPos)
 
432
                                                                      + myValue 
 
433
                                                              + myField.value.substring(endPos, myField.value.length);
 
434
                                                        myField.focus();
 
435
                                                        myField.selectionStart = startPos + myValue.length;
 
436
                                                        myField.selectionEnd = startPos + myValue.length;
 
437
                                                        myField.scrollTop = scrollTop;
 
438
                                                }
 
439
                                        }
 
440
                                }, 'resize': function(field, width, height){
 
441
                                        if (editor) { //resize editor according to textarea size
 
442
                                                if (width) editor.frame.style.width = (width - 8) + 'px';
 
443
                                                if (height) editor.frame.style.height = (height - 6) + 'px';
 
444
                                        }
 
445
                                },
 
446
                                scope:this}
 
447
                        }],
 
448
                        buttons:[{
 
449
                                text:                   'Aide',
 
450
                                anchor:                 '',
 
451
                                scope:                  this,
 
452
                                handler:                function(button) {
 
453
                                        var windowId = 'templateHelpWindow';
 
454
                                        if (Ext.WindowMgr.get(windowId)) {
 
455
                                                Ext.WindowMgr.bringToFront(windowId);
 
456
                                        } else {
 
457
                                                //create window element
 
458
                                                var win = new Automne.Window({
 
459
                                                        id:                             windowId,
 
460
                                                        modal:                  false,
 
461
                                                        father:                 templateWindow.father,
 
462
                                                        autoLoad:               {
 
463
                                                                url:                    'template-help.php',
 
464
                                                                params:                 {
 
465
                                                                        winId:                  windowId
 
466
                                                                },
 
467
                                                                nocache:                true,
 
468
                                                                scope:                  this
 
469
                                                        }
 
470
                                                });
 
471
                                                
 
472
                                                //display window
 
473
                                                win.show(button.getEl());
 
474
                                        }
 
475
                                }
 
476
                        },{
 
477
                                text:                   '{$cms_language->getJSMessage(MESSAGE_PAGE_SAVE)}',
 
478
                                anchor:                 '',
 
479
                                scope:                  this,
 
480
                                handler:                function() {
 
481
                                        var form = Ext.getCmp('templateDef-{$templateId}').getForm();
 
482
                                        if (editor) {
 
483
                                                form.setValues({'defText-{$templateId}': editor.getCode()});
 
484
                                        }
 
485
                                        form.submit({
 
486
                                                params:{
 
487
                                                        action:         'definition',
 
488
                                                        templateId:     templateWindow.templateId
 
489
                                                },
 
490
                                                scope:this
 
491
                                        });
 
492
                                }
 
493
                        }]
 
494
                },{
 
495
                        xtype:                  'framePanel',
 
496
                        title:                  'Rang�es par d�faut',
 
497
                        id:                             'templateRows-{$templateId}',
 
498
                        editable:               true,
 
499
                        frameURL:               '{$rowsURL}?template={$templateId}',
 
500
                        allowFrameNav:  false
 
501
                }{$printTab}]
 
502
        });
 
503
        
 
504
        templateWindow.add(center);
 
505
        //redo windows layout
 
506
        templateWindow.doLayout();
 
507
        
 
508
        //disable all elements not usable in first user creation step
 
509
        if (isNaN(parseInt(templateWindow.templateId))) {
 
510
                //hide elements
 
511
                Ext.getCmp('templateDef-{$templateId}').disable();
 
512
                Ext.getCmp('templateRows-{$templateId}').disable();
 
513
                if (Ext.getCmp('print-{$templateId}')) {
 
514
                        Ext.getCmp('print-{$templateId}').disable();
 
515
                }
 
516
        }
 
517
        //center.syncSize();
 
518
END;
 
519
$view->addJavascript($jscontent);
 
520
$view->show();
 
521
?>
 
 
b'\\ No newline at end of file'