Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 117... Línea 117...
117
 
117
 
118
        // Convert control array into an action_menu.
118
        // Convert control array into an action_menu.
119
        $menu = new action_menu();
119
        $menu = new action_menu();
120
        $menu->set_kebab_trigger(get_string('edit'));
120
        $menu->set_kebab_trigger(get_string('edit'));
-
 
121
        $menu->attributes['class'] .= ' section-actions';
121
        $menu->attributes['class'] .= ' section-actions';
122
        $menu->attributes['data-sectionid'] = $this->section->id;
122
        foreach ($controls as $value) {
123
        foreach ($controls as $value) {
123
            $url = empty($value['url']) ? '' : $value['url'];
124
            $url = empty($value['url']) ? '' : $value['url'];
124
            $icon = empty($value['icon']) ? '' : $value['icon'];
125
            $icon = empty($value['icon']) ? '' : $value['icon'];
125
            $name = empty($value['name']) ? '' : $value['name'];
126
            $name = empty($value['name']) ? '' : $value['name'];
Línea 191... Línea 192...
191
                'name' => $streditsection,
192
                'name' => $streditsection,
192
                'pixattr' => ['class' => ''],
193
                'pixattr' => ['class' => ''],
193
                'attr' => ['class' => 'icon edit'],
194
                'attr' => ['class' => 'icon edit'],
194
            ];
195
            ];
Línea -... Línea 196...
-
 
196
 
195
 
197
            if ($section->section) {
196
            $duplicatesectionurl = clone($baseurl);
198
                $duplicatesectionurl = clone($baseurl);
197
            $duplicatesectionurl->param('section', $section->section);
199
                $duplicatesectionurl->param('sectionid', $section->id);
198
            $duplicatesectionurl->param('duplicatesection', $section->section);
200
                $duplicatesectionurl->param('duplicatesection', 1);
199
            if (!is_null($sectionreturn)) {
201
                if (!is_null($sectionreturn)) {
-
 
202
                    $duplicatesectionurl->param('sr', $sectionreturn);
-
 
203
                }
-
 
204
                $controls['duplicate'] = [
-
 
205
                    'url' => $duplicatesectionurl,
-
 
206
                    'icon' => 't/copy',
-
 
207
                    'name' => get_string('duplicate'),
-
 
208
                    'pixattr' => ['class' => ''],
-
 
209
                    'attr' => ['class' => 'icon duplicate'],
200
                $duplicatesectionurl->param('sr', $sectionreturn);
210
                ];
201
            }
-
 
202
            $controls['duplicate'] = [
-
 
203
                'url' => $duplicatesectionurl,
-
 
204
                'icon' => 't/copy',
-
 
205
                'name' => get_string('duplicate'),
-
 
206
                'pixattr' => ['class' => ''],
-
 
207
                'attr' => ['class' => 'icon duplicate'],
-
 
208
            ];
211
            }
Línea 209... Línea 212...
209
        }
212
        }
210
 
213
 
211
        if ($section->section) {
214
        if ($section->section) {
Línea 217... Línea 220...
217
                if (has_capability('moodle/course:sectionvisibility', $coursecontext, $user)) {
220
                if (has_capability('moodle/course:sectionvisibility', $coursecontext, $user)) {
218
                    $strhidefromothers = get_string('hidefromothers', 'format_' . $course->format);
221
                    $strhidefromothers = get_string('hidefromothers', 'format_' . $course->format);
219
                    $strshowfromothers = get_string('showfromothers', 'format_' . $course->format);
222
                    $strshowfromothers = get_string('showfromothers', 'format_' . $course->format);
220
                    if ($section->visible) { // Show the hide/show eye.
223
                    if ($section->visible) { // Show the hide/show eye.
221
                        $url->param('hide', $section->section);
224
                        $url->param('hide', $section->section);
222
                        $controls['visiblity'] = [
225
                        $controls['visibility'] = [
223
                            'url' => $url,
226
                            'url' => $url,
224
                            'icon' => 'i/hide',
227
                            'icon' => 'i/show',
225
                            'name' => $strhidefromothers,
228
                            'name' => $strhidefromothers,
226
                            'pixattr' => ['class' => ''],
229
                            'pixattr' => ['class' => ''],
227
                            'attr' => [
230
                            'attr' => [
228
                                'class' => 'icon editing_showhide',
231
                                'class' => 'icon editing_showhide',
229
                                'data-sectionreturn' => $sectionreturn,
232
                                'data-sectionreturn' => $sectionreturn,
230
                                'data-action' => ($usecomponents) ? 'sectionHide' : 'hide',
233
                                'data-action' => ($usecomponents) ? 'sectionHide' : 'hide',
231
                                'data-id' => $section->id,
234
                                'data-id' => $section->id,
-
 
235
                                'data-icon' => 'i/show',
232
                                'data-swapname' => $strshowfromothers,
236
                                'data-swapname' => $strshowfromothers,
233
                                'data-swapicon' => 'i/show',
237
                                'data-swapicon' => 'i/hide',
234
                            ],
238
                            ],
235
                        ];
239
                        ];
236
                    } else {
240
                    } else {
237
                        $url->param('show',  $section->section);
241
                        $url->param('show',  $section->section);
238
                        $controls['visiblity'] = [
242
                        $controls['visibility'] = [
239
                            'url' => $url,
243
                            'url' => $url,
240
                            'icon' => 'i/show',
244
                            'icon' => 'i/hide',
241
                            'name' => $strshowfromothers,
245
                            'name' => $strshowfromothers,
242
                            'pixattr' => ['class' => ''],
246
                            'pixattr' => ['class' => ''],
243
                            'attr' => [
247
                            'attr' => [
244
                                'class' => 'icon editing_showhide',
248
                                'class' => 'icon editing_showhide',
245
                                'data-sectionreturn' => $sectionreturn,
249
                                'data-sectionreturn' => $sectionreturn,
246
                                'data-action' => ($usecomponents) ? 'sectionShow' : 'show',
250
                                'data-action' => ($usecomponents) ? 'sectionShow' : 'show',
247
                                'data-id' => $section->id,
251
                                'data-id' => $section->id,
-
 
252
                                'data-icon' => 'i/hide',
248
                                'data-swapname' => $strhidefromothers,
253
                                'data-swapname' => $strhidefromothers,
249
                                'data-swapicon' => 'i/hide',
254
                                'data-swapicon' => 'i/show',
250
                            ],
255
                            ],
251
                        ];
256
                        ];
252
                    }
257
                    }
253
                }
258
                }