$module) { if (!empty($module['hidden'])) continue; $groups[$module['group']][$key] = $module['title']; } return $groups; } /** * page_admin_access (a flat list of owner account names) and page_admin_roles * (account name => list of granted module keys) are two separate config * arrays, but the panel edits them as one table: an "Owner" checkbox plus one * checkbox per module. Owner wins if an account somehow ended up in both. */ function acp_permissions_current(): array { global $config; $accessStored = setting('config:page_admin_access', null); $access = $accessStored !== null ? (json_decode($accessStored, true) ?: array()) : (array)znote_config_path($config, 'page_admin_access', array()); $rolesStored = setting('config:page_admin_roles', null); $roles = $rolesStored !== null ? (json_decode($rolesStored, true) ?: array()) : (array)znote_config_path($config, 'page_admin_roles', array()); $rows = array(); foreach ($access as $name) { $name = trim((string)$name); if ($name === '') continue; $rows[$name] = array('account' => $name, 'owner' => true, 'modules' => array()); } foreach ($roles as $name => $assigned) { $name = trim((string)$name); if ($name === '' || isset($rows[$name])) continue; $rows[$name] = array('account' => $name, 'owner' => false, 'modules' => array_values((array)$assigned)); } return array_values($rows); } /** One account's editable block: name + Owner toggle + a module checklist grouped like the sidebar. */ function acp_render_permission_account(string $key, $rowIndex, array $row, array $moduleGroups): string { $prefix = 'set[' . $key . '][rows][' . $rowIndex . ']'; $html = '
znote_config']));
} else {
acp_flash_success(t('acp.settings.save_success', ['n' => $saved]));
}
acp_redirect('settings');
}
$schema = acp_settings_schema();
$hasTable = znote_table_exists('znote_config');
$cacheStats = znote_cache_stats();
$cacheSize = $cacheStats['bytes'] >= 1048576
? number_format($cacheStats['bytes'] / 1048576, 1) . ' MB'
: number_format($cacheStats['bytes'] / 1024, 1) . ' KB';
?>
znote_config',
'file' => 'SQL/migrations/2.0.0_znote_config.sql',
]) ?>
config.php',
'configphp2' => 'config.php',
]) ?>
= h($cacheStats['prefix']) ?>