set className of items in timeline

This commit is contained in:
Uwe Steinmann 2015-09-23 14:12:07 +02:00
parent 2d9d2b7113
commit 06691a7d6f

View File

@ -2017,7 +2017,7 @@ mayscript>
* *
* @param object $document document * @param object $document document
*/ */
protected function printTimeline($timeline, $height=300, $start='', $end='') { /* {{{ */ protected function printTimeline($timeline, $height=300, $start='', $end='', $skip=array()) { /* {{{ */
if(!$timeline) if(!$timeline)
return; return;
?> ?>
@ -2028,7 +2028,12 @@ mayscript>
data = [ data = [
<?php <?php
foreach($timeline as $item) { foreach($timeline as $item) {
echo "{'start': new Date('".$item['date']."'), 'content': '".$item['msg']."'},\n"; if($item['type'] == 'status_change')
$classname = $item['type']."_".$item['status'];
else
$classname = $item['type'];
if(!$skip || !in_array($classname, $skip))
echo "{'start': new Date('".$item['date']."'), 'content': '".$item['msg']."', 'className': '".$classname."'},\n";
} }
?> ?>
/* { /* {