~dantrevino/ubuntu-us-florida-website/main

« back to all changes in this revision

Viewing changes to administrator/components/com_jce/groups/views/group/tmpl/form.php

  • Committer: Dan Trevnio
  • Date: 2009-03-24 20:37:18 UTC
  • Revision ID: dantrevino@gmail.com-20090324203718-pg0e3lp4ztjjku9o
initialĀ siteĀ import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php defined('_JEXEC') or die('Restricted access'); ?>
 
2
 
 
3
<?php 
 
4
        JHTML::_('behavior.tooltip');
 
5
        JHTML::_('behavior.modal');
 
6
        
 
7
        JHTML::script('scripts.js', 'administrator/components/com_jce/js/');
 
8
        JHTML::script('sortables.js', 'administrator/components/com_jce/js/');
 
9
        
 
10
        JHTML::stylesheet('styles.css', 'administrator/components/com_jce/css/');
 
11
        JHTML::stylesheet('icons.css', 'administrator/components/com_jce/css/');
 
12
        JHTML::stylesheet('layout.css', 'administrator/components/com_jce/css/');
 
13
        
 
14
        JToolBarHelper::title( JText::_( 'JCE Group' ) .': <small><small>[' .JText::_('Edit'). ']</small></small>', 'user.png' );
 
15
        JToolBarHelper::save();
 
16
        JToolBarHelper::apply();
 
17
        JToolBarHelper::cancel( 'cancelEdit', 'Close' );
 
18
        jceToolbarHelper::help( 'groups' );
 
19
?>
 
20
 
 
21
<?php
 
22
        // clean item data
 
23
        JFilterOutput::objectHTMLSafe( $this->group, ENT_QUOTES, '' );
 
24
?>
 
25
<script type="text/javascript">
 
26
        window.addEvent('domready', function(){
 
27
                new Sortables('.sortableList', {revert: true, onComplete : function(el){
 
28
                        var state = el.getParent().id == 'groupLayout';
 
29
                        el.getChildren().each(function(c){
 
30
                                setParams(c.id, state); 
 
31
                        });                     
 
32
                }});
 
33
                new Sortables('.sortableRow', {revert: true, onComplete : function(el){
 
34
                        var state = el.getParent().getParent().id == 'groupLayout';
 
35
                        setParams(el.id, state);                        
 
36
                }});
 
37
                $ES('div[id^=plugin_params_]', $('plugin_params')).each(function(p){                    
 
38
                        if(p.style.display == 'none'){
 
39
                                setParams(p.id, false);
 
40
                        }
 
41
                });             
 
42
        });
 
43
        function setParams(id, state){
 
44
                id = id.replace(/[^0-9]/gi, ''); 
 
45
                var params = $('plugin_params_' + id) || false;         
 
46
                if(params){
 
47
                        var disabled = state ? '' : 'disabled';
 
48
                        
 
49
                        params.style.display = state ? 'block' : 'none';                                
 
50
                        $ES('input', params).each(function(input){
 
51
                                input.disabled = disabled;
 
52
                        });
 
53
                        $ES('select', params).each(function(input){
 
54
                                input.disabled = disabled;
 
55
                        });
 
56
                        $ES('textarea', params).each(function(input){
 
57
                                input.disabled = disabled;
 
58
                        });
 
59
                }
 
60
        }
 
61
        function submitbutton(pressbutton) {
 
62
                var form = document.adminForm, items = [];
 
63
                // Serialize group layout
 
64
                $('groupLayout').getChildren().each(function(el){
 
65
                        items.include(el.getChildren().map(function(o, i){
 
66
                                return o.id.replace(/[^0-9]/gi, '');
 
67
                        }).join(','));  
 
68
                });
 
69
                form.rows.value = items.join(';') || '';
 
70
                // Select added users
 
71
                for (var i=0; i<form.users.options.length; i++) {
 
72
                        form.users.options[i].selected = true;
 
73
                }       
 
74
                // Cancel button
 
75
                if (pressbutton == "cancelEdit") {
 
76
                        submitform(pressbutton);
 
77
                        return;
 
78
                }
 
79
                // validation
 
80
                if (form.name.value == "") {
 
81
                        alert( "<?php echo JText::_( 'Group must have a name', true ); ?>" );
 
82
                } else {
 
83
                        submitform(pressbutton);
 
84
                }
 
85
        }
 
86
</script>
 
