CMS  Version 3.9
slideshow_picker.inc
Go to the documentation of this file.
1 <?php
2 
3 Fakoli::using("image");
4 Fakoli::usingFeature("data_view");
5 
6 $editor = $_GET["Editor"];
7 
8 $galleries = Query::create(ImageGallery, "ORDER BY gallery_name")->execute();
9 
10 $table = new DataListView($galleries, "galleries");
11 
12 $table->column("Gallery", "<a href='#' onclick='picker.selectSlideshow(this, {gallery_id})'>{gallery_name}</a>", true, "width: 80%")
13  ->column("# of Photos", countPhotos, true, "width: 20%");
14 
15 $table->sortable = true;
16 $table->emptyMessage = "No image galleries have been created";
17 $table->pageSize = 5;
18 $table->zebra = false;
19 
20 $script .= $table->writeScript();
21 $script .= <<<ENDSCRIPT
22 <script type="text/javascript" src="/fakoli/slideshow/slideshow_picker.js"></script>
23 <script type="text/javascript">
24 var picker;
25 window.addEvent('domready', function()
26 {
27  picker = new SlideshowPicker('galleries', '{$editor}');
28 });
29 </script>
30 ENDSCRIPT;
31 $table->drawView();
32 ?>
33 <br/>
34 <label for="width" style="display: inline-block; width: 70px;">Width: </label><input type="text" style="width: 100px" id="width" value="500"/><br/><br/>
35 <label for="height" style="display: inline-block; width: 70px;">Height: </label><input type="text" style="width: 100px" id="height" value="400"/><br/>
36 <br/>
37 <a href="#" onclick="picker.insertSlideshow()" class="button">Insert Slideshow</a>
38 <?
39 
41 {
42  return Query::create(ImageRecord, "WHERE gallery_id=:id AND include_in_slideshow=1")
43  ->bind(":id", $gallery->gallery_id)
44  ->executeValue("COUNT(1)");
45 }
46 ?>
$helpTree style
Definition: tree.inc:46
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
The Slideshow class provides a reusable user interface control that displays images from the database...
Definition: slideshow.inc:51
$galleries
countPhotos($gallery)