Skip to content

Commit

Permalink
Use a custom toggle parameter for content elements (see contao/core-b…
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 11, 2018
1 parent ec48fcf commit 60b3cc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Resources/contao/dca/tl_content.php
Expand Up @@ -192,26 +192,26 @@ public function generateFeed()
*/
public function toggleIcon($row, $href, $label, $title, $icon, $attributes)
{
if (\strlen(Input::get('tid')))
if (\strlen(Input::get('cid')))
{
$this->toggleVisibility(Input::get('tid'), (Input::get('state') == 1), (@func_get_arg(12) ?: null));
$this->toggleVisibility(Input::get('cid'), (Input::get('state') == 1), (@func_get_arg(12) ?: null));
$this->redirect($this->getReferer());
}

// Check permissions AFTER checking the tid, so hacking attempts are logged
// Check permissions AFTER checking the cid, so hacking attempts are logged
if (!$this->User->hasAccess('tl_content::invisible', 'alexf'))
{
return '';
}

$href .= '&id='.Input::get('id').'&tid='.$row['id'].'&state='.$row['invisible'];
$href .= '&id='.Input::get('id').'&cid='.$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> ';
return '<a href="'.$this->addToUrl($href).'" title="'.StringUtil::specialchars($title).'" data-tid="cid"'.$attributes.'>'.Image::getHtml($icon, $label, 'data-state="' . ($row['invisible'] ? 0 : 1) . '"').'</a> ';
}


Expand Down

0 comments on commit 60b3cc1

Please sign in to comment.