aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-03-04 06:05:47 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-03-04 06:05:47 +0100
commit059da4d01705ca1515e0ccf4b790c407c751685c (patch)
treea7f77e3734ba1e53bf7980ff1b6f0c73bc814602 /include/widgets.php
parent264abef81761a3ed0d27126dbc5a6e0a47fb8ec8 (diff)
parenta59d1b22f6ab1bf5b3cf5df555d71b893c05540a (diff)
downloadvolse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.tar.gz
volse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.tar.bz2
volse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/include/widgets.php b/include/widgets.php
index aa0be87d6..ad54cb59e 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -982,28 +982,48 @@ function widget_cover_photo($arr) {
require_once('include/identity.php');
$o = '';
+ $a = get_app();
+
$channel_id = 0;
if(array_key_exists('channel_id', $arr) && intval($arr['channel_id']))
$channel_id = intval($arr['channel_id']);
if(! $channel_id)
- $channel_id = get_app()->profile_uid;
+ $channel_id = $a->profile_uid;
if(! $channel_id)
return '';
+ $channel = channelx_by_n($channel_id);
+
if(array_key_exists('style', $arr) && isset($arr['style']))
$style = $arr['style'];
else
- $style = 'width:100%; padding-right: 10px; height: auto;';
+ $style = 'width:100%; height: auto;';
// ensure they can't sneak in an eval(js) function
if(strpbrk($style,'(\'"<>') !== false)
$style = '';
+ if(array_key_exists('title', $arr) && isset($arr['title']))
+ $title = $arr['title'];
+ else
+ $title = $channel['channel_name'];
+
+ if(array_key_exists('subtitle', $arr) && isset($arr['subtitle']))
+ $subtitle = $arr['subtitle'];
+ else
+ $subtitle = $channel['xchan_addr'];
+
$c = get_cover_photo($channel_id,'html');
if($c) {
- $o = '<div class="widget">' . (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c) . '</div>';
+ $photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c);
+
+ $o = replace_macros(get_markup_template('cover_photo_widget.tpl'),array(
+ '$photo_html' => $photo_html,
+ '$title' => $title,
+ '$subtitle' => $subtitle,
+ ));
}
return $o;
}
@@ -1297,7 +1317,7 @@ function widget_admin($arr) {
'plugins' => array(z_root() . '/admin/plugins/', t('Plugins'), 'plugins'),
'themes' => array(z_root() . '/admin/themes/', t('Themes'), 'themes'),
'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'),
- 'profs' => array(z_root() . '/admin/profs', t('Profile Config'), 'profs'),
+ 'profs' => array(z_root() . '/admin/profs', t('Profile Fields'), 'profs'),
'dbsync' => array(z_root() . '/admin/dbsync/', t('DB updates'), 'dbsync')
);