HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/martyknows.com/wp-content/plugins/enlighter/modules/editor/EditorConfig.php
<?php

namespace Enlighter\editor;

class EditorConfig{

    // plugin/editor config
    private $_config;

    private $_enlighterjs;

    // theme manager (build in + user themes)
    protected $_themeManager;

    // language manager (build-in)
    protected $_languageManager;
    
    public function __construct($config, $ejs, $languageManager, $themeManager){
        $this->_config = $config;
        $this->_enlighterjs = $ejs;

        // store language keys
        $this->_languageManager = $languageManager;

        // local theme manager instance (required for external themes)
        $this->_themeManager = $themeManager;
    }

    public function getEditorConfigCode(){
        // filtered languages 
        $languages = apply_filters('enlighter_editor_languages', $this->_languageManager->getLanguages());

        // filtered themes 
        $themes = apply_filters('enlighter_editor_themes', $this->_themeManager->getThemes());

        // retrieve enlighterjs default config
        $enlighterjsConfig = $this->_enlighterjs->getConfig();
        
        // create config object
        $config = array(
            'languages' => $languages,
            'themes' => $themes,
            'config' => $enlighterjsConfig['options'],
            'tinymce' => array(
                'tabIndentation' => $this->_config['tinymce-tabindentation'],
                'keyboardShortcuts' => $this->_config['tinymce-keyboardshortcuts']
            ),
            'text' => array(
                'quicktags' => $this->_config['quicktag-mode']
            )
        );
        
        // apply config
        $config = apply_filters('enlighter_editor_config', $config);

        // create config object
        return 'EnlighterJS_EditorConfig = ' . json_encode($config) . ';';
    }
}