Pivot thread changed slightly

- There is a reset button in the first arrow

- adding an event that exists already in the list should not create a new pivot point
pull/217/head
iglocska 2013-08-02 15:23:48 +02:00
parent bfa8aa3d28
commit fa1af3cd3b
2 changed files with 14 additions and 8 deletions

View File

@ -242,6 +242,9 @@ class EventsController extends AppController {
private function __continuePivoting($id, $info, $date){
$pivot = $this->Session->read('pivot_thread');
foreach ($pivot as $k => $v) {
if ($v[0] == $id) return;
}
$pivot[] = array($id, $info, $date);
$this->Session->write('pivot_thread', $pivot);
}

View File

@ -139,18 +139,21 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
<?php if (sizeOf($allPivots) > 1): ?>
<div>
<h3>Pivot Thread</h3>
<div class="arrow_box">
<?php
echo $this->Html->link('Reset thread', array('controller' => 'events', 'action' => 'view', $event['Event']['id']));
?>
</div>
<?php
foreach ($allPivots as $k => $v) {
?>
<div class="arrow_box">
?>
<div class="arrow_box">
<span title="<?php echo h($v[1]); ?>">
<?php echo $this->Html->link(h($v[2]) . ' (' . h($v[0]) . ')', array('controller' => 'events', 'action' => 'view', $v[0], true, true));?>
<?php echo $this->Html->link(h($v[2]) . ' (' . h($v[0]) . ')', array('controller' => 'events', 'action' => 'view', $v[0], true, true));?>
</span>
</div>
<?php
}
</div>
<?php
}
?>
</div>
<?php endif; ?>