1 | <?php |
||
8 | class BusinessPresenter extends BasePresenter |
||
9 | { |
||
10 | 6 | public function __construct(Business $resource) |
|
14 | |||
15 | /** |
||
16 | * get Facebook Profile Public Picture. |
||
17 | * |
||
18 | * @param string $type Type of picture to print |
||
19 | * |
||
20 | * @return string HTML code to render img with facebook picture |
||
21 | */ |
||
22 | 3 | public function facebookImg($type = 'square') |
|
23 | { |
||
24 | 3 | if (!$this->wrappedObject->social_facebook) { |
|
25 | 1 | return '<img class="img-thumbnail" src="//placehold.it/100x100"/>'; |
|
26 | } |
||
27 | 2 | $url = parse_url($this->wrappedObject->social_facebook); |
|
28 | |||
29 | 2 | $userId = trim($url['path'], '/'); |
|
30 | |||
31 | 2 | if ($url['path'] == '/profile.php') { |
|
32 | 1 | parse_str($url['query'], $parts); |
|
33 | 1 | $userId = $parts['id']; |
|
34 | 1 | } |
|
35 | |||
36 | 2 | $url = "http://graph.facebook.com/{$userId}/picture?type=$type"; |
|
37 | |||
38 | 2 | return "<img class=\"img-thumbnail media-object\" src='$url' />"; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * get Google Static Map img. |
||
43 | * |
||
44 | * @param int $zoom Zoom Level |
||
45 | * |
||
46 | * @return string HTML code to render img with map |
||
47 | */ |
||
48 | 1 | public function staticMap($zoom = 15) |
|
63 | |||
64 | /** |
||
65 | * get Industry Icon. |
||
66 | * |
||
67 | * @return string HTML code to render img with icon |
||
68 | */ |
||
69 | 1 | public function industryIcon() |
|
79 | } |
||
80 |