CMS  Version 3.9
ImageGallery Class Reference

Inherits DataItem.

Public Member Functions

 Images ($constraint="")
 
 Owner ()
 
 getOwnerName ()
 
 getThumbnailFormat ()
 
 countImages ($constraint="")
 
 getGalleryDirectory ()
 
 ImageGallery ()
 

Static Public Member Functions

static findByIdentifier ($identifier)
 

Public Attributes

 $fields
 
 $relations
 

Static Public Attributes

static $imageLinkModes
 
static $thumbnailFormats
 

Detailed Description

Definition at line 39 of file image_gallery.inc.

Member Function Documentation

◆ countImages()

ImageGallery::countImages (   $constraint = "")

Definition at line 94 of file image_gallery.inc.

95  {
96  if ($constraint)
97  {
98  $constraint .= " AND ";
99  }
100  else
101  {
102  $constraint = "WHERE ";
103  }
104  $constraint .= "gallery_id={$this->gallery_id}";
105  return queryValue(ImageRecord, "COUNT(1)", $constraint);
106  }
$constraint

◆ findByIdentifier()

static ImageGallery::findByIdentifier (   $identifier)
static

Definition at line 115 of file image_gallery.inc.

116  {
117  $match = Query::create(ImageGallery, "WHERE identifier=:id")
118  ->bind(":id", $identifier)
119  ->executeSingle();
120 
121  return $match;
122  }
$identifier
Definition: rss.inc:37

◆ getGalleryDirectory()

ImageGallery::getGalleryDirectory ( )

Definition at line 108 of file image_gallery.inc.

109  {
110  global $config;
111 
112  return $config['uploadbase'] . DIRECTORY_SEPARATOR . "gallery_{$this->gallery_id}";
113  }
global $config
Definition: import.inc:4

◆ getOwnerName()

ImageGallery::getOwnerName ( )

Definition at line 84 of file image_gallery.inc.

85  {
86  return $this->Owner()->getFullName();
87  }

◆ getThumbnailFormat()

ImageGallery::getThumbnailFormat ( )

Definition at line 89 of file image_gallery.inc.

90  {
91  return ($this->thumbnail_format) ? $this->thumbnail_format : Settings::getValue("image", "thumbnail_format");
92  }
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104

◆ ImageGallery()

ImageGallery::ImageGallery ( )

Definition at line 124 of file image_gallery.inc.

125  {
126  $this->primary_key = "gallery_id";
127  $this->table = "image_gallery";
128 
129  // Patch in the user class, since this can be overridden by the application
130  $mgr = new UserManager();
131  $this->relations["Owner"] = $mgr->getUserClass();
132 
133  $this->default_format = "{gallery_name}";
134 
135  $this->DataItem(func_get_args());
136  }
Provides the interface to the user model for the application.

◆ Images()

ImageGallery::Images (   $constraint = "")

Definition at line 73 of file image_gallery.inc.

74  {
75  return $this->getRelatedList(ImageRecord, "", $constraint);
76  }

◆ Owner()

ImageGallery::Owner ( )

Definition at line 78 of file image_gallery.inc.

79  {
80  $mgr = new UserManager();
81  return $mgr->getUser($this->owner_id);
82  }
$calendar owner_id

Member Data Documentation

◆ $fields

ImageGallery::$fields
Initial value:
= array("gallery_id" => Number,
"gallery_name" => String,
"identifier" => String,
"description" => HTML,
"keywords" => String,
"thumbnail_size" => Number,
"thumbnail_format" => String,
"image_link_mode" => String,
"fix_orientation" => Boolean,
"randomize_filenames" => Boolean,
"hidden" => Boolean,
"owner_id" => Number,
"read_access" => String,
"write_access" => String,
"published" => Boolean,
"last_modified" => Timestamp)

Definition at line 43 of file image_gallery.inc.

◆ $imageLinkModes

ImageGallery::$imageLinkModes
static
Initial value:
= array("None" => "No Resource Link",
"Thumbnail" => "Link from Thumbnail",
"Lightbox" => "Link from Lightbox")

Definition at line 65 of file image_gallery.inc.

◆ $relations

ImageGallery::$relations
Initial value:
= array( "Images" => ImageRecord,
"Owner" => "")

Definition at line 62 of file image_gallery.inc.

◆ $thumbnailFormats

ImageGallery::$thumbnailFormats
static
Initial value:
= array("" => "Use Default",
"png" => "PNG",
"jpg" => "JPEG")

Definition at line 69 of file image_gallery.inc.


The documentation for this class was generated from the following file: