HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/itpartnership.net (cms)/modules/MenuManager/action.setcachable.php
<?php
if( !isset($gCms) ) return;

if( !isset($params['template']) || !isset($params['state']) )
  {
    return;
  }

$tpl = trim($params['template']);
$state = (int)$params['state'];

$cachables = array();
{
  $tmp = base64_decode($this->GetPreference('cachable_templates'));
  if( $tmp )
    {
      $cachables = unserialize($tmp);
    }
}

if( $state )
  {
    if( !in_array($tpl,$cachables) )
      {
	$cachables[] = $tpl;
      }
  }
else
  {
    if( in_array($tpl,$cachables) )
      {
	$tmp = array();
	foreach( $cachables as $one )
	  {
	    if( $one != $tpl ) $tmp[] = $one;
	  }
	$cachables = $tmp;
      }
  }

$tmp = serialize($cachables);
$this->SetPreference('cachable_templates',base64_encode($tmp));

$this->Redirect($id,'defaultadmin');

?>