"wiki", :action => "show", :title => page.title) // end.join(", ") // links.empty? ? "None" : links // } # Generates content for "Changes" column on history page. # Not filtered, must return HTML-safe string. # a is current # b is previous (or what's a compared to) public function page_change($a, $b) { $changes = $a->diff($b); if (!$changes) return 'no change'; else { return implode(', ', array_map(function($change)use($a, $b) { switch ($change) { case 'initial': return 'first version'; case 'body': return 'content update'; case 'title': return "page rename (".$this->h($a->title)." ← ".$this->h($b->title).")"; case 'is_locked': return $a->is_locked ? 'page lock' : 'page unlock'; }; }, $changes)); } } }