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:
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user