preparatory work for supporting a "list view" mode for conversations. This would be useful for forum-like channels and/or block-oriented themes.

This commit is contained in:
friendica 2014-01-08 15:20:12 -08:00
parent f1d6d58832
commit 7910221832
7 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ require_once('boot.php');
/** /**
* An item * An item
*/ */
class Item extends BaseObject { class Item extends BaseObject {
public $data = array(); public $data = array();
private $template = 'conv_item.tpl'; private $template = 'conv_item.tpl';
@ -458,6 +459,11 @@ class Item extends BaseObject {
return $this->template; return $this->template;
} }
private function set_template($t) {
$this->template = $t;
}
/** /**
* Check if this is a toplevel post * Check if this is a toplevel post
*/ */

View File

@ -782,6 +782,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
// $tx1 = dba_timer(); // $tx1 = dba_timer();
$item_object = new Item($item); $item_object = new Item($item);
$conv->add_thread($item_object); $conv->add_thread($item_object);
if($page_mode === 'list')
$item_object->set_template('conv_list.tpl');
// $tx2 = dba_timer(); // $tx2 = dba_timer();
// if($mode === 'network') // if($mode === 'network')
// profiler($tx1,$tx2,'add thread ' . $item['id']); // profiler($tx1,$tx2,'add thread ' . $item['id']);

View File

@ -233,6 +233,7 @@ function channel_content(&$a, $update = 0, $load = false) {
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
'$search' => '', '$search' => '',
'$order' => '', '$order' => '',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$file' => '', '$file' => '',
'$cats' => (($category) ? $category : ''), '$cats' => (($category) ? $category : ''),
'$mid' => '', '$mid' => '',

View File

@ -125,6 +125,7 @@ function display_content(&$a, $update = 0, $load = false) {
'$nouveau' => '0', '$nouveau' => '0',
'$wall' => '0', '$wall' => '0',
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '', '$search' => '',
'$order' => '', '$order' => '',
'$file' => '', '$file' => '',

View File

@ -237,6 +237,7 @@ function network_content(&$a, $update = 0, $load = false) {
'$spam' => (($spam) ? $spam : '0'), '$spam' => (($spam) ? $spam : '0'),
'$nouveau' => (($nouveau) ? $nouveau : '0'), '$nouveau' => (($nouveau) ? $nouveau : '0'),
'$wall' => '0', '$wall' => '0',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
'$search' => (($search) ? $search : ''), '$search' => (($search) ? $search : ''),
'$order' => $order, '$order' => $order,

View File

@ -96,6 +96,7 @@ function search_content(&$a,$update = 0, $load = false) {
'$spam' => '0', '$spam' => '0',
'$nouveau' => '0', '$nouveau' => '0',
'$wall' => '0', '$wall' => '0',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
'$search' => (($tag) ? urlencode('#') : '') . $search, '$search' => (($tag) ? urlencode('#') : '') . $search,
'$order' => '', '$order' => '',

View File

@ -15,6 +15,7 @@
var bParam_new = {{$nouveau}}; var bParam_new = {{$nouveau}};
var bParam_page = {{$page}}; var bParam_page = {{$page}};
var bParam_wall = {{$wall}}; var bParam_wall = {{$wall}};
var bParam_list = {{$list}};
var bParam_search = "{{$search}}"; var bParam_search = "{{$search}}";
var bParam_order = "{{$order}}"; var bParam_order = "{{$order}}";
@ -38,6 +39,7 @@
if(bParam_spam != 0) bCmd = bCmd + "&spam=" + bParam_spam; if(bParam_spam != 0) bCmd = bCmd + "&spam=" + bParam_spam;
if(bParam_new != 0) bCmd = bCmd + "&new=" + bParam_new; if(bParam_new != 0) bCmd = bCmd + "&new=" + bParam_new;
if(bParam_wall != 0) bCmd = bCmd + "&wall=" + bParam_wall; if(bParam_wall != 0) bCmd = bCmd + "&wall=" + bParam_wall;
if(bParam_list != 0) bCmd = bCmd + "&list=" + bParam_list;
if(bParam_search != "") bCmd = bCmd + "&search=" + bParam_search; if(bParam_search != "") bCmd = bCmd + "&search=" + bParam_search;
if(bParam_order != "") bCmd = bCmd + "&order=" + bParam_order; if(bParam_order != "") bCmd = bCmd + "&order=" + bParam_order;
if(bParam_file != "") bCmd = bCmd + "&file=" + bParam_file; if(bParam_file != "") bCmd = bCmd + "&file=" + bParam_file;