CMS  Version 3.9
ImageRecord Class Reference

Inherits DataItem.

Public Member Functions

 Gallery ()
 
 ImageRecord ()
 
 formatThumbnail ($width=75, $height=0)
 
 getImage ()
 
 isSVG ()
 
 getThumbnail ($size=0, $iconize=false)
 
 getCaption ()
 
 getShortCredit ()
 
 Owner ()
 
 isOwner ()
 

Static Public Member Functions

static findByFileName ($filename)
 

Public Attributes

 $fields
 
 $relations
 

Detailed Description

Definition at line 40 of file image.inc.

Member Function Documentation

◆ findByFileName()

static ImageRecord::findByFileName (   $filename)
static

Definition at line 102 of file image.inc.

103  {
104  $images = Query::create(ImageRecord, "WHERE image_file=:f")
105  ->bind(":f", $filename)
106  ->execute();
107 
108  return (count($images) > 0) ? $images[0] : null;
109  }
$images
Definition: images.inc:46
if(!Settings::getValue("debug", "enable_trace_file_downloads")) $filename
Definition: trace.inc:42

◆ formatThumbnail()

ImageRecord::formatThumbnail (   $width = 75,
  $height = 0 
)

Definition at line 83 of file image.inc.

84  {
85  $thumbnail = $this->getThumbnail();
86  $text = "<img src='$thumbnail' alt='".htmlSafe($this->title)."' border='0'";
87  if($width > 0)
88  {
89  $text .= " width='$width'";
90  }
91 
92  if ($height > 0)
93  {
94  $text .= " height='$height'";
95  }
96 
97  $text .= "/>";
98 
99  return $text;
100  }
$bookmark title
getThumbnail($size=0, $iconize=false)
Definition: image.inc:132
$height
Definition: cover.inc:38
$width
Definition: cover.inc:37

◆ Gallery()

ImageRecord::Gallery ( )

Definition at line 67 of file image.inc.

68  {
69  return $this->getRelated(ImageGallery);
70  }

◆ getCaption()

ImageRecord::getCaption ( )

Definition at line 138 of file image.inc.

139  {
140  return $this->title;
141  }

◆ getImage()

ImageRecord::getImage ( )

Definition at line 111 of file image.inc.

112  {
113  global $config;
114 
115  if ($img == "blank" || $img == "")
116  {
117  $img = "/fakoli/images/blank.gif";
118  }
119  else
120  {
121  $img = "/action/image/show?image_id={$this->image_id}";
122  }
123 
124  return $img;
125  }
global $config
Definition: import.inc:4

◆ getShortCredit()

ImageRecord::getShortCredit ( )

Definition at line 143 of file image.inc.

144  {
145  //this is used to create the correct citation for a library item
146  return $this->credits;
147  }

◆ getThumbnail()

ImageRecord::getThumbnail (   $size = 0,
  $iconize = false 
)

Definition at line 132 of file image.inc.

133  {
134  $mgr = new ImageManager();
135  return $mgr->thumbnailLink($this->image_id, $size, $iconize);
136  }
$size
Definition: download.inc:47
The ImageManager class provides basic Image manipulation functions that are useful when working with ...

◆ ImageRecord()

ImageRecord::ImageRecord ( )

Definition at line 72 of file image.inc.

73  {
74  $this->table = "image";
75  $this->primary_key = "image_id";
76 
77  $this->default_format = "{title}";
78  $this->pretty_class_name = "Image";
79 
80  $this->DataItem(func_get_args());
81  }

◆ isOwner()

ImageRecord::isOwner ( )

Definition at line 155 of file image.inc.

156  {
157  global $user;
158  $owner = $this->Owner();
159 
160  return ($owner->user_id == $user->user_id) ? true : false;
161  }
global $user
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true
Definition: redirects.inc:9

◆ isSVG()

ImageRecord::isSVG ( )

Definition at line 127 of file image.inc.

128  {
129  return endsWith($this->image_file, ".svg");
130  }

◆ Owner()

ImageRecord::Owner ( )

Definition at line 149 of file image.inc.

150  {
151  $mgr = new UserManager();
152  return $mgr->getUser($this->owner_id);
153  }
$calendar owner_id
Provides the interface to the user model for the application.

Member Data Documentation

◆ $fields

ImageRecord::$fields
Initial value:
= array("image_id" => Number,
"title" => String,
"image_file" => String,
"ALT_tag" => String,
"date_taken" => Date,
"credits" => String,
"caption" => String,
"keywords" => String,
"related_resource" => String,
"published" => Boolean,
"include_in_slideshow" => Boolean,
"sort_order" => Number,
"image_type" => String,
"gallery_id" => Number,
"owner_id" => Number
)

Definition at line 43 of file image.inc.

◆ $relations

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

Definition at line 62 of file image.inc.


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