Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 261... Línea 261...
261
        $table->finish_output();
261
        $table->finish_output();
262
        $actions = [
262
        $actions = [
263
            (object) [
263
            (object) [
264
                'link'  => helper::get_edit_tour_link(),
264
                'link'  => helper::get_edit_tour_link(),
265
                'linkproperties' => [],
265
                'linkproperties' => [],
266
                'img'   => 'b/tour-new',
266
                'img'   => 'i/tour-new',
267
                'title' => get_string('newtour', 'tool_usertours'),
267
                'title' => get_string('newtour', 'tool_usertours'),
268
            ],
268
            ],
269
            (object) [
269
            (object) [
270
                'link'  => helper::get_import_tour_link(),
270
                'link'  => helper::get_import_tour_link(),
271
                'linkproperties' => [],
271
                'linkproperties' => [],
272
                'img'   => 'b/tour-import',
272
                'img'   => 'i/tour-import',
273
                'title' => get_string('importtour', 'tool_usertours'),
273
                'title' => get_string('importtour', 'tool_usertours'),
274
            ],
274
            ],
275
            (object) [
275
            (object) [
276
                'link'  => new \moodle_url('https://moodle.net/search', ['q' => 'user tours']),
276
                'link'  => new \moodle_url('https://moodle.net/search', ['q' => 'user tours']),
277
                'linkproperties' => [
277
                'linkproperties' => [
278
                        'target' => '_blank',
278
                        'target' => '_blank',
279
                    ],
279
                    ],
280
                'img'   => 'b/tour-shared',
280
                'img'   => 'i/tour-shared',
281
                'title' => get_string('sharedtourslink', 'tool_usertours'),
281
                'title' => get_string('sharedtourslink', 'tool_usertours'),
282
            ],
282
            ],
283
        ];
283
        ];
Línea 284... Línea 284...
284
 
284
 
285
        echo \html_writer::start_tag('div', [
285
        echo \html_writer::start_tag('div', [
286
                'class' => 'tour-actions',
286
                'class' => 'tour-actions mt-3',
Línea 287... Línea 287...
287
            ]);
287
            ]);
288
 
288
 
289
        echo \html_writer::start_tag('ul');
289
        echo \html_writer::start_tag('ul');
290
        foreach ($actions as $config) {
290
        foreach ($actions as $config) {
291
            $action = \html_writer::start_tag('li');
291
            $action = \html_writer::start_tag('li');
-
 
292
            $linkproperties = $config->linkproperties;
292
            $linkproperties = $config->linkproperties;
293
            $linkproperties['href'] = $config->link;
293
            $linkproperties['href'] = $config->link;
294
            $linkproperties['class'] = 'text-body';
294
            $action .= \html_writer::start_tag('a', $linkproperties);
295
            $action .= \html_writer::start_tag('a', $linkproperties);
295
            $action .= $OUTPUT->pix_icon($config->img, $config->title, 'tool_usertours');
296
            $action .= $OUTPUT->pix_icon($config->img, $config->title, 'tool_usertours', ['class' => 'iconsize-medium']);
296
            $action .= \html_writer::div($config->title);
297
            $action .= \html_writer::div($config->title);
297
            $action .= \html_writer::end_tag('a');
298
            $action .= \html_writer::end_tag('a');
298
            $action .= \html_writer::end_tag('li');
299
            $action .= \html_writer::end_tag('li');
Línea 396... Línea 397...
396
 
397
 
397
                $form->set_data($data);
398
                $form->set_data($data);
Línea 398... Línea 399...
398
            }
399
            }
-
 
400
 
399
 
401
            $form->display();
400
            $form->display();
402
            $PAGE->requires->js_call_amd('tool_usertours/tour_filters', 'init');
401
            $this->footer();
403
            $this->footer();
Línea 402... Línea 404...
402
        }
404
        }
Línea 501... Línea 503...
501
     * Duplicate an existing tour.
503
     * Duplicate an existing tour.
502
     *
504
     *
503
     * @param   int         $tourid     The ID of the tour to duplicate.
505
     * @param   int         $tourid     The ID of the tour to duplicate.
504
     */
506
     */
505
    protected function duplicate_tour($tourid) {
507
    protected function duplicate_tour($tourid) {
506
        $tour = helper::get_tour($tourid);
508
        require_sesskey();
Línea -... Línea 509...
-
 
509
 
507
 
510
        $tour = helper::get_tour($tourid);
508
        $export = $tour->to_record();
511
        $export = $tour->to_record();
509
        // Remove the id.
512
        // Remove the id.
Línea 510... Línea 513...
510
        unset($export->id);
513
        unset($export->id);