aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-13 13:06:31 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-13 13:06:31 -0800
commitac27db22c18ee7a82a52cbadb3efe2760b910499 (patch)
treeaa7002d73dbcd4136033589f1cb135184f4126c1 /include/widgets.php
parent1a5a5c7edb8697c93f8bababbafa80245378dd7e (diff)
parent109cb936632c693d3f24afb9e2ce533797ad1a7f (diff)
downloadvolse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.tar.gz
volse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.tar.bz2
volse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: boot.php include/dba/dba_driver.php include/diaspora.php include/follow.php include/session.php include/zot.php mod/photos.php mod/ping.php
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/include/widgets.php b/include/widgets.php
index cd0832846..74bdb5d74 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -330,19 +330,32 @@ function widget_archive($arr) {
$wall = ((array_key_exists('wall', $arr)) ? intval($arr['wall']) : 0);
$style = ((array_key_exists('style', $arr)) ? $arr['style'] : 'select');
+ $showend = ((get_pconfig($uid,'system','archive_show_end_date')) ? true : false);
+ $mindate = get_pconfig($uid,'system','archive_mindate');
+ $visible_years = get_pconfig($uid,'system','archive_visible_years');
+ if(! $visible_years)
+ $visible_years = 5;
+
+
$url = z_root() . '/' . $a->cmd;
- $ret = list_post_dates($uid,$wall);
+ $ret = list_post_dates($uid,$wall,$mindate);
if(! count($ret))
return '';
+ $cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years;
+ $cutoff = ((array_key_exists($cutoff_year,$ret))? true : false);
+
$o = replace_macros(get_markup_template('posted_date_widget.tpl'),array(
'$title' => t('Archives'),
- '$size' => ((count($ret) > 6) ? 6 : count($ret)),
+ '$size' => $visible_years,
+ '$cutoff_year' => $cutoff_year,
+ '$cutoff' => $cutoff,
'$url' => $url,
'$style' => $style,
+ '$showend' => $showend,
'$dates' => $ret
));
return $o;
@@ -387,6 +400,17 @@ function widget_tagcloud_wall($arr) {
return tagblock('search',$a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL);
return '';
}
+function widget_catcloud_wall($arr) {
+ $a = get_app();
+ if((! $a->profile['profile_uid']) || (! $a->profile['channel_hash']))
+ return '';
+ if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_stream'))
+ return '';
+
+ $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
+ return catblock($a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL);
+ return '';
+}
function widget_affinity($arr) {
@@ -493,7 +517,7 @@ function widget_settings_menu($arr) {
if($role === false || $role === 'custom') {
$tabs[] = array(
- 'label' => t('Automatic Permissions (Advanced)'),
+ 'label' => t('Connection Default Permissions'),
'url' => $a->get_baseurl(true) . '/connedit/' . $abook_self_id,
'selected' => ''
);
@@ -561,7 +585,7 @@ function widget_design_tools($arr) {
// otherwise local_user() is sufficient for permissions.
if($a->profile['profile_uid'])
- if($a->profile['profile_uid'] != local_user())
+ if(($a->profile['profile_uid'] != local_user()) && (! $a->is_sys))
return '';
if(! local_user())