From b6f8691bdc26986e031a3b2d5a63db4be67dea43 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 18 Apr 2012 09:07:37 +0200 Subject: Simplified video dimensions take. --- start.php | 33 +++++---------------------------- views/default/object/videolist_item.php | 6 +++--- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/start.php b/start.php index 77bf0a7bc..d6a5ee8b1 100644 --- a/start.php +++ b/start.php @@ -34,6 +34,11 @@ function videolist_init() { 'tags' => 'tags', 'access_id' => 'access', )); + + elgg_set_config('videolist_dimensions', array( + 'width' => 600, + 'height' => 400, + )); // extend group main page elgg_extend_view('groups/tool_latest', 'videolist/group_module'); @@ -288,34 +293,6 @@ function videolist_icon_url_override($hook, $type, $returnvalue, $params) { } } -/** - * @param ElggObject $videolist_item - * @return array - */ -function videolist_get_video_dimensions(ElggObject $videolist_item) { - $dimensions = array( - 'width' => 600, - 'height' => 400, - ); - $params['entity'] = $videolist_item; - $params['videotype'] = $videolist_item->videotype; - $dimensions = elgg_trigger_plugin_hook( - 'videolist:setdimensions', - $params['videotype'], - $params, - $dimensions); - if (! is_array($dimensions)) { - $dimensions = array(); - } - if (empty($dimensions['width']) || ! is_numeric($dimensions['width'])) { - $dimensions['width'] = 600; - } - if (empty($dimensions['height']) || ! is_numeric($dimensions['height'])) { - $dimensions['height'] = 400; - } - return $dimensions; -} - /** * Prepend HTTP scheme if missing * @param string $hook diff --git a/views/default/object/videolist_item.php b/views/default/object/videolist_item.php index 5e0db00ce..a1943216d 100644 --- a/views/default/object/videolist_item.php +++ b/views/default/object/videolist_item.php @@ -61,11 +61,11 @@ if (elgg_in_context('widgets')) { if ($full && !elgg_in_context('gallery')) { - $dimensions = videolist_get_video_dimensions($entity); + $dimensions = elgg_get_config('videolist_dimensions'); $content = elgg_view("videolist/watch/{$entity->videotype}", array( 'entity' => $entity, - 'width' => $dimensions['width'], - 'height' => $dimensions['height'], + 'width' => (int) $dimensions['width'], + 'height' => (int) $dimensions['height'], )); $content = "
$content
"; -- cgit v1.2.3