$87 GRAYBYTE WORDPRESS FILE MANAGER $47

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.kemberinc.com/wp-content/plugins/admin-menu-editor-pro/includes/

HOME
Current File : /home/bqrcodec/contact.kemberinc.com/wp-content/plugins/admin-menu-editor-pro/includes//module.php
<?php

abstract class ameModule {
	protected $tabSlug = '';
	protected $tabTitle = '';
	protected $tabOrder = 10;

	protected $moduleId = '';
	protected $moduleDir = '';

	protected $settingsFormAction = '';

	/**
	 * @var WPMenuEditor
	 */
	protected $menuEditor;

	public function __construct($menuEditor) {
		$this->menuEditor = $menuEditor;

		if ( class_exists('ReflectionClass', false) ) {
			//This should never throw an exception since the current class must exist for this constructor to be run.
			$reflector = new ReflectionClass(get_class($this));
			$this->moduleDir = dirname($reflector->getFileName());
			$this->moduleId = basename($this->moduleDir);
		}

		if ( !$this->isEnabledForRequest() ) {
			return;
		}

		add_action('admin_menu_editor-register_scripts', array($this, 'registerScripts'));

		//Register the module tab.
		if ( ($this->tabSlug !== '') && is_string($this->tabSlug) ) {
			add_action('admin_menu_editor-tabs', array($this, 'addTab'), $this->tabOrder);
			add_action('admin_menu_editor-section-' . $this->tabSlug, array($this, 'displaySettingsPage'));

			add_action('admin_menu_editor-enqueue_scripts-' . $this->tabSlug, array($this, 'enqueueTabScripts'));
			add_action('admin_menu_editor-enqueue_styles-' . $this->tabSlug, array($this, 'enqueueTabStyles'));

			//Optionally, handle settings form submission.
			if ( $this->settingsFormAction !== '' ) {
				add_action(
					'admin_menu_editor-page_action-' . $this->settingsFormAction,
					array($this, '_processAction')
				);
			}
		}
	}

	/**
	 * Does this module need to do anything for the current request?
	 *
	 * For example, some modules work in the normal dashboard but not in the network admin.
	 * Other modules don't need to run during AJAX requests or when WP is running Cron jobs.
	 */
	protected function isEnabledForRequest() {
		return true;
	}

	public function addTab($tabs) {
		$tabs[$this->tabSlug] = !empty($this->tabTitle) ? $this->tabTitle : $this->tabSlug;
		return $tabs;
	}

	public function displaySettingsPage() {
		$this->menuEditor->display_settings_page_header();

		if ( !$this->outputMainTemplate() ) {
			printf(
				"[ %1\$s : Module \"%2\$s\" doesn't have a primary template. ]",
				esc_html(__METHOD__),
				esc_html($this->moduleId)
			);
		}

		$this->menuEditor->display_settings_page_footer();
	}

	protected function getTabUrl($queryParameters = array()) {
		$queryParameters = array_merge(
			array('sub_section' => $this->tabSlug),
			$queryParameters
		);
		return $this->menuEditor->get_plugin_page_url($queryParameters);
	}

	protected function outputMainTemplate() {
		return $this->outputTemplate($this->moduleId);
	}

	protected function outputTemplate($name) {
		$templateFile = $this->moduleDir . '/' . $name . '-template.php';
		if ( file_exists($templateFile) ) {
			$moduleTabUrl = $this->getTabUrl();

			$templateVariables = $this->getTemplateVariables($name);
			if ( !empty($templateVariables) ) {
				extract($templateVariables, EXTR_SKIP);
			}

			require $templateFile;
			return true;
		}
		return false;
	}

	protected function getTemplateVariables($templateName) {
		//Override this method to pass variables to a template.
		return array();
	}

	public function registerScripts() {
		//Override this method to register scripts.
	}

	public function enqueueTabScripts() {
		//Override this method to add scripts to the $this->tabSlug tab.
	}

	public function enqueueTabStyles() {
		//Override this method to add stylesheets to the $this->tabSlug tab.
	}

	/**
	 * @access private
	 * @param array $post
	 */
	public function _processAction($post = array()) {
		check_admin_referer($this->settingsFormAction);
		$this->handleSettingsForm($post);
	}

	public function handleSettingsForm($post = array()) {
		//Override this method to process a form submitted from the module's tab.
	}

	protected function getScopedOption($name, $defaultValue = null) {
		if ( $this->menuEditor->get_plugin_option('menu_config_scope') === 'site' ) {
			return get_option($name, $defaultValue);
		} else {
			return get_site_option($name, $defaultValue);
		}
	}

	protected function setScopedOption($name, $value, $autoload = null) {
		if ( $this->menuEditor->get_plugin_option('menu_config_scope') === 'site' ) {
			update_option($name, $value, $autoload);
		} else {
			WPMenuEditor::atomic_update_site_option($name, $value);
		}
	}

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

	public function getTabTitle() {
		return $this->tabTitle;
	}
}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
2 Feb 2024 10.20 AM
bqrcodec / bqrcodec
0755
PHP-CSS-Parser
--
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0755
capabilities
--
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0755
.htaccess
0.184 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
AmeAutoloader.php
1.196 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
access-test-runner.php
8.163 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
admin-menu-editor-mu.php
2.107 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
ame-option.php
6.148 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
ame-utils.php
20.168 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
auto-versioning.php
5.086 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
basic-dependencies.php
1.498 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
bbpress-role-override.php
1.806 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
cap-suggestion-box.php
0.406 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
consistency-check.php
3.603 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
editor-page.php
24.301 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
generate-menu-dashicons.php
3.787 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
menu-editor-core.php
188.147 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
menu-item.php
28.385 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
menu.php
18.133 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
module.php
4.396 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
persistent-module.php
1.736 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
reflection-callable.php
2.041 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
role-utils.php
2.314 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
settings-page.php
17.363 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
shadow_plugin_framework.php
12.608 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
shortcodes.php
3.379 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
test-access-screen.php
2.168 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644
version-conflict-check.php
0.8 KB
2 Feb 2024 10.19 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF