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:
parent
f1d6d58832
commit
7910221832
@ -10,6 +10,7 @@ require_once('boot.php');
|
||||
/**
|
||||
* An item
|
||||
*/
|
||||
|
||||
class Item extends BaseObject {
|
||||
public $data = array();
|
||||
private $template = 'conv_item.tpl';
|
||||
@ -458,6 +459,11 @@ class Item extends BaseObject {
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
|
||||
private function set_template($t) {
|
||||
$this->template = $t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this is a toplevel post
|
||||
*/
|
||||
|
@ -782,6 +782,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
||||
// $tx1 = dba_timer();
|
||||
$item_object = new Item($item);
|
||||
$conv->add_thread($item_object);
|
||||
if($page_mode === 'list')
|
||||
$item_object->set_template('conv_list.tpl');
|
||||
|
||||
// $tx2 = dba_timer();
|
||||
// if($mode === 'network')
|
||||
// profiler($tx1,$tx2,'add thread ' . $item['id']);
|
||||
|
@ -233,6 +233,7 @@ function channel_content(&$a, $update = 0, $load = false) {
|
||||
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
|
||||
'$search' => '',
|
||||
'$order' => '',
|
||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||
'$file' => '',
|
||||
'$cats' => (($category) ? $category : ''),
|
||||
'$mid' => '',
|
||||
|
@ -125,6 +125,7 @@ function display_content(&$a, $update = 0, $load = false) {
|
||||
'$nouveau' => '0',
|
||||
'$wall' => '0',
|
||||
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
|
||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||
'$search' => '',
|
||||
'$order' => '',
|
||||
'$file' => '',
|
||||
|
@ -237,6 +237,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
||||
'$spam' => (($spam) ? $spam : '0'),
|
||||
'$nouveau' => (($nouveau) ? $nouveau : '0'),
|
||||
'$wall' => '0',
|
||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
|
||||
'$search' => (($search) ? $search : ''),
|
||||
'$order' => $order,
|
||||
|
@ -96,6 +96,7 @@ function search_content(&$a,$update = 0, $load = false) {
|
||||
'$spam' => '0',
|
||||
'$nouveau' => '0',
|
||||
'$wall' => '0',
|
||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||
'$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1),
|
||||
'$search' => (($tag) ? urlencode('#') : '') . $search,
|
||||
'$order' => '',
|
||||
|
@ -15,6 +15,7 @@
|
||||
var bParam_new = {{$nouveau}};
|
||||
var bParam_page = {{$page}};
|
||||
var bParam_wall = {{$wall}};
|
||||
var bParam_list = {{$list}};
|
||||
|
||||
var bParam_search = "{{$search}}";
|
||||
var bParam_order = "{{$order}}";
|
||||
@ -38,6 +39,7 @@
|
||||
if(bParam_spam != 0) bCmd = bCmd + "&spam=" + bParam_spam;
|
||||
if(bParam_new != 0) bCmd = bCmd + "&new=" + bParam_new;
|
||||
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_order != "") bCmd = bCmd + "&order=" + bParam_order;
|
||||
if(bParam_file != "") bCmd = bCmd + "&file=" + bParam_file;
|
||||
|
Reference in New Issue
Block a user