public function createImage($mml, $param, &$output) { $output = $output; if ($mml === null) { throw new HException("Missing parameter 'mml'."); } $digest = $this->computeDigest($mml, $param); $contextPath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$CONTEXT_PATH, "/"); $showImagePath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SHOWIMAGE_PATH, null); $s = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "metrics", "false") === "true") { $s = $this->getMetrics($digest, $output); } $a = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "accessible", "false") === "true") { $lang = com_wiris_system_PropertiesTools::getProperty($param, "lang", "en"); $text = $this->safeMath2Accessible($mml, $lang, $param); if ($output === null) { $a = "&text=" . rawurlencode($text); } else { $output["alt"] = $text; } } $rparam = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "refererquery", null) !== null) { $refererquery = com_wiris_system_PropertiesTools::getProperty($param, "refererquery", null); $rparam = "&refererquery=" . $refererquery; } return com_wiris_plugin_impl_RenderImpl::concatPath($contextPath, $showImagePath) . rawurlencode($digest) . $s . $a . $rparam; }
public function __construct($plugin) { if (!php_Boot::$skip_constructor) { parent::__construct($plugin); } }
public function step3() { $contextPath = $this->render->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$CONTEXT_PATH, "/"); $showImagePath = $this->render->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SHOWIMAGE_PATH, null); $this->call->returnString(com_wiris_plugin_impl_RenderImpl::concatPath($contextPath, $showImagePath) . rawurlencode($this->digest) . $this->metrics . $this->accessibility); }
public function createImage($mml, $param, &$output) { $output = $output; if ($mml === null) { throw new HException("Missing parameter 'mml'."); } $digest = $this->computeDigest($mml, $param); $contextPath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$CONTEXT_PATH, "/"); $showImagePath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SHOWIMAGE_PATH, null); $saveMode = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SAVE_MODE, "xml"); $s = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "metrics", "false") === "true") { $s = $this->getMetrics($digest, $output); } $a = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "accessible", "false") === "true") { $lang = com_wiris_system_PropertiesTools::getProperty($param, "lang", "en"); $text = $this->safeMath2Accessible($mml, $lang, $param); if ($output === null) { $a = "&text=" . rawurlencode($text); } else { $output["alt"] = $text; } } $rparam = ""; if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "refererquery", null) !== null) { $refererquery = com_wiris_system_PropertiesTools::getProperty($param, "refererquery", null); $rparam = "&refererquery=" . $refererquery; } if ($param !== null && com_wiris_system_PropertiesTools::getProperty($param, "base64", null) !== null || $saveMode === "base64") { $bs = $this->showImage($digest, null, $param); $by = haxe_io_Bytes::ofData($bs); $b64 = _hx_deref(new com_wiris_system_Base64())->encodeBytes($by); return "data:image/png;base64," . $b64->toString(); } else { return com_wiris_plugin_impl_RenderImpl::concatPath($contextPath, $showImagePath) . rawurlencode($digest) . $s . $a . $rparam; } }
public function createCasImage($imageParameter) { $output = ""; $contextPath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$CONTEXT_PATH, "/"); if ($imageParameter !== null) { $dataDecoded = com_wiris_plugin_impl_CasImpl::decodeBase64($imageParameter); $digest = haxe_Md5::encode($imageParameter); $store = $this->plugin->getStorageAndCache(); $store->storeData($digest, "png", $dataDecoded->b); $showImagePath = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SHOWCASIMAGE_PATH, null); $output .= com_wiris_plugin_impl_RenderImpl::concatPath($contextPath, $showImagePath) . rawurlencode($digest . ".png"); } else { $output .= com_wiris_plugin_impl_RenderImpl::concatPath($contextPath, "core/cas.png"); } return $output; }