tl_form_field::toggleIcon PHP Метод

toggleIcon() публичный Метод

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
Результат 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());
        }
        $href .= '&tid=' . $row['id'] . '&state=' . $row['invisible'];
        if ($row['invisible']) {
            $icon = 'invisible.svg';
        }
        return '<a href="' . $this->addToUrl($href) . '" title="' . StringUtil::specialchars($title) . '"' . $attributes . '>' . Image::getHtml($icon, $label, 'data-state="' . ($row['invisible'] ? 0 : 1) . '"') . '</a> ';
    }

Usage Example

Пример #1
0
 public function toggleIcons($arrRow, $href, $label, $title, $icon, $attributes, $strTable, $arrRootIds, $arrChildRecordIds, $blnCircularReference, $strPrevious, $strNext)
 {
     if ($arrRow['type'] != 'formcolpart' && $arrRow['type'] != 'formcolend') {
         return parent::toggleIcon($arrRow, $href, $label, $title, $icon, $attributes);
     }
 }