87
<form action="index.php" method="post" name="adminForm">
 
88
<div class="col width-60">
 
89
        <fieldset class="adminform">
 
90
        <legend><?php echo JText::_( 'Details' ); ?></legend>
 
91
        <table class="admintable">
 
92
                <tr>
 
93
                        <td width="100" class="key">
 
94
                                <label for="name">
 
95
                                        <?php echo JText::_( 'Name' ); ?>:
 
96
                                </label>
 
97
                        </td>
 
98
                        <td>
 
99
                <?php if( $this->group->name == 'Default' ){
 
100
                                        echo $this->group->name;
 
101
                                }else{?>
 
102
                                        <input class="text_area" type="text" name="name" id="name" size="35" value="<?php echo $this->group->name; ?>" />
 
103
                                <?php }?>
 
104
            </td>
 
105
                </tr>
 
106
        <tr>
 
107
                        <td width="100" class="key">
 
108
                                <label for="name">
 
109
                                        <?php echo JText::_( 'Description' ); ?>:
 
110
                                </label>
 
111
                        </td>
 
112
                        <td>
 
113
                                <input class="text_area" type="text" name="description" id="description" size="80" value="<?php echo $this->group->description; ?>" />
 
114
                        </td>
 
115
                </tr>
 
116
                <tr>
 
117
                        <td valign="top" class="key">
 
118
                                <?php echo JText::_( 'Published' ); ?>:
 
119
                        </td>
 
120
                        <td>
 
121
                                <?php if( $this->group->name == 'Default' ){
 
122
                                        echo JText::_('Enabled');
 
123
                                }else{
 
124
                                        echo $this->lists['published'];
 
125
                                }?>
 
126
                        </td>
 
127
                </tr>
 
128
        <tr>
 
129
                        <td valign="top" class="key">
 
130
                                <?php echo JText::_( 'Priority' ); ?>:
 
131
                        </td>
 
132
                        <td>
 
133
                                <?php echo $this->lists['ordering']; ?>
 
134
                        </td>
 
135
                </tr>
 
136
        <tr>
 
137
                        <td valign="top" class="key">
 
138
                                <?php echo JText::_( 'Components' ); ?>:
 
139
                        </td>
 
140
                        <td>
 
141
                                <?php echo $this->lists['components']; ?>
 
142
                <p><a onclick="javascript: jce.selectAll(document, 'components');" href="#"><span class="icon-add"><span class="icon-text"><?php echo JText::_('Add All');?></span></span></a>
 
143
                <a onclick="javascript: jce.selectNone(document, 'components');" href="#"><span class="icon-remove"><span class="icon-text"><?php echo JText::_('Remove All');?></span></span></a></p>
 
144
                        </td>
 
145
        </tr>
 
146
        <tr>
 
147
                        <td valign="top" class="key">
 
148
                                <?php echo JText::_( 'Types' ); ?>:
 
149
                        </td>
 
150
                        <td>
 
151
                                <?php echo $this->lists['types']; ?>
 
152
                <p><a onclick="javascript: jce.selectAll(document, 'types');" href="#"><span class="icon-add"><span class="icon-text"><?php echo JText::_('Add All');?></span></span></a>
 
153
                <a onclick="javascript: jce.selectNone(document, 'types');" href="#"><span class="icon-remove"><span class="icon-text"><?php echo JText::_('Remove All');?></span></span></a></p>
 
154
                        </td>
 
155
        </tr>
 
156
        <tr>
 
157
                        <td valign="top" class="key">
 
158
                                <?php echo JText::_( 'Users' ); ?>:
 
159
                        </td>
 
160
                        <td>
 
161
                                <?php echo $this->lists['users']; ?>
 
162
                <p><a class="modal" rel="{handler: 'iframe', size: {x: 750, y: 600}}" href="index.php?option=com_jce&tmpl=component&type=group&task=addusers"><span class="icon-add"><span class="icon-text"><?php echo JText::_('Add User');?></span></span></a>
 
163
                <a onclick="javascript: jce.removeSelect(document, 'users');" href="#"><span class="icon-remove"><span class="icon-text"><?php echo JText::_('Remove User');?></span></span></a></p>
 
164
                        </td>
 
165
        </tr>
 
166
    </table>
 
167
        </fieldset>
 
168
    <fieldset class="adminform">
 
169
    <legend><?php echo JText::_( 'GROUPS LAYOUT' ); ?></legend>
 
