本文整理汇总了PHP中ConfService::setLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfService::setLanguage方法的具体用法?PHP ConfService::setLanguage怎么用?PHP ConfService::setLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfService
的用法示例。
在下文中一共展示了ConfService::setLanguage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadInstallerForm
/**
* Transmit to the ajxp_conf load_plugin_manifest action
* @param $action
* @param $httpVars
* @param $fileVars
*/
public function loadInstallerForm($action, $httpVars, $fileVars)
{
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
}
AJXP_XMLWriter::header("admin_data");
$fullManifest = $this->getManifestRawContent("", "xml");
$xPath = new DOMXPath($fullManifest->ownerDocument);
$addParams = "";
$pInstNodes = $xPath->query("server_settings/global_param[contains(@type, 'plugin_instance:')]");
foreach ($pInstNodes as $pInstNode) {
$type = $pInstNode->getAttribute("type");
$instType = str_replace("plugin_instance:", "", $type);
$fieldName = $pInstNode->getAttribute("name");
$pInstNode->setAttribute("type", "group_switch:" . $fieldName);
$typePlugs = AJXP_PluginsService::getInstance()->getPluginsByType($instType);
foreach ($typePlugs as $typePlug) {
if ($typePlug->getId() == "auth.multi") {
continue;
}
$checkErrorMessage = "";
try {
$typePlug->performChecks();
} catch (Exception $e) {
$checkErrorMessage = " (Warning : " . $e->getMessage() . ")";
}
$tParams = AJXP_XMLWriter::replaceAjxpXmlKeywords($typePlug->getManifestRawContent("server_settings/param"));
$addParams .= '<global_param group_switch_name="' . $fieldName . '" name="instance_name" group_switch_label="' . $typePlug->getManifestLabel() . $checkErrorMessage . '" group_switch_value="' . $typePlug->getId() . '" default="' . $typePlug->getId() . '" type="hidden"/>';
$addParams .= str_replace("<param", "<global_param group_switch_name=\"{$fieldName}\" group_switch_label=\"" . $typePlug->getManifestLabel() . $checkErrorMessage . "\" group_switch_value=\"" . $typePlug->getId() . "\" ", $tParams);
$addParams .= AJXP_XMLWriter::replaceAjxpXmlKeywords($typePlug->getManifestRawContent("server_settings/global_param"));
}
}
$uri = $_SERVER["REQUEST_URI"];
if (strpos($uri, '.php') !== false) {
$uri = AJXP_Utils::safeDirname($uri);
}
if (empty($uri)) {
$uri = "/";
}
$loadedValues = array("ENCODING" => defined('AJXP_LOCALE') ? AJXP_LOCALE : SystemTextEncoding::getEncoding(), "SERVER_URI" => $uri);
foreach ($loadedValues as $pName => $pValue) {
$vNodes = $xPath->query("server_settings/global_param[@name='{$pName}']");
if (!$vNodes->length) {
continue;
}
$vNodes->item(0)->setAttribute("default", $pValue);
}
$allParams = AJXP_XMLWriter::replaceAjxpXmlKeywords($fullManifest->ownerDocument->saveXML($fullManifest));
$allParams = str_replace('type="plugin_instance:', 'type="group_switch:', $allParams);
$allParams = str_replace("</server_settings>", $addParams . "</server_settings>", $allParams);
echo $allParams;
AJXP_XMLWriter::close("admin_data");
}
示例2: loadInstallerForm
/**
* Transmit to the ajxp_conf load_plugin_manifest action
* @param $action
* @param $httpVars
* @param $fileVars
*/
public function loadInstallerForm($action, $httpVars, $fileVars)
{
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
}
AJXP_XMLWriter::header("admin_data");
$fullManifest = $this->getManifestRawContent("", "xml");
$xPath = new DOMXPath($fullManifest->ownerDocument);
$addParams = "";
$pInstNodes = $xPath->query("server_settings/global_param[contains(@type, 'plugin_instance:')]");
foreach ($pInstNodes as $pInstNode) {
$type = $pInstNode->getAttribute("type");
$instType = str_replace("plugin_instance:", "", $type);
$fieldName = $pInstNode->getAttribute("name");
$pInstNode->setAttribute("type", "group_switch:" . $fieldName);
$typePlugs = AJXP_PluginsService::getInstance()->getPluginsByType($instType);
foreach ($typePlugs as $typePlug) {
if ($typePlug->getId() == "auth.multi") {
continue;
}
$checkErrorMessage = "";
try {
$typePlug->performChecks();
} catch (Exception $e) {
$checkErrorMessage = " (Warning : " . $e->getMessage() . ")";
}
$tParams = AJXP_XMLWriter::replaceAjxpXmlKeywords($typePlug->getManifestRawContent("server_settings/param"));
$addParams .= '<global_param group_switch_name="' . $fieldName . '" name="instance_name" group_switch_label="' . $typePlug->getManifestLabel() . $checkErrorMessage . '" group_switch_value="' . $typePlug->getId() . '" default="' . $typePlug->getId() . '" type="hidden"/>';
$addParams .= str_replace("<param", "<global_param group_switch_name=\"{$fieldName}\" group_switch_label=\"" . $typePlug->getManifestLabel() . $checkErrorMessage . "\" group_switch_value=\"" . $typePlug->getId() . "\" ", $tParams);
$addParams .= AJXP_XMLWriter::replaceAjxpXmlKeywords($typePlug->getManifestRawContent("server_settings/global_param"));
}
}
$allParams = AJXP_XMLWriter::replaceAjxpXmlKeywords($fullManifest->ownerDocument->saveXML($fullManifest));
$allParams = str_replace('type="plugin_instance:', 'type="group_switch:', $allParams);
$allParams = str_replace("</server_settings>", $addParams . "</server_settings>", $allParams);
echo $allParams;
AJXP_XMLWriter::close("admin_data");
}
示例3: loadInstallerForm
/**
* Transmit to the ajxp_conf load_plugin_manifest action
* @param $action
* @param $httpVars
* @param $fileVars
*/
public function loadInstallerForm($action, $httpVars, $fileVars)
{
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
}
$fullManifest = $this->getManifestRawContent("", "xml");
$this->printFormFromServerSettings($fullManifest);
}
示例4: switchAction
function switchAction($action, $httpVars, $fileVars)
{
if (!isset($this->actions[$action])) {
return;
}
if (preg_match('/MSIE 7/', $_SERVER['HTTP_USER_AGENT']) || preg_match('/MSIE 8/', $_SERVER['HTTP_USER_AGENT'])) {
// Force legacy theme for the moment
$this->pluginConf["GUI_THEME"] = "oxygen";
}
if (!defined("AJXP_THEME_FOLDER")) {
define("CLIENT_RESOURCES_FOLDER", AJXP_PLUGINS_FOLDER . "/gui.ajax/res");
define("AJXP_THEME_FOLDER", CLIENT_RESOURCES_FOLDER . "/themes/" . $this->pluginConf["GUI_THEME"]);
}
foreach ($httpVars as $getName => $getValue) {
${$getName} = AJXP_Utils::securePath($getValue);
}
if (isset($dir) && $action != "upload") {
$dir = SystemTextEncoding::fromUTF8($dir);
}
$mess = ConfService::getMessages();
switch ($action) {
//------------------------------------
// GET AN HTML TEMPLATE
//------------------------------------
case "get_template":
HTMLWriter::charsetHeader();
$folder = CLIENT_RESOURCES_FOLDER . "/html";
if (isset($httpVars["pluginName"])) {
$folder = AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/" . AJXP_Utils::securePath($httpVars["pluginName"]);
if (isset($httpVars["pluginPath"])) {
$folder .= "/" . AJXP_Utils::securePath($httpVars["pluginPath"]);
}
}
$crtTheme = $this->pluginConf["GUI_THEME"];
$thFolder = AJXP_THEME_FOLDER . "/html";
if (isset($template_name)) {
if (is_file($thFolder . "/" . $template_name)) {
include $thFolder . "/" . $template_name;
} else {
if (is_file($folder . "/" . $template_name)) {
include $folder . "/" . $template_name;
}
}
}
break;
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
case "get_i18n_messages":
$refresh = false;
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
$refresh = true;
}
HTMLWriter::charsetHeader('text/javascript');
HTMLWriter::writeI18nMessagesClass(ConfService::getMessages($refresh));
break;
//------------------------------------
// SEND XML REGISTRY
//------------------------------------
//------------------------------------
// SEND XML REGISTRY
//------------------------------------
case "get_xml_registry":
$regDoc = AJXP_PluginsService::getXmlRegistry();
$changes = AJXP_Controller::filterActionsRegistry($regDoc);
if ($changes) {
AJXP_PluginsService::updateXmlRegistry($regDoc);
}
if (isset($_GET["xPath"])) {
$regPath = new DOMXPath($regDoc);
$nodes = $regPath->query($_GET["xPath"]);
AJXP_XMLWriter::header("ajxp_registry_part", array("xPath" => $_GET["xPath"]));
if ($nodes->length) {
print AJXP_XMLWriter::replaceAjxpXmlKeywords($regDoc->saveXML($nodes->item(0)));
}
AJXP_XMLWriter::close("ajxp_registry_part");
} else {
AJXP_Utils::safeIniSet("zlib.output_compression", "4096");
header('Content-Type: application/xml; charset=UTF-8');
print AJXP_XMLWriter::replaceAjxpXmlKeywords($regDoc->saveXML());
}
break;
//------------------------------------
// DISPLAY DOC
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
HTMLWriter::charsetHeader();
echo HTMLWriter::getDocFile(AJXP_Utils::securePath(htmlentities($_GET["doc_file"])));
break;
//------------------------------------
// GET BOOT GUI
//------------------------------------
//------------------------------------
//.........这里部分代码省略.........
示例5: isset
$res = ConfService::switchUserToActiveRepository($loggedUser, isset($httpVars["tmp_repository_id"]) ? $httpVars["tmp_repository_id"] : "-1");
if (!$res) {
AuthService::disconnect();
$requireAuth = true;
}
}
} else {
AJXP_Logger::debug(ConfService::getCurrentRepositoryId());
}
//Set language
$loggedUser = AuthService::getLoggedUser();
if ($loggedUser != null && $loggedUser->getPref("lang") != "") {
ConfService::setLanguage($loggedUser->getPref("lang"));
} else {
if (isset($_COOKIE["AJXP_lang"])) {
ConfService::setLanguage($_COOKIE["AJXP_lang"]);
}
}
//------------------------------------------------------------
// SPECIAL HANDLING FOR FANCY UPLOADER RIGHTS FOR THIS ACTION
//------------------------------------------------------------
if (AuthService::usersEnabled()) {
$loggedUser = AuthService::getLoggedUser();
if ($action == "upload" && ($loggedUser == null || !$loggedUser->canWrite(ConfService::getCurrentRepositoryId() . "")) && isset($_FILES['Filedata'])) {
header('HTTP/1.0 ' . '410 Not authorized');
die('Error 410 Not authorized!');
}
}
// THIS FIRST DRIVERS DO NOT NEED ID CHECK
//$ajxpDriver = AJXP_PluginsService::findPlugin("gui", "ajax");
$authDriver = ConfService::getAuthDriverImpl();
示例6: render
/**
* @param array $data
* @param array $options
* @param ShareStore $shareStore
*/
public static function render($data, $options, $shareStore)
{
if (isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true) {
self::renderError($data, "false");
return;
}
// create driver from $data
$className = $data["DRIVER"] . "AccessDriver";
$u = parse_url($_SERVER["REQUEST_URI"]);
$shortHash = pathinfo(basename($u["path"]), PATHINFO_FILENAME);
// Load language messages
$language = ConfService::getLanguage();
if (isset($_GET["lang"])) {
$language = basename($_GET["lang"]);
}
$messages = array();
if (is_file(dirname(__FILE__) . "/res/i18n/" . $language . ".php")) {
include dirname(__FILE__) . "/res/i18n/" . $language . ".php";
} else {
include dirname(__FILE__) . "/res/i18n/en.php";
}
if (isset($mess)) {
$messages = $mess;
}
$AJXP_LINK_HAS_PASSWORD = false;
$AJXP_LINK_BASENAME = SystemTextEncoding::toUTF8(basename($data["FILE_PATH"]));
AJXP_PluginsService::getInstance()->initActivePlugins();
ConfService::setLanguage($language);
$mess = ConfService::getMessages();
if ($shareStore->isShareExpired($shortHash, $data)) {
self::renderError(array(), $shortHash, $mess["share_center.165"]);
return;
}
$customs = array("title", "legend", "legend_pass", "background_attributes_1", "text_color", "background_color", "textshadow_color");
$images = array("button", "background_1");
$confs = $options;
$confs["CUSTOM_SHAREPAGE_BACKGROUND_ATTRIBUTES_1"] = "background-repeat:repeat;background-position:50% 50%;";
$confs["CUSTOM_SHAREPAGE_BACKGROUND_1"] = "plugins/action.share/res/hi-res/02.jpg";
$confs["CUSTOM_SHAREPAGE_TEXT_COLOR"] = "#ffffff";
$confs["CUSTOM_SHAREPAGE_TEXTSHADOW_COLOR"] = "rgba(0,0,0,5)";
foreach ($customs as $custom) {
$varName = "CUSTOM_SHAREPAGE_" . strtoupper($custom);
${$varName} = $confs[$varName];
}
$dlFolder = realpath(ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER"));
foreach ($images as $custom) {
$varName = "CUSTOM_SHAREPAGE_" . strtoupper($custom);
if (!empty($confs[$varName])) {
if (strpos($confs[$varName], "plugins/") === 0 && is_file(AJXP_INSTALL_PATH . "/" . $confs[$varName])) {
$realFile = AJXP_INSTALL_PATH . "/" . $confs[$varName];
copy($realFile, $dlFolder . "/binary-" . basename($realFile));
${$varName} = "binary-" . basename($realFile);
} else {
${$varName} = "binary-" . $confs[$varName];
if (is_file($dlFolder . "/binary-" . $confs[$varName])) {
continue;
}
$copiedImageName = $dlFolder . "/binary-" . $confs[$varName];
$imgFile = fopen($copiedImageName, "wb");
ConfService::getConfStorageImpl()->loadBinary(array(), $confs[$varName], $imgFile);
fclose($imgFile);
}
}
}
HTMLWriter::charsetHeader();
// Check password
if (strlen($data["PASSWORD"])) {
if (!isset($_POST['password']) || $_POST['password'] != $data["PASSWORD"]) {
$AJXP_LINK_HAS_PASSWORD = true;
$AJXP_LINK_WRONG_PASSWORD = isset($_POST['password']) && $_POST['password'] != $data["PASSWORD"];
include AJXP_INSTALL_PATH . "/plugins/action.share/res/public_links.php";
$res = '<div style="position: absolute;z-index: 10000; bottom: 0; right: 0; color: #666;font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size: 13px;text-align: right;padding: 6px; line-height: 20px;text-shadow: 0px 1px 0px white;" class="no_select_bg"><br>Build your own box with Pydio : <a style="color: #000000;" target="_blank" href="http://pyd.io/">http://pyd.io/</a><br/>Community - Free non supported version © C. du Jeu 2008-2014 </div>';
AJXP_Controller::applyHook("tpl.filter_html", array(&$res));
echo $res;
return;
}
} else {
if (!isset($_GET["dl"])) {
include AJXP_INSTALL_PATH . "/plugins/action.share/res/public_links.php";
$res = '<div style="position: absolute;z-index: 10000; bottom: 0; right: 0; color: #666;font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size: 13px;text-align: right;padding: 6px; line-height: 20px;text-shadow: 0px 1px 0px white;" class="no_select_bg"><br>Build your own box with Pydio : <a style="color: #000000;" target="_blank" href="http://pyd.io/">http://pyd.io/</a><br/>Community - Free non supported version © C. du Jeu 2008-2014 </div>';
AJXP_Controller::applyHook("tpl.filter_html", array(&$res));
echo $res;
return;
}
}
$filePath = AJXP_INSTALL_PATH . "/plugins/access." . $data["DRIVER"] . "/class." . $className . ".php";
if (!is_file($filePath)) {
die("Warning, cannot find driver for conf storage! ({$className}, {$filePath})");
}
require_once $filePath;
$driver = new $className($data["PLUGIN_ID"], $data["BASE_DIR"]);
$driver->loadManifest();
//$hash = md5(serialize($data));
$shareStore->incrementDownloadCounter($shortHash);
//AuthService::logUser($data["OWNER_ID"], "", true);
//.........这里部分代码省略.........
示例7: exit
$requireAuth = true;
}
if (isset($loggingResult) || isset($_GET["get_action"]) && $_GET["get_action"] == "logged_user") {
AJXP_XMLWriter::header();
if (isset($loggingResult)) {
AJXP_XMLWriter::loggingResult($loggingResult, $rememberLogin, $rememberPass);
}
AJXP_XMLWriter::sendUserData();
AJXP_XMLWriter::close();
exit(1);
}
}
$loggedUser = AuthService::getLoggedUser();
if ($loggedUser != null) {
if ($loggedUser->getPref("lang") != "") {
ConfService::setLanguage($loggedUser->getPref("lang"));
}
}
$mess = ConfService::getMessages();
foreach ($_GET as $getName => $getValue) {
${$getName} = Utils::securePath($getValue);
}
foreach ($_POST as $getName => $getValue) {
${$getName} = Utils::securePath($getValue);
}
$selection = new UserSelection();
$selection->initFromHttpVars();
if (isset($action) || isset($get_action)) {
$action = isset($get_action) ? $get_action : $action;
} else {
$action = "";
示例8: loadShareByHash
/**
* Loader used by the generic loader.
* @param string $hash
*/
public static function loadShareByHash($hash)
{
AJXP_Logger::debug(__CLASS__, __FUNCTION__, "Do something");
AJXP_PluginsService::getInstance()->initActivePlugins();
if (isset($_GET["lang"])) {
ConfService::setLanguage($_GET["lang"]);
}
$shareCenter = self::getShareCenter();
$data = $shareCenter->getShareStore()->loadShare($hash);
$mess = ConfService::getMessages();
if ($shareCenter->getShareStore()->isShareExpired($hash, $data)) {
AuthService::disconnect();
self::loadMinisite($data, $hash, $mess["share_center.165"]);
return;
}
if (!empty($data) && is_array($data)) {
if (isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true) {
header("HTTP/1.0 401 Not allowed, script was modified");
exit;
}
if ($data["SHARE_TYPE"] == "minisite") {
self::loadMinisite($data, $hash);
} else {
self::loadPubliclet($data);
}
} else {
$setUrl = ConfService::getCoreConf("SERVER_URL");
$data = array();
if (!empty($setUrl)) {
$data["AJXP_APPLICATION_BASE"] = $setUrl;
}
self::loadMinisite($data, $hash, $mess["share_center.166"]);
}
}
示例9: switchAction
public function switchAction($action, $httpVars, $fileVars)
{
if (!defined("AJXP_THEME_FOLDER")) {
define("CLIENT_RESOURCES_FOLDER", AJXP_PLUGINS_FOLDER . "/gui.ajax/res");
define("AJXP_THEME_FOLDER", CLIENT_RESOURCES_FOLDER . "/themes/" . $this->pluginConf["GUI_THEME"]);
}
foreach ($httpVars as $getName => $getValue) {
${$getName} = AJXP_Utils::securePath($getValue);
}
$mess = ConfService::getMessages();
switch ($action) {
//------------------------------------
// GET AN HTML TEMPLATE
//------------------------------------
case "get_template":
HTMLWriter::charsetHeader();
$folder = CLIENT_RESOURCES_FOLDER . "/html";
if (isset($httpVars["pluginName"])) {
$folder = AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/" . AJXP_Utils::securePath($httpVars["pluginName"]);
if (isset($httpVars["pluginPath"])) {
$folder .= "/" . AJXP_Utils::securePath($httpVars["pluginPath"]);
}
}
$thFolder = AJXP_THEME_FOLDER . "/html";
if (isset($template_name)) {
if (is_file($thFolder . "/" . $template_name)) {
include $thFolder . "/" . $template_name;
} else {
if (is_file($folder . "/" . $template_name)) {
include $folder . "/" . $template_name;
}
}
}
break;
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
case "get_i18n_messages":
$refresh = false;
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
$refresh = true;
}
if (isset($httpVars["format"]) && $httpVars["format"] == "json") {
HTMLWriter::charsetHeader("application/json");
echo json_encode(ConfService::getMessages($refresh));
} else {
HTMLWriter::charsetHeader('text/javascript');
HTMLWriter::writeI18nMessagesClass(ConfService::getMessages($refresh));
}
break;
//------------------------------------
// DISPLAY DOC
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
HTMLWriter::charsetHeader();
echo HTMLWriter::getDocFile(AJXP_Utils::securePath(htmlentities($httpVars["doc_file"])));
break;
//------------------------------------
// GET BOOT GUI
//------------------------------------
//------------------------------------
// GET BOOT GUI
//------------------------------------
case "get_boot_gui":
HTMLWriter::internetExplorerMainDocumentHeader();
HTMLWriter::charsetHeader();
if (!is_file(TESTS_RESULT_FILE)) {
$outputArray = array();
$testedParams = array();
$passed = AJXP_Utils::runTests($outputArray, $testedParams);
if (!$passed && !isset($httpVars["ignore_tests"])) {
AJXP_Utils::testResultsToTable($outputArray, $testedParams);
die;
} else {
AJXP_Utils::testResultsToFile($outputArray, $testedParams);
}
}
$root = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$configUrl = ConfService::getCoreConf("SERVER_URL");
if (!empty($configUrl)) {
$root = '/' . ltrim(parse_url($configUrl, PHP_URL_PATH), '/');
if (strlen($root) > 1) {
$root = rtrim($root, '/') . '/';
}
} else {
preg_match('/ws-(.)*\\/|settings|dashboard|welcome|user/', $root, $matches, PREG_OFFSET_CAPTURE);
if (count($matches)) {
$capture = $matches[0][1];
$root = substr($root, 0, $capture);
}
}
$START_PARAMETERS = array("BOOTER_URL" => "index.php?get_action=get_boot_conf", "MAIN_ELEMENT" => "ajxp_desktop", "APPLICATION_ROOT" => $root, "REBASE" => $root);
if (AuthService::usersEnabled()) {
//.........这里部分代码省略.........
示例10: switchAction
public function switchAction($action, $httpVars, $fileVars)
{
if (!isset($this->actions[$action])) {
return;
}
if (preg_match('/MSIE 7/', $_SERVER['HTTP_USER_AGENT'])) {
// Force legacy theme for the moment
$this->pluginConf["GUI_THEME"] = "oxygen";
}
if (!defined("AJXP_THEME_FOLDER")) {
define("CLIENT_RESOURCES_FOLDER", AJXP_PLUGINS_FOLDER . "/gui.ajax/res");
define("AJXP_THEME_FOLDER", CLIENT_RESOURCES_FOLDER . "/themes/" . $this->pluginConf["GUI_THEME"]);
}
foreach ($httpVars as $getName => $getValue) {
${$getName} = AJXP_Utils::securePath($getValue);
}
if (isset($dir) && $action != "upload") {
$dir = SystemTextEncoding::fromUTF8($dir);
}
$mess = ConfService::getMessages();
switch ($action) {
//------------------------------------
// GET AN HTML TEMPLATE
//------------------------------------
case "get_template":
HTMLWriter::charsetHeader();
$folder = CLIENT_RESOURCES_FOLDER . "/html";
if (isset($httpVars["pluginName"])) {
$folder = AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/" . AJXP_Utils::securePath($httpVars["pluginName"]);
if (isset($httpVars["pluginPath"])) {
$folder .= "/" . AJXP_Utils::securePath($httpVars["pluginPath"]);
}
}
$crtTheme = $this->pluginConf["GUI_THEME"];
$thFolder = AJXP_THEME_FOLDER . "/html";
if (isset($template_name)) {
if (is_file($thFolder . "/" . $template_name)) {
include $thFolder . "/" . $template_name;
} else {
if (is_file($folder . "/" . $template_name)) {
include $folder . "/" . $template_name;
}
}
}
break;
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
//------------------------------------
// GET I18N MESSAGES
//------------------------------------
case "get_i18n_messages":
$refresh = false;
if (isset($httpVars["lang"])) {
ConfService::setLanguage($httpVars["lang"]);
$refresh = true;
}
HTMLWriter::charsetHeader('text/javascript');
HTMLWriter::writeI18nMessagesClass(ConfService::getMessages($refresh));
break;
//------------------------------------
// SEND XML REGISTRY
//------------------------------------
//------------------------------------
// SEND XML REGISTRY
//------------------------------------
case "get_xml_registry":
$regDoc = AJXP_PluginsService::getXmlRegistry();
$changes = AJXP_Controller::filterRegistryFromRole($regDoc);
if ($changes) {
AJXP_PluginsService::updateXmlRegistry($regDoc);
}
$clone = $regDoc->cloneNode(true);
$clonePath = new DOMXPath($clone);
$serverCallbacks = $clonePath->query("//serverCallback|hooks");
foreach ($serverCallbacks as $callback) {
$processing = $callback->parentNode->removeChild($callback);
}
if (isset($_GET["xPath"])) {
//$regPath = new DOMXPath($regDoc);
$nodes = $clonePath->query($_GET["xPath"]);
AJXP_XMLWriter::header("ajxp_registry_part", array("xPath" => $_GET["xPath"]));
if ($nodes->length) {
print AJXP_XMLWriter::replaceAjxpXmlKeywords($clone->saveXML($nodes->item(0)));
}
AJXP_XMLWriter::close("ajxp_registry_part");
} else {
AJXP_Utils::safeIniSet("zlib.output_compression", "4096");
header('Content-Type: application/xml; charset=UTF-8');
print AJXP_XMLWriter::replaceAjxpXmlKeywords($clone->saveXML());
}
break;
//------------------------------------
// DISPLAY DOC
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
HTMLWriter::charsetHeader();
//.........这里部分代码省略.........