HEX
Server: nginx/1.27.0
System: Linux 20d173156d2c 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/content-egg/application/components/ModuleConfig.php
<?php

namespace ContentEgg\application\components;

defined('\ABSPATH') || exit;

use ContentEgg\application\Plugin;
use ContentEgg\application\admin\PluginAdmin;

/**
 * ModuleConfig abstract class file
 *
 * @author keywordrush.com <support@keywordrush.com>
 * @link https://www.keywordrush.com
 * @copyright Copyright &copy; 2025 keywordrush.com
 */
abstract class ModuleConfig extends Config
{

	protected $module_id;

	protected function __construct($module_id = null)
	{
		if ($module_id)
		{
			$this->module_id = $module_id;
		}
		else
		{
			$parts = explode('\\', get_class($this));
			$this->module_id = $parts[count($parts) - 2];
		}
		parent::__construct();
	}

	public function getModuleId()
	{
		return $this->module_id;
	}

	public function getModuleName()
	{
		return $this->getModuleInstance()->getName();
	}

	public function getModuleInstance()
	{
		return ModuleManager::factory($this->getModuleId());
	}

	public function page_slug()
	{
		return 'content-egg-modules--' . $this->getModuleId();
	}

	public function option_name()
	{
		return Plugin::slug() . '_' . $this->getModuleId();
	}

	public function add_admin_menu()
	{
		\add_submenu_page('options.php', $this->getModuleName() . ' ' . __('settings', 'content-egg') . ' &lsaquo; Content Egg', '', 'manage_options', $this->page_slug(), array(
			$this,
			'settings_page'
		));
	}

	public function settings_page()
	{
		\wp_enqueue_style('cegg-bootstrap5-full');
		PluginAdmin::render('module_settings', array('module' => $this->getModuleInstance(), 'config' => $this));
	}

	public function options()
	{
		return array();
	}
}