170
        <table class="admintable">
 
171
            <tr><td><?php echo JText::_( 'GROUPS LAYOUT DESC' ); ?></td></tr>
 
172
            <tr><td><a class="modal" rel="{handler: 'iframe', size: {x: 750, y: 600}}" href="index.php?option=com_jce&tmpl=component&type=group&task=legend"><span class="icon-legend"><span class="icon-text"><?php echo JText::_('Icon Legend');?></span></span></a></td></tr>
 
173
            <tr>
 
174
                <td>
 
175
                <fieldset>
 
176
                <legend><?php echo JText::_( 'GROUP DEFAULT LAYOUT' ); ?></legend>
 
177
                <div class="sortableList">
 
178
                <?php 
 
179
                $rows   = JCEGroupsHelper::getRowArray( $this->group->rows );
 
180
                                $width  = $this->layout['width'] + 50;
 
181
                                for( $i=1; $i<=$this->layout['rows']; $i++ ){
 
182
                                ?>
 
183
                    <ul class="sortableRow" style="width:<?php echo $width;?>px">
 
184
                <?php
 
185
                                        foreach( $this->plugins as $icon ){
 
186
                                                if( !in_array( $icon->id, explode( ',', implode( ',', $rows ) ) ) ){
 
187
                                                        if( $icon->layout && $icon->row == $i ){
 
188
                                                                $n = "row_li_" .$icon->id;
 
189
                                                                $path = $icon->type == 'command' ? '../plugins/editors/jce/tiny_mce/themes/advanced/img/'. $icon->layout .'.gif' : '../plugins/editors/jce/tiny_mce/plugins/'. $icon->name .'/img/'. $icon->layout .'.gif';
 
190
                                                                ?>
 
191
                                                                <li class="sortableItem" id="<?php echo $n;?>"><img src="<?php echo $path;?>" alt="<?php echo $icon->title;?>" title="<?php echo $icon->title;?>" /></li>
 
192
                                                        <?php }
 
193
                                                }
 
194
                                        }
 
195
                                        ?>
 
196
                    </ul>
 
197
                                <?php }?>
 
198
                </div>
 
199
                </fieldset>
 
200
                <fieldset>
 
201
                <legend><?php echo JText::_( 'EDITOR LAYOUT' ); ?></legend>
 
202
                <div class="sortableList" id="groupLayout">
 
203
               <?php $width = $this->layout['width'] + 50;
 
204
                                for( $i=1; $i<=count( $rows )+1; $i++ ){?>
 
205
                    <ul class="sortableRow" style="width:<?php echo $width;?>px">
 
206
                <?php
 
207
                                        for( $x=1; $x<=count( $rows ); $x++ ){
 
208
                                                if( $i == $x ){
 
209
                                                        $icons = explode( ',', $rows[$x] );
 
210
                                                        foreach( $icons as $icon ){     
 
211
                                                                foreach( $this->plugins as $button ){
 
212
                                                                        if( $button->layout && $button->id == $icon ){
 
213
                                                                                $n = "group_li_". $button->id;
 
214
                                                                                $path = $button->type == 'command' ? '../plugins/editors/jce/tiny_mce/themes/advanced/img/'. $button->layout .'.gif' : '../plugins/editors/jce/tiny_mce/plugins/'. $button->name .'/img/'. $button->layout .'.gif';
 
215
                                                                                ?>
 
216
                                                                                <li class="sortableItem" id="<?php echo $n;?>"><img src="<?php echo $path;?>" alt="<?php echo $button->title;?>" title="<?php echo $button->title;?>" /></li>
 
217
                                                                        <?php }
 
218
                                                                }
 
219
                                                        }
 
220
                                                }
 
221
                                        }
 
222
                                        ?>
 
223
                    </ul>
 
224
                                <?php }?>
 
225
                </div>
 
226
                </fieldset>
 
227
                </td>
 
228
            </tr>
 
229
        </table>
 
230
    </fieldset> 
 
231
    <fieldset class="adminform">
 
232
        <legend><?php echo JText::_( 'GROUPS OTHER PLUGINS' ); ?></legend>
 
233
        <table class="admintable">
 
234
            <tr><td colspan="2"><?php echo JText::_('GROUPS OTHER PLUGINS DESC');?></td></tr>
 
235
            <tr>
 
236
                <?php 
 
237
                                $i = 0;
 
