forked from zikula-modules/Mediashare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpnmedia_extappapi.php
52 lines (44 loc) · 1.45 KB
/
pnmedia_extappapi.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
// $Id$
//
// Mediashare by Jorn Lind-Nielsen (C)
//
class mediashare_extapp
{
function getTitle()
{
$dom = ZLanguage::getModuleDomain('mediashare');
return __('Mediashare External Application Handler', $dom);
}
function getMediaTypes()
{
return array();
}
function createPreviews($args, $previews)
{
return array();
}
function getMediaDisplayHtml($url, $width, $height, $id, $args)
{
if ((string)(int)$width == "$width") {
$width = "{$width}px";
}
$widthHtml = ($width == null ? '' : " width:{$width}");
$heightHtml = ($height == null ? '' : " height:$height");
$onclickHtml = (empty($args['onclick']) ? '' : " onclick=\"$args[onclick]\"");
$classHtml = (empty($args['class']) ? '' : " class=\"$args[class]\"");
$idHtml = ($id != '' ? " id=\"$id\"" : '');
$style = " style=\"$widthHtml$heightHtml\"";
$title = (isset($args['title']) ? htmlspecialchars($args['title']) : '');
$html = "<img src=\"$url\"$style$idHtml title=\"$title\" alt=\"$title\"$onclickHtml$classHtml/>";
if (isset($args['url'])) {
$rel = (isset($args['urlRel']) ? " rel=\"$args[urlRel]\"" : '');
$html = "<a href=\"$args[url]\"$rel>$html</a>";
}
return $html;
}
}
function mediashare_media_extappapi_buildHandler($args)
{
return new mediashare_extapp();
}