$rsspath = rss_get_url($course->id, $userid, 'lightboxgallery', $gallery->id); $meta .= "\n" . '<link rel="alternate" href="' . $rsspath . '" type="application/rss+xml" title="' . format_string($gallery->name) . '" id="gallery" />'; } $meta .= "\n" . '<style type="text/css">'; $meta .= "\n" . '#navbar_bg {display:none;}'; $meta .= "\n" . '#header_bg {display:none;}'; $meta .= "\n" . '#banner_bg {display:none;}'; $meta .= "\n" . '</style>'; print_header(); //$course->shortname . ': ' . $gallery->name, $course->fullname, $navigation, '', $meta, true, $update, navmenu($course, $cm)); $heading = get_string('displayinggallery', 'lightboxgallery', $gallery->name); if ($allowrssfeed) { $heading .= ' ' . rss_get_link($course->id, $userid, 'lightboxgallery', $gallery->id, get_string('rsssubscribe', 'lightboxgallery')); } print_heading($heading); lightboxgallery_print_js_config($gallery->autoresize); $fobj = new object(); $fobj->para = false; if ($gallery->description && !$editing) { print_simple_box(format_text($gallery->description, FORMAT_MOODLE, $fobj), 'center'); } print_simple_box_start('center'); $dataroot = $CFG->dataroot . '/' . $course->id . '/' . $gallery->folder; $webroot = lightboxgallery_get_image_url($gallery->id); $allimages = lightboxgallery_directory_images($dataroot); $images = $gallery->perpage == 0 ? $allimages : array_slice($allimages, $page * $gallery->perpage, $gallery->perpage); $captions = array(); if ($cobjs = get_records_select('lightboxgallery_image_meta', "metatype = 'caption' AND gallery = {$gallery->id}")) { foreach ($cobjs as $cobj) { $captions[$cobj->image] = $cobj->description; }
$navlinks[] = array('name' => "'" . s($search, true) . "'", 'link' => '', 'type' => 'misc'); if (isset($gallery)) { if (!($cm = get_coursemodule_from_instance('lightboxgallery', $gallery->id, $course->id))) { error('Course Module ID was incorrect'); } $heading = $course->shortname . ': ' . $gallery->name; $navigation = build_navigation($navlinks, $cm); } else { $strmodplural = get_string('modulenameplural', 'lightboxgallery'); array_unshift($navlinks, array('name' => $strmodplural, 'link' => $CFG->wwwroot . '/mod/lightboxgallery/index.php?id=' . $course->id, 'type' => 'activity')); $heading = $course->shortname . ': ' . $strmodplural; $navigation = build_navigation($navlinks); } print_header($heading, $course->fullname, $navigation, '', '<link rel="stylesheet" type="text/css" href="' . $CFG->wwwroot . '/mod/lightboxgallery/scripts/lightbox.css" />'); echo '<br />'; lightboxgallery_print_js_config(1); if ($instances = get_all_instances_in_course('lightboxgallery', $course)) { $options = array(0 => get_string('all')); foreach ($instances as $instance) { $options[$instance->id] = $instance->name; } echo '<form action="search.php"><div>'; $table = new object(); $table->width = '*'; $table->align = array('left', 'left', 'left', 'left'); $table->data[] = array(get_string('modulenameshort', 'lightboxgallery'), choose_from_menu($options, 'l', $l, '', '', '', true), '<input type="text" name="search" size="10" value="' . s($search, true) . '" />' . '<input type="hidden" name="id" value="' . $course->id . '" />', '<input type="submit" value="' . get_string('search') . '" />'); print_table($table); echo '</div></form>'; } $galleryselect = isset($gallery) ? 'AND l.id = ' . $gallery->id : ''; $like = sql_ilike();