. require_once('../../../lib/moodlelib.php'); class MoodleParamsProvider implements com_wiris_plugin_api_ParamsProvider { private $parameters = array(); private $serviceparamlist = array('mml', 'lang', 'service', 'latex'); private $wrap; public function __construct() { $this->wrap = com_wiris_system_CallWrapper::getInstance(); } public function getrequiredparameter($paramname) { $this->wrap->stop(); $param = required_param($paramname, PARAM_RAW); $this->wrap->start(); return $param; } public function getparameter($paramname, $dflt) { $this->wrap->stop(); $param = optional_param($paramname, $dflt, PARAM_RAW); $this->wrap->start(); return $param; } public function getparameters() { return $this->parameters; } public function getserviceparameters() { $this->wrap->stop(); $serviceparams = array(); foreach ($this->serviceparamlist as $key) { if ($serviceparam = optional_param($key, false, PARAM_RAW)) { $serviceparams[$key] = $serviceparam; } } $this->wrap->start(); return $serviceparams; } public function getrenderparameters($configuration) { $this->wrap->stop(); $renderparams = array(); // Can't change EDITOR_PARAMETER_LIST variable name so at this point condingStandars should be disabled. // @codingStandardsIgnoreStart $renderparameterlist = explode(",", $configuration->getProperty(com_wiris_plugin_api_ConfigurationKeys::$EDITOR_PARAMETERS_LIST, com_wiris_plugin_api_ConfigurationKeys::$EDITOR_PARAMETERS_DEFAULT_LIST)); // @codingStandardsIgnoreEnd $i = null; foreach ($renderparameterlist as $key) { if ($renderparam = optional_param($key, false, PARAM_RAW)) { $renderparams[$key] = $renderparam; } } $this->wrap->start(); return $renderparams; } }