/**
* @param $row
* @param $href
* @param $label
* @param $title
* @param $icon
* @param $attributes
* @return string
*/
public function toggleIcon($row, $href, $label, $title, $icon, $attributes)
{
if (strlen(Input::get('tid'))) {
$this->toggleVisibility(Input::get('tid'), Input::get('state') == 1, @func_get_arg(12) ?: null);
$this->redirect($this->getReferer());
}
// Check permissions AFTER checking the tid, so hacking attempts are logged
if (!$this->User->hasAccess('tl_api_client::disable', 'alexf')) {
return '';
}
$href .= '&tid=' . $row['id'] . '&state=' . $row['disable'];
if ($row['disable']) {
$icon = 'invisible.gif';
}
return '<a href="' . $this->addToUrl($href) . '" title="' . specialchars($title) . '"' . $attributes . '>' . Image::getHtml($icon, $label, 'data-state="' . ($row['disable'] ? 0 : 1) . '"') . '</a> ';
}