public function setMassActionCheckboxes($column, $value, array $excludedValues = null, array $checkedValues = null)
{
// build label and value
$label = '<input type="checkbox" name="toggleChecks" value="toggleChecks" />';
$value = '<input type="checkbox" name="id[]" value="' . $value . '" class="inputCheckbox" />';
// add the column
$this->addColumn($column, $label, $value);
// set as first column
$this->setColumnsSequence($column);
// excluded IDs found
if (!empty($excludedValues)) {
// fetch the datagrid attributes
$attributes = $this->getAttributes();
// set if needed
if (!isset($attributes['id'])) {
$this->setAttributes(array('id' => 'table_' . time()));
}
// fetch the datagrid attributes
$attributes = $this->getAttributes();
// build array
$excludedData['id'] = $attributes['id'];
$excludedData['JSON'] = json_encode($excludedValues);
// assign the stack to the datagrid template
$this->tpl->assign('excludedCheckboxesData', $excludedData);
}
// checked IDs found
if (!empty($checkedValues)) {
// fetch the datagrid attributes
$attributes = $this->getAttributes();
// set if needed
if (!isset($attributes['id'])) {
$this->setAttributes(array('id' => 'table_' . time()));
}
// fetch the datagrid attributes
$attributes = $this->getAttributes();
// build array
$checkedData['id'] = $attributes['id'];
$checkedData['JSON'] = json_encode($checkedValues);
// assign the stack to the datagrid template
$this->tpl->assign('checkedCheckboxesData', $checkedData);
}
}