diff options
Diffstat (limited to 'core/models/item.php')
-rw-r--r-- | core/models/item.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/core/models/item.php b/core/models/item.php index e29f3245..da0e7eb3 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -84,6 +84,14 @@ class Item_Model extends ORM_MPTT { return $this->type == 'photo'; } + /** + * Is this item a movie? + * @return true if it's a movie + */ + public function is_movie() { + return $this->type == 'movie'; + } + public function delete() { $original_path = $this->file_path(); $original_resize_path = $this->resize_path(); @@ -308,7 +316,7 @@ class Item_Model extends ORM_MPTT { } /** - * Return an <img> tag for the thumbnail. + * Return an <img> tag for the resize. * @param array $extra_attrs Extra attributes to add to the img tag * @return string */ @@ -319,4 +327,15 @@ class Item_Model extends ORM_MPTT { "height" => $this->resize_height), $extra_attrs); } + + public function movie_tag($extra_attrs) { + return html::anchor($this->file_url(true), "", + array_merge( + $extra_attrs, + array("id" => "player", + "style" => "display:block;width:400px;height:300px"))) . + "<script>flowplayer('player', '" . + url::abs_file("lib/flowplayer-3.0.5.swf") . + "'); </script>"; + } } |