238
                                foreach( $this->plugins as $plugin ){
 
239
                                         if( $plugin->layout == '' ){
 
240
                                                if( $plugin->editable ){?>
 
241
                                                        <tr>
 
242
                                        <td><input type="checkbox" id="cb<?php echo $i;?>" name="pid[]" value="<?php echo $plugin->id;?>" onclick="isChecked(this.checked);setParams(this.value, this.checked);" <?php echo in_array( $plugin->id, explode( ',', $this->group->plugins ) ) ? 'checked="checked"' : '';?>/></td>
 
243
                                        <td><?php echo $plugin->title;?></td>
 
244
                                </tr>
 
245
                                 <?php }else{?>
 
246
                                                        <tr>
 
247
                                        <td><input type="checkbox" id="cb<?php echo $i;?>" name="pid[]" value="<?php echo $plugin->id;?>" onclick="isChecked(this.checked);" <?php echo in_array( $plugin->id, explode( ',', $this->group->plugins ) ) ? 'checked="checked"' : '';?>/></td>
 
248
                                        <td><?php echo $plugin->title;?></td>
 
249
                                </tr>
 
250
                                <?php  }
 
251
                                        }
 
252
                                        $i++;
 
253
                                }?>
 
254
            </tr>
 
255
        </table>
 
256
    </fieldset>
 
257
</div>
 
258
<div class="col width-40">
 
259
    <div id="editor_params">
 
260
        <fieldset class="adminform">
 
261
        <legend><?php echo JText::_( 'Editor Parameters' ); ?></legend>
 
262
        <?php
 
263
            jimport('joomla.html.pane');
 
264
            $pane =& JPane::getInstance('sliders');
 
265
            echo $pane->startPane("group-pane-editor");
 
266
            
 
267
            echo $pane->startPanel(JText :: _('Editor Setup'), "param-page");
 
268
            if($output = $this->params->render('params', 'groups-editor')) :
 
269
                echo $output;
 
270
            else :
 
271
                echo "<div style=\"text-align: center; padding: 5px; \">".JText::_('There are no parameters for this item')."</div>";
 
272
            endif;
 
273
            echo $pane->endPanel();
 
274
                        echo $pane->startPanel(JText :: _('Editor Options'), "param-page");
 
275
            if($output = $this->params->render('params', 'groups-options')) :
 
276
                echo $output;
 
277
            else :
 
278
                echo "<div style=\"text-align: center; padding: 5px; \">".JText::_('There are no parameters for this item')."</div>";
 
279
            endif;
 
280
            echo $pane->endPanel();
 
281
                        echo $pane->startPanel(JText :: _('Plugin Options'), "param-page");
 
282
            if($output = $this->params->render('params', 'groups-plugins')) :
 
283
                echo $output;
 
284
            else :
 
285
                echo "<div style=\"text-align: center; padding: 5px; \">".JText::_('There are no parameters for this item')."</div>";
 
286
            endif;
 
287
            echo $pane->endPanel();
 
288
            echo $pane->endPane();
 
289
        ?>
 
290
        </fieldset>
 
291
    </div>
 
292
    <div id="plugin_params">
 
293
        <fieldset class="adminform">
 
294
        <legend><?php echo JText::_( 'Plugin Parameters' ); ?></legend>
 
295
        <?php   
 
296
            foreach( $this->plugins as $plugin ){
 
297
                if( $plugin->editable ){                        
 
298
                    jimport('joomla.filesystem.folder');
 
299
                                        jimport('joomla.filesystem.file');
 
300
                                        
 
301
                                        $path           = JPATH_PLUGINS .DS. 'editors' .DS. 'jce' .DS. 'tiny_mce' .DS. 'plugins' .DS. $plugin->name;
 
302
                                        $xmlPath        = $path . DS . $plugin->name .'.xml';
 
303
                    $name               = trim( $plugin->name ); 
 
304
                    $params     = new JParameter( $this->group->params, $xmlPath );
 
305
                                        
 
306
                                        // Load Language for plugin
 
307
                    $lang =& JFactory::getLanguage();
 
308
                    $lang->load( 'com_jce_' . trim( $name ), JPATH_SITE );
 
309
                    
 
310
                    $display = in_array( $plugin->id, explode( ',', $this->group->plugins ) ) ? 'block' : 'none';
 
311
                    
 
312
                    if( $params->getNumParams('standard') || $params->getNumParams('defaults')|| $params->getNumParams('access') || $params->getNumParams('advanced') ) {
 
313
                ?>
 
314
                        <div id="plugin_params_<?php echo $plugin->id;?>" style="display:<?php echo $display;?>">
 
315
                        <fieldset class="adminform">
 
316
                        <legend><?php echo JText::_( $plugin->title ); ?></legend>
 
317
                <?php
 
318
                        $pane =& JPane::getInstance('sliders');
 
319
                        echo $pane->startPane("group-pane-".$name);
 
320
                        if($params->getNumParams('standard')) {
 
321
                            if($output = $params->render('params', 'standard')){
 
322
                                echo $pane->startPanel(JText :: _('STANDARD'), $name."-standard-page");
 
323
                                echo $output;
 
324
                                echo $pane->endPanel();
 
325
                            }
 
326
                        }
 
327
                        if($params->getNumParams('defaults')) {
 
328
                            if($output = $params->render('params', 'defaults')){
 
329
                                echo $pane->startPanel(JText :: _('DEFAULTS'), $name."-defaults-page");
 
330
                                echo $output;
 
331
                                echo $pane->endPanel();
 
332
                            }
 
333
                        }
 
334
                        if($params->getNumParams('access')) {
 
335
                            if($output = $params->render('params', 'access')){
 
336
                                echo $pane->startPanel(JText :: _('PERMISSIONS'), $name."-access-page");
 
337
                                echo $output;
 
338
                                echo $pane->endPanel();
 
339
                            }
 
340
                        }
 
341
                        if($params->getNumParams('advanced')) {
 
342
                            if($output = $params->render('params', 'advanced')){
 
343
                                echo $pane->startPanel(JText :: _('ADVANCED'), $name."-advanced-page");
 
344
                                echo $output;
 
345
                                echo $pane->endPanel();
 
346
                            }
 
347
                        }
 
348
                                                if( JFolder::exists( $path .DS. 'extensions' ) ){
 
349
                                                        $db     =& JFactory::getDBO();
 
350
                                                        $query = 'SELECT *'
 
351
                                                        . ' FROM #__jce_extensions'
 
352
                                                        . ' WHERE published = 1'
 
353
                                                        . ' AND pid = '.(int) $plugin->id;
 
354
                                                        ;
 
355
                                                        
 
356
                                                        $db->setQuery( $query );
 
357
                                                        $extensions = $db->loadObjectList();
 
358
                                                        
 
359
                                                        foreach( $extensions as $extension ){
 
360
                                                                // Load extension xml file
 
361
                                                                $file = $path .DS. 'extensions' .DS. $extension->folder .DS. $extension->extension . '.xml';
 
362
                                                                // Load extension language file
 
363
                                                                $lang =& JFactory::getLanguage();
 
364
                                        $lang->load( 'com_jce_' . trim( $name ) . '_' . trim( $extension->extension ), JPATH_SITE );
 
365
                                                                
 
366
                                                                if( JFile::exists( $file ) ){
 
367
                                                                        $params = new JParameter( $this->group->params, $file );
 
368
                                                                        if($params->getNumParams()) {
 
369
                                                                                if($output = $params->render('params')){
 
370
                                                                                        echo $pane->startPanel(JText :: _( $extension->name ), $extension->extension."-extension-page");
 
371
                                                                                        echo $output;
 
372
                                                                                        echo $pane->endPanel();
 
373
                                                                                }
 
374
                                                                        }
 
375
                                                                }
 
376
                                                        }
 
377
                                                }
 
378
                        echo $pane->endPane();
 
379
                ?>
 
380
                        </fieldset>
 
381
                        </div>
 
382
            <?php
 
383
                    }
 
384
                }
 
385
            }
 
386
        ?>
 
387
        </fieldset>
 
388
        </div>
 
389
</div>
 
390
<div class="clr"></div>
 
391
        <input type="hidden" name="option" value="com_jce" />
 
392
        <input type="hidden" name="id" value="<?php echo $this->group->id; ?>" />
 
393
        <input type="hidden" name="cid[]" value="<?php echo $this->group->id; ?>" />
 
394
    <input type="hidden" name="boxchecked" value="0" />
 
395
    <input type="hidden" name="rows" value="" />
 
396
    <input type="hidden" name="type" value="group" />
 
397
        <input type="hidden" name="task" value="" />
 
398
        <?php echo JHTML::_( 'form.token' ); ?>
 
399
</form>
 
 
b'\\ No newline at end of file'