One Hat Cyber Team
Your IP :
216.73.216.216
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
vo
/
umj
/
mathJax
/
View File Name :
MathJaxPlugin.inc.php
<?php /** * @file plugins/generic/mathjax/MathJaxPlugin.inc.php * * Copyright (c) 2017 Vasyl Ostrovskyi * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. * * @class MathJaxPlugin * @ingroup plugins_generic_mathjax * * @brief Plugin to allow MathJax scripts to be added to OJS */ // $Id$ import('lib.pkp.classes.plugins.GenericPlugin'); class MathJaxPlugin extends GenericPlugin { /** * Register the plugin, if enabled; note that this plugin * @param $category string * @param $path string * @return boolean */ function register($category, $path, $mainContextId = NULL) { if (parent::register($category, $path, $mainContextId)) { if ($this->getEnabled($mainContextId)) { HookRegistry::register('TemplateManager::display', array(&$this, 'insertMJ')); } return true; } return false; } /** * Hook callback function for TemplateManager::display * @param $hookName string * @param $args array * @return boolean */ function insertMJ($hookName, $args) { $templateManager =& $args[0]; $mathJaxConfig = "<script type=\"text/x-mathjax-config\">\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [['$','$'], ['\\\\(','\\\\)']]},\n processEscapes: true\n }); \n</script>\n"; $mathJaxURL = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML"; $templateManager->addJavaScript('mathjax', $mathJaxURL, array( 'contexts' => array('frontend', 'backend') ) ); $templateManager->addHeader('math', $mathJaxConfig, array('contexts' => array('frontend', 'backend'))); return false; } /** * Get the display name of this plugin * @return string */ function getDisplayName() { return __('plugins.generic.mathjax.name'); } /** * Get the description of this plugin * @return string */ function getDescription() { return __('plugins.generic.mathjax.description'); } } ?>