aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-07 16:48:54 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-07 16:48:54 -0700
commit09e365c797a6e63b2028e5980b32b52551f774db (patch)
tree27598390e6724365b572920e5c843273f9cbf498
parent78f0138270347d3e9621ba7b5cdffbc7fc34a48b (diff)
parentf6cf992aee86e69d1ea5790c22d4af40c266d79e (diff)
downloadvolse-hubzilla-09e365c797a6e63b2028e5980b32b52551f774db.tar.gz
volse-hubzilla-09e365c797a6e63b2028e5980b32b52551f774db.tar.bz2
volse-hubzilla-09e365c797a6e63b2028e5980b32b52551f774db.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
-rw-r--r--include/dir_fns.php61
-rw-r--r--include/taxonomy.php4
-rw-r--r--include/widgets.php2
-rw-r--r--mod/directory.php35
-rw-r--r--view/css/conversation.css4
-rw-r--r--view/theme/redbasic/css/style.css6
-rw-r--r--view/theme/redbasic/schema/focus.css5
-rw-r--r--view/theme/redbasic/schema/focus.php2
-rwxr-xr-xview/tpl/conv_item.tpl3
-rwxr-xr-xview/tpl/conv_list.tpl3
-rw-r--r--view/tpl/dir_sort_links.tpl7
-rwxr-xr-xview/tpl/directory_header.tpl12
-rwxr-xr-xview/tpl/page_display.tpl19
-rwxr-xr-xview/tpl/photo_item.tpl2
-rwxr-xr-xview/tpl/search_item.tpl2
15 files changed, 80 insertions, 87 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 77c78558c..be8175d06 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -72,33 +72,20 @@ function check_upstream_directory() {
set_config('system', 'directory_server', '');
}
-function get_globaldir_setting($observer) {
-
- if($observer)
- $globaldir = get_xconfig($observer,'directory','globaldir');
- else
- $globaldir = ((array_key_exists('globaldir',$_SESSION)) ? intval($_SESSION['globaldir']) : false);
-
- if($globaldir === false)
- $globaldir = get_config('directory','globaldir');
-
- return $globaldir;
-}
-
-function get_safemode_setting($observer) {
+function get_directory_setting($observer, $setting) {
if ($observer)
- $safe_mode = get_xconfig($observer,'directory','safe_mode');
+ $ret = get_xconfig($observer, 'directory', $setting);
else
- $safe_mode = ((array_key_exists('safemode',$_SESSION)) ? intval($_SESSION['safemode']) : false);
+ $ret = ((array_key_exists($setting,$_SESSION)) ? intval($_SESSION[$setting]) : false);
- if($safe_mode === false)
- $safe_mode = get_config('directory','safe_mode');
+ if($ret === false)
+ $ret = get_config('directory', $setting);
- if($safe_mode === false)
- $safe_mode = 1;
+ if($setting == 'safe_mode' && $ret === false)
+ $ret = 1;
- return $safe_mode;
+ return $ret;
}
/**
@@ -110,49 +97,37 @@ function dir_sort_links() {
$observer = get_observer_hash();
- $safe_mode = get_safemode_setting($observer);
- $globaldir = get_globaldir_setting($observer);
+ $safe_mode = get_directory_setting($observer, 'safemode');
+ $globaldir = get_directory_setting($observer, 'globaldir');
+ $pubforums = get_directory_setting($observer, 'pubforums');
// Build urls without order and pubforums so it's easy to tack on the changed value
// Probably there's an easier way to do this
-
$directory_sort_order = get_config('system','directory_sort_order');
if(! $directory_sort_order)
$directory_sort_order = 'date';
-
$current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : $directory_sort_order);
- $url = 'directory?f=';
+ $suggest = (($_REQUEST['suggest']) ? '&suggest=' . $_REQUEST['suggest'] : '');
- $tmp = array_merge($_GET,$_POST);
- unset($tmp['order']);
- unset($tmp['q']);
- unset($tmp['f']);
- $sorturl = $url . http_build_query($tmp);
+ $url = 'directory?f=';
$tmp = array_merge($_GET,$_POST);
+ unset($tmp['suggest']);
unset($tmp['pubforums']);
unset($tmp['global']);
unset($tmp['safe']);
unset($tmp['q']);
unset($tmp['f']);
- $forumsurl = $url . http_build_query($tmp);
+ $forumsurl = $url . http_build_query($tmp) . $suggest;
$o = replace_macros(get_markup_template('dir_sort_links.tpl'), array(
'$header' => t('Directory Options'),
- '$normal' => t('Alphabetic'),
- '$reverse' => t('Reverse Alphabetic'),
- '$date' => t('Newest to Oldest'),
- '$reversedate' => t('Oldest to Newest'),
- '$sort' => t('Sort'),
- '$selected_sort' => $current_order,
- '$sorturl' => $sorturl,
'$forumsurl' => $forumsurl,
- '$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'','',' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
-
- '$pubforums' => array('pubforums', t('Public Forums Only'),(x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : ''),'','',' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''),
- '$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'','',' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
+ '$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
+ '$pubforums' => array('pubforums', t('Public Forums Only'),$pubforums,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''),
+ '$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
));
return $o;
diff --git a/include/taxonomy.php b/include/taxonomy.php
index fa540ac56..a5da190d4 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -276,7 +276,7 @@ function dir_tagblock($link,$r) {
$o = '';
$observer = get_observer_hash();
- if(! get_globaldir_setting($observer))
+ if(! get_directory_setting($observer, 'globaldir'))
return $o;
@@ -407,4 +407,4 @@ function get_things($profile_hash,$uid) {
//logger('things: ' . print_r($sorted_things,true));
return $sorted_things;
-} \ No newline at end of file
+}
diff --git a/include/widgets.php b/include/widgets.php
index 4a9032a21..888e56733 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -132,7 +132,7 @@ function widget_suggestions($arr) {
'profile' => $rr['xchan_url'],
'name' => $rr['xchan_name'],
'photo' => $rr['xchan_photo_m'],
- 'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'],
+ 'ignlnk' => z_root() . '/directory?ignore=' . $rr['xchan_hash'],
'conntxt' => t('Connect'),
'connlnk' => $connlnk,
'ignore' => t('Ignore/Hide')
diff --git a/mod/directory.php b/mod/directory.php
index 6d066a21b..44d80cff1 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -19,6 +19,7 @@ function directory_init(&$a) {
$observer = get_observer_hash();
$global_changed = false;
$safe_changed = false;
+ $pubforums_changed = false;
if(array_key_exists('global',$_REQUEST)) {
$globaldir = intval($_REQUEST['global']);
@@ -28,7 +29,7 @@ function directory_init(&$a) {
$_SESSION['globaldir'] = $globaldir;
if($observer)
set_xconfig($observer,'directory','globaldir',$globaldir);
- }
+ }
if(array_key_exists('safe',$_REQUEST)) {
$safemode = intval($_REQUEST['safe']);
@@ -37,9 +38,19 @@ function directory_init(&$a) {
if($safe_changed) {
$_SESSION['safemode'] = $safemode;
if($observer)
- set_xconfig($observer,'directory','safe_mode',$safemode);
- }
+ set_xconfig($observer,'directory','safemode',$safemode);
+ }
+
+ if(array_key_exists('pubforums',$_REQUEST)) {
+ $pubforums = intval($_REQUEST['pubforums']);
+ $pubforums_changed = true;
+ }
+ if($pubforums_changed) {
+ $_SESSION['pubforums'] = $pubforums;
+ if($observer)
+ set_xconfig($observer,'directory','pubforums',$pubforums);
+ }
}
function directory_content(&$a) {
@@ -51,18 +62,14 @@ function directory_content(&$a) {
$observer = get_observer_hash();
- $globaldir = get_globaldir_setting($observer);
+ $globaldir = get_directory_setting($observer, 'globaldir');
// override your personal global search pref if we're doing a navbar search of the directory
if(intval($_REQUEST['navsearch']))
$globaldir = 1;
- $safe_mode = get_safemode_setting($observer);
+ $safe_mode = get_directory_setting($observer, 'safemode');
- $pubforums = null;
- if(array_key_exists('pubforums',$_REQUEST))
- $pubforums = intval($_REQUEST['pubforums']);
- if(! $pubforums)
- $pubforums = null;
+ $pubforums = get_directory_setting($observer, 'pubforums');
$o = '';
nav_set_selected('directory');
@@ -375,7 +382,13 @@ function directory_content(&$a) {
'$entries' => $entries,
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
'$submit' => t('Find'),
- '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page'))
+ '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
+ '$sort' => t('Sort options'),
+ '$normal' => t('Alphabetic'),
+ '$reverse' => t('Reverse Alphabetic'),
+ '$date' => t('Newest to Oldest'),
+ '$reversedate' => t('Oldest to Newest'),
+ '$suggest' => $suggest ? '&suggest=1' : ''
));
diff --git a/view/css/conversation.css b/view/css/conversation.css
index bb6887d59..7d4930aac 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -196,10 +196,6 @@ a.wall-item-name-link {
filter:alpha(opacity=100);
}
-.wall-item-wrapper-end {
- clear: both;
-}
-
.shared_header {
margin-bottom: 20px;
}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index fcc089cf0..716298845 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -741,8 +741,8 @@ a.rateme, div.rateme {
}
.wall-item-conv {
- margin-top: 5px;
- margin-bottom: 25px;
+ padding-top: 5px;
+ padding-bottom: 10px;
}
@@ -1932,12 +1932,14 @@ nav .dropdown-menu {
background-color: $comment_item_colour;
border-bottom-left-radius: $radiuspx;
border-bottom-right-radius: $radiuspx;
+ word-wrap: break-word;
}
.section-content-wrapper-np {
background-color: $comment_item_colour;
border-bottom-left-radius: $radiuspx;
border-bottom-right-radius: $radiuspx;
+ word-wrap: break-word;
}
[id^="cloud-index-"]:hover td,
diff --git a/view/theme/redbasic/schema/focus.css b/view/theme/redbasic/schema/focus.css
index 8d945a83e..3d64b8a7d 100644
--- a/view/theme/redbasic/schema/focus.css
+++ b/view/theme/redbasic/schema/focus.css
@@ -21,7 +21,6 @@
}
.wall-item-conv {
- margin-bottom: 10px;
- margin-top: 10px;
- margin-left: 10px;
+ padding-top: 10px;
+ padding-left: 10px;
}
diff --git a/view/theme/redbasic/schema/focus.php b/view/theme/redbasic/schema/focus.php
index d93ee003e..4186c9f64 100644
--- a/view/theme/redbasic/schema/focus.php
+++ b/view/theme/redbasic/schema/focus.php
@@ -46,7 +46,7 @@ if (! $radius)
if (! $shadow)
$shadow = "0";
if (! $converse_width)
- $converse_width = "676";
+ $converse_width = "656";
if(! $top_photo)
$top_photo = '48px';
if(! $comment_indent)
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 27632d770..30a007bd6 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -165,8 +165,7 @@
</div>
<div class="clear"></div>
</div>
- <div class="wall-item-wrapper-end"></div>
- <div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
+ <div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
{{if $item.toplevel}}
{{foreach $item.children as $child}}
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index cb2fb8959..5487d5937 100755
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -179,8 +179,7 @@
</div>
<div class="clear"></div>
</div>
- <div class="wall-item-wrapper-end"></div>
- <div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
+ <div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>
{{if $item.comment_lastcollapsed}}
diff --git a/view/tpl/dir_sort_links.tpl b/view/tpl/dir_sort_links.tpl
index 5cefe2f28..9346a7455 100644
--- a/view/tpl/dir_sort_links.tpl
+++ b/view/tpl/dir_sort_links.tpl
@@ -5,11 +5,4 @@
{{include file="field_checkbox.tpl" field=$globaldir}}
{{include file="field_checkbox.tpl" field=$pubforums}}
-{{$sort}}: <select onchange='window.location.href="{{$sorturl}}&order="+this.value'>
-<option value='normal' {{if $selected_sort == 'normal'}}selected='selected'{{/if}}>{{$normal}}</option>
-<option value='reverse' {{if $selected_sort == 'reverse'}}selected='selected'{{/if}}>{{$reverse}}</option>
-<option value='date' {{if $selected_sort == 'date'}}selected='selected'{{/if}}>{{$date}}</option>
-<option value='reversedate' {{if $selected_sort == 'reversedate'}}selected='selected'{{/if}}>{{$reversedate}}</option>
-</select><br />
-
</div>
diff --git a/view/tpl/directory_header.tpl b/view/tpl/directory_header.tpl
index 26739efc3..79598fc9a 100755
--- a/view/tpl/directory_header.tpl
+++ b/view/tpl/directory_header.tpl
@@ -1,6 +1,18 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
+ <div class="btn-group pull-right">
+ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{$sort}}">
+ <i class="icon-sort"></i>
+ </button>
+ <ul class="dropdown-menu">
+ <li><a href="directory?f=&order=date{{$suggest}}">{{$date}}</a></li>
+ <li><a href="directory?f=&order=normal{{$suggest}}">{{$normal}}</a></li>
+ <li><a href="directory?f=&order=reversedate{{$suggest}}">{{$reversedate}}</a></li>
+ <li><a href="directory?f=&order=reverse{{$suggest}}">{{$reverse}}</a></li>
+ </ul>
+ </div>
<h2>{{$dirlbl}}{{if $search}}:&nbsp;{{$safetxt}}{{/if}}</h2>
+ <div class="clear"></div>
</div>
{{foreach $entries as $entry}}
{{include file="direntry.tpl"}}
diff --git a/view/tpl/page_display.tpl b/view/tpl/page_display.tpl
index 5328648b9..a320920c7 100755
--- a/view/tpl/page_display.tpl
+++ b/view/tpl/page_display.tpl
@@ -1,9 +1,14 @@
<div class="page">
-
-<div class="generic-content-wrapper" id="page-content-wrapper" >
- {{if $title}}<h2 class="page-title">{{$title}}</h2>{{/if}}
- <div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
- <div class="page-date">{{$date}}</div>
- <div class="page-body">{{$body}}</div>
-</div>
+ <div class="generic-content-wrapper" id="page-content-wrapper" >
+ {{if $title}}
+ <div class="section-title-wrapper">
+ <h2 class="page-title">{{$title}}</h2>
+ </div>
+ {{/if}}
+ <div class="section-content-wrapper">
+ <div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
+ <div class="page-date">{{$date}}</div>
+ <div class="page-body">{{$body}}</div>
+ </div>
+ </div>
</div>
diff --git a/view/tpl/photo_item.tpl b/view/tpl/photo_item.tpl
index 16f9a76c2..2ea7aa9f3 100755
--- a/view/tpl/photo_item.tpl
+++ b/view/tpl/photo_item.tpl
@@ -21,7 +21,7 @@
{{$comment}}
- <div class="wall-item-outside-wrapper-end{{$indent}}" ></div>
+ <div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index dee33f1b3..256443b84 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -57,7 +57,7 @@
<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'>{{$item.conv.title}}</a>
</div>
{{/if}}
- <div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
+ <div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>