editorPluginJs ) { try { $pluginJs = File::get( 'core_Theme', Store::i()->editorPluginJs )->contents(); } catch ( Exception ) {} } } } else { foreach( Application::enabledApplications() as $app ) { $path = Application::getRootPath( $app->directory ) . "/applications/" . $app->directory . "/dev/editor"; if( file_exists( $path ) ) { foreach( new DirectoryIterator( $path ) as $file ) { if( !$file->isDir() and !$file->isDot() and $file->getFilename() != 'js' ) { $components = explode( '.', $file->getFilename() ); $extension = array_pop( $components ); if( $extension == 'js' ) { $contents = file_get_contents( $path . "/" . $file->getFilename() ); $module = "/applications/" . $app->directory . "/dev/editor/" . $file->getFilename(); $pluginJs .= << { "use strict"; /** * @module {$module} */ try { {$contents} } catch (e) { window.Debug?.error(e) } })()) js; } } } } } /* This tells the editor that the file is done processing */ $pluginJs .= <<sendOutput( $pluginJs, "200", "text/javascript" );