public function addColumn($name, $label = null, $value = null, $url = null, $title = null, $image = null, $sequence = null)
{
// make sure we use a lowercased column in all checks
$lowercasedName = mb_strtolower($name);
$icon = $this->decideIcon($name);
// known actions that should have a button
if (in_array($lowercasedName, array('add', 'edit', 'delete', 'detail', 'details', 'approve', 'mark_as_spam', 'install'))) {
// rebuild value, it should have special markup
$value = '<a href="' . $url . '" class="btn btn-default btn-xs pull-right">' . ($icon ? '<span class="fa ' . $icon . '"></span> ' : '') . $value . '</a>';
// reset URL
$url = null;
}
if (in_array($lowercasedName, array('use_revision', 'use_draft'))) {
// rebuild value, it should have special markup
$value = '<a href="' . $url . '" class="btn btn-default btn-xs">' . ($icon ? '<span class="fa ' . $icon . '"></span> ' : '') . $value . '</a>';
// reset URL
$url = null;
}
// add the column
parent::addColumn($name, $label, $value, $url, $title, $image, $sequence);
// known actions
if (in_array($lowercasedName, array('add', 'edit', 'delete', 'detail', 'details', 'approve', 'mark_as_spam', 'install', 'use_revision', 'use_draft'))) {
// add special attributes for actions we know
$this->setColumnAttributes($name, array('class' => 'fork-data-grid-action action' . \SpoonFilter::toCamelCase($name)));
}
// set header attributes
$this->setColumnHeaderAttributes($name, array('class' => $name));
}