# Core Classes

## CodePressCMS.php

Hoofd CMS class in `cms/core/class/CodePressCMS.php`:

```php
$cms = new CodePressCMS($config);
$cms->renderPage($pagePath);
```

Belangrijke methodes: `renderPage()`, `getMenu()`, `getPage()`, `parseMarkdown()`, `generateBreadcrumb()`, `getAvailableLanguages()`.

## ThemeManager.php

Themabeheer in `cms/core/class/ThemeManager.php`:

```php
$themeManager = new ThemeManager($config);
$themeManager->renderTwig($template, $data);
```

Compileert `assets/scss/theme.scss` runtime naar CSS en rendert Twig templates.

## PluginManager.php

Plugin systeem in `cms/core/plugin/PluginManager.php`:

```php
$pluginManager = new PluginManager($pluginsPath, $enabledPlugins);
$pluginManager->setAPI($api);
$pluginManager->doAction('onPageLoad', $args);
$result = $pluginManager->applyFilters('onContentFilter', $content);
$pluginManager->getAdminMenuItems();
```

Belangrijke methodes: `setAPI()`, `doAction()`, `applyFilters()`, `getPlugin()`, `getAllPlugins()`, `getEnabledPlugins()`, `isEnabled()`, `getSidebarContent()`, `getPluginCssUrls()`, `getAdminMenuItems()`, `dispatchAdminRoute()`, `resolveAdminRoute()`.

## CMSAPI.php

Front-end API voor plugins in `cms/core/plugin/CMSAPI.php`. Implementeert `PluginAPIInterface`. Biedt toegang tot de CMS instance voor plugins in de front-end context.

```php
$api->getCurrentPageTitle();
$api->getMenu();
$api->getConfig('site_title');
$api->createUrl('over-ons');
```

## AdminPluginAPI.php

Admin API voor plugins in `cms/core/plugin/AdminPluginAPI.php`. Implementeert `PluginAPIInterface`. Light-weight wrapper met alleen config-toegang (geen CMS instance nodig).

```php
$api->getConfig('analytics.enabled');
$api->getContentDir();
$api->getEnabledPlugins();
```

## AdminAuth.php

Authenticatie in `admin/src/AdminAuth.php`. Beheert sessies, bcrypt wachtwoorden, CSRF tokens, brute-force lockout en role-based permissions.

## LogManager.php

Logging systeem in `cms/core/class/LogManager.php`. Ondersteunt SQLite, syslog en file-based logging. Events: admin, requests, errors, security, content, system.