tl_member::toggleIcon PHP Method

toggleIcon() public method

Return the "toggle visibility" button
public toggleIcon ( array $row, string $href, string $label, string $title, string $icon, string $attributes ) : string
$row array
$href string
$label string
$title string
$icon string
$attributes string
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_member::disable', 'alexf')) {
            return '';
        }
        $href .= '&tid=' . $row['id'] . '&state=' . $row['disable'];
        if ($row['disable']) {
            $icon = 'invisible.svg';
        }
        return '<a href="' . $this->addToUrl($href) . '" title="' . StringUtil::specialchars($title) . '"' . $attributes . '>' . Image::getHtml($icon, $label, 'data-state="' . ($row['disable'] ? 0 : 1) . '"') . '</a> ';
    }