本文整理汇总了PHP中AJXP_PluginsService::searchAllManifests方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_PluginsService::searchAllManifests方法的具体用法?PHP AJXP_PluginsService::searchAllManifests怎么用?PHP AJXP_PluginsService::searchAllManifests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_PluginsService
的用法示例。
在下文中一共展示了AJXP_PluginsService::searchAllManifests方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: availableDriversToXML
/**
* Search the manifests declaring ajxpdriver as their root node. Remove ajxp_conf & ajxp_shared
* @static
* @param string $filterByTagName
* @param string $filterByDriverName
* @param bool $limitToEnabledPlugins
* @return string
*/
public static function availableDriversToXML($filterByTagName = "", $filterByDriverName = "", $limitToEnabledPlugins = false)
{
$nodeList = AJXP_PluginsService::searchAllManifests("//ajxpdriver", "node", false, $limitToEnabledPlugins);
$xmlBuffer = "";
foreach ($nodeList as $node) {
$dName = $node->getAttribute("name");
if ($filterByDriverName != "" && $dName != $filterByDriverName) {
continue;
}
if ($dName == "ajxp_conf" || $dName == "ajxp_shared") {
continue;
}
if ($filterByTagName == "") {
$xmlBuffer .= $node->ownerDocument->saveXML($node);
continue;
}
$q = new DOMXPath($node->ownerDocument);
$cNodes = $q->query("//" . $filterByTagName, $node);
$nodeAttr = $node->attributes;
$xmlBuffer .= "<ajxpdriver ";
foreach ($node->attributes as $attr) {
$xmlBuffer .= " {$attr->name}=\"{$attr->value}\" ";
}
$xmlBuffer .= ">";
foreach ($cNodes as $child) {
$xmlBuffer .= $child->ownerDocument->saveXML($child);
}
$xmlBuffer .= "</ajxpdriver>";
}
return $xmlBuffer;
}
示例2: writeRepositoriesData
/**
* Write the repositories access rights in XML format
* @static
* @param AbstractAjxpUser|null $loggedUser * @internal param bool $details
* @return string
*/
public static function writeRepositoriesData($loggedUser)
{
$st = "<repositories>";
$streams = ConfService::detectRepositoryStreams(false);
$exposed = array();
$cacheHasExposed = AJXP_PluginsService::getInstance()->loadFromPluginQueriesCache("//server_settings/param[contains(@scope,'repository') and @expose='true']");
if ($cacheHasExposed !== null && is_array($cacheHasExposed)) {
$exposed = $cacheHasExposed;
} else {
$exposed_props = AJXP_PluginsService::searchAllManifests("//server_settings/param[contains(@scope,'repository') and @expose='true']", "node", false, false, true);
foreach ($exposed_props as $exposed_prop) {
$pluginId = $exposed_prop->parentNode->parentNode->getAttribute("id");
$paramName = $exposed_prop->getAttribute("name");
$paramDefault = $exposed_prop->getAttribute("default");
$exposed[] = array("PLUGIN_ID" => $pluginId, "NAME" => $paramName, "DEFAULT" => $paramDefault);
}
AJXP_PluginsService::getInstance()->storeToPluginQueriesCache("//server_settings/param[contains(@scope,'repository') and @expose='true']", $exposed);
}
$accessible = ConfService::getAccessibleRepositories($loggedUser, false, false);
$inboxStatus = 0;
foreach ($accessible as $repoId => $repoObject) {
if (!$repoObject->hasContentFilter()) {
continue;
}
$accessStatus = $repoObject->getAccessStatus();
if (empty($accessStatus) && $loggedUser != null) {
$lastConnected = $loggedUser->getArrayPref("repository_last_connected", $repoId);
if (empty($lastConnected)) {
$accessStatus = 1;
}
}
if (!empty($accessStatus)) {
$inboxStatus++;
}
}
foreach ($accessible as $repoId => $repoObject) {
if (!isset($_SESSION["CURRENT_MINISITE"]) && $repoObject->hasContentFilter()) {
continue;
}
$accessStatus = '';
if ($repoObject->getAccessType() == "inbox") {
$accessStatus = $inboxStatus;
}
$xmlString = self::repositoryToXML($repoId, $repoObject, $exposed, $streams, $loggedUser, $accessStatus);
$st .= $xmlString;
}
$st .= "</repositories>";
return $st;
}
示例3: switchAction
//.........这里部分代码省略.........
$count = count($this->getUserChildren($loggedUser->getId()));
if ($count >= $limit) {
throw new Exception($mess['483']);
}
}
AuthService::createUser($data["new_user_id"], $data["new_password"]);
$userObject = ConfService::getConfStorageImpl()->createUserObject($data["new_user_id"]);
$userObject->setParent($loggedUser->getId());
$userObject->save('superuser');
$userObject->personalRole->clearAcls();
$userObject->setGroupPath($loggedUser->getGroupPath());
$userObject->setProfile("shared");
} else {
if ($action == "user_create_user" && isset($httpVars["NEW_existing_user_id"])) {
$updating = true;
AJXP_Utils::parseStandardFormParameters($httpVars, $data, null, "NEW_");
$userId = $data["existing_user_id"];
if (!AuthService::userExists($userId)) {
throw new Exception("Cannot find user");
}
$userObject = ConfService::getConfStorageImpl()->createUserObject($userId);
if ($userObject->getParent() != AuthService::getLoggedUser()->getId()) {
throw new Exception("Cannot find user");
}
if (!empty($data["new_password"])) {
AuthService::updatePassword($userId, $data["new_password"]);
}
} else {
$updating = false;
$userObject = AuthService::getLoggedUser();
AJXP_Utils::parseStandardFormParameters($httpVars, $data, null, "PREFERENCES_");
}
}
$paramNodes = AJXP_PluginsService::searchAllManifests("//server_settings/param[contains(@scope,'user') and @expose='true']", "node", false, false, true);
$rChanges = false;
if (is_array($paramNodes) && count($paramNodes)) {
foreach ($paramNodes as $xmlNode) {
if ($xmlNode->getAttribute("expose") == "true") {
$parentNode = $xmlNode->parentNode->parentNode;
$pluginId = $parentNode->getAttribute("id");
if (empty($pluginId)) {
$pluginId = $parentNode->nodeName . "." . $parentNode->getAttribute("name");
}
$name = $xmlNode->getAttribute("name");
if (isset($data[$name]) || $data[$name] === "") {
if ($data[$name] == "__AJXP_VALUE_SET__") {
continue;
}
if ($data[$name] === "" || $userObject->parentRole == null || $userObject->parentRole->filterParameterValue($pluginId, $name, AJXP_REPO_SCOPE_ALL, "") != $data[$name] || $userObject->personalRole->filterParameterValue($pluginId, $name, AJXP_REPO_SCOPE_ALL, "") != $data[$name]) {
$userObject->personalRole->setParameterValue($pluginId, $name, $data[$name]);
$rChanges = true;
}
}
}
}
}
if ($rChanges) {
AuthService::updateRole($userObject->personalRole, $userObject);
$userObject->recomputeMergedRole();
if ($action == "custom_data_edit") {
AuthService::updateUser($userObject);
}
}
if ($action == "user_create_user") {
AJXP_Controller::applyHook($updating ? "user.after_update" : "user.after_create", array($userObject));
if (isset($data["send_email"]) && $data["send_email"] == true && !empty($data["email"])) {
示例4: render
//.........这里部分代码省略.........
$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);
AuthService::logTemporaryUser($data["OWNER_ID"], $shortHash);
if (isset($data["SAFE_USER"]) && isset($data["SAFE_PASS"])) {
// FORCE SESSION MODE
AJXP_Safe::getInstance()->forceSessionCredentialsUsage();
AJXP_Safe::storeCredentials($data["SAFE_USER"], $data["SAFE_PASS"]);
}
$repoObject = $data["REPOSITORY"];
ConfService::switchRootDir($repoObject->getId());
ConfService::loadRepositoryDriver();
AJXP_PluginsService::getInstance()->initActivePlugins();
try {
$params = array("file" => SystemTextEncoding::toUTF8($data["FILE_PATH"]));
if (isset($data["PLUGINS_DATA"])) {
$params["PLUGINS_DATA"] = $data["PLUGINS_DATA"];
}
if (isset($_GET["ct"]) && $_GET["ct"] == "true") {
$mime = pathinfo($params["file"], PATHINFO_EXTENSION);
$editors = AJXP_PluginsService::searchAllManifests("//editor[contains(@mimes,'{$mime}') and @previewProvider='true']", "node", true, true, false);
if (count($editors)) {
foreach ($editors as $editor) {
$xPath = new DOMXPath($editor->ownerDocument);
$callbacks = $xPath->query("//action[@contentTypedProvider]", $editor);
if ($callbacks->length) {
$data["ACTION"] = $callbacks->item(0)->getAttribute("name");
if ($data["ACTION"] == "audio_proxy") {
$params["file"] = base64_encode($params["file"]);
}
break;
}
}
}
}
AJXP_Controller::findActionAndApply($data["ACTION"], $params, null);
register_shutdown_function(array("AuthService", "clearTemporaryUser"), $shortHash);
} catch (Exception $e) {
AuthService::clearTemporaryUser($shortHash);
die($e->getMessage());
}
}
示例5: writeRepositoriesData
/**
* Write the repositories access rights in XML format
* @static
* @param AbstractAjxpUser|null $loggedUser * @internal param bool $details
* @return string
*/
public static function writeRepositoriesData($loggedUser)
{
$st = "<repositories>";
$streams = ConfService::detectRepositoryStreams(false);
$exposed = array();
$cacheHasExposed = AJXP_PluginsService::getInstance()->loadFromPluginQueriesCache("//server_settings/param[contains(@scope,'repository') and @expose='true']");
if ($cacheHasExposed !== null && is_array($cacheHasExposed)) {
$exposed = $cacheHasExposed;
} else {
$exposed_props = AJXP_PluginsService::searchAllManifests("//server_settings/param[contains(@scope,'repository') and @expose='true']", "node", false, false, true);
foreach ($exposed_props as $exposed_prop) {
$pluginId = $exposed_prop->parentNode->parentNode->getAttribute("id");
$paramName = $exposed_prop->getAttribute("name");
$paramDefault = $exposed_prop->getAttribute("default");
$exposed[] = array("PLUGIN_ID" => $pluginId, "NAME" => $paramName, "DEFAULT" => $paramDefault);
}
AJXP_PluginsService::getInstance()->storeToPluginQueriesCache("//server_settings/param[contains(@scope,'repository') and @expose='true']", $exposed);
}
$accessible = ConfService::getAccessibleRepositories($loggedUser, false, false);
foreach ($accessible as $repoId => $repoObject) {
$rightString = "";
$streamString = "";
if (in_array($repoObject->accessType, $streams)) {
$streamString = "allowCrossRepositoryCopy=\"true\"";
}
if ($repoObject->getUniqueUser()) {
$streamString .= " user_editable_repository=\"true\" ";
}
$slugString = "";
$slug = $repoObject->getSlug();
if (!empty($slug)) {
$slugString = "repositorySlug=\"{$slug}\"";
}
$isSharedString = "";
if ($repoObject->hasOwner()) {
$uId = $repoObject->getOwner();
$uObject = ConfService::getConfStorageImpl()->createUserObject($uId);
$label = $uObject->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, $uId);
if (empty($label)) {
$label = $uId;
}
$isSharedString = 'owner="' . AJXP_Utils::xmlEntities($label) . '"';
}
$descTag = "";
$public = false;
if (!empty($_SESSION["CURRENT_MINISITE"])) {
$public = true;
}
$description = $repoObject->getDescription($public);
if (!empty($description)) {
$descTag = '<description>' . AJXP_Utils::xmlEntities($description, true) . '</description>';
}
$roleString = "";
if ($loggedUser != null) {
$merged = $loggedUser->mergedRole;
$params = array();
foreach ($exposed as $exposed_prop) {
$metaOptions = $repoObject->getOption("META_SOURCES");
if (!isset($metaOptions[$exposed_prop["PLUGIN_ID"]])) {
continue;
}
$value = $exposed_prop["DEFAULT"];
if (isset($metaOptions[$exposed_prop["PLUGIN_ID"]][$exposed_prop["NAME"]])) {
$value = $metaOptions[$exposed_prop["PLUGIN_ID"]][$exposed_prop["NAME"]];
}
$value = $merged->filterParameterValue($exposed_prop["PLUGIN_ID"], $exposed_prop["NAME"], $repoId, $value);
if ($value !== null) {
if ($value === true || $value === false) {
$value = $value === true ? "true" : "false";
}
$params[] = '<repository_plugin_param plugin_id="' . $exposed_prop["PLUGIN_ID"] . '" name="' . $exposed_prop["NAME"] . '" value="' . AJXP_Utils::xmlEntities($value) . '"/>';
$roleString .= str_replace(".", "_", $exposed_prop["PLUGIN_ID"]) . "_" . $exposed_prop["NAME"] . '="' . AJXP_Utils::xmlEntities($value) . '" ';
}
}
$roleString .= 'acl="' . $merged->getAcl($repoId) . '"';
if ($merged->hasMask($repoId)) {
$roleString .= ' hasMask="true" ';
}
}
$st .= "<repo access_type=\"" . $repoObject->accessType . "\" id=\"" . $repoId . "\"{$rightString} {$streamString} {$slugString} {$isSharedString} {$roleString}><label>" . SystemTextEncoding::toUTF8(AJXP_Utils::xmlEntities($repoObject->getDisplay())) . "</label>" . $descTag . $repoObject->getClientSettings() . "</repo>";
}
$st .= "</repositories>";
return $st;
}
示例6: limitedRoleFromParent
/**
* @param AJXP_Role $parentRole
* @return AJXP_Role
*/
public static function limitedRoleFromParent($parentUser)
{
$parentRole = self::getRole("AJXP_USR_/" . $parentUser);
if ($parentRole === false) {
return null;
}
// Inherit actions
$inheritActions = array();
$cacheInherit = AJXP_PluginsService::getInstance()->loadFromPluginQueriesCache("//server_settings/param[@inherit='true']");
if ($cacheInherit !== null && is_array($cacheInherit)) {
$inheritActions = $cacheInherit;
} else {
$paramNodes = AJXP_PluginsService::searchAllManifests("//server_settings/param[@inherit='true']", "node", false, false, true);
if (is_array($paramNodes) && count($paramNodes)) {
foreach ($paramNodes as $node) {
$paramName = $node->getAttribute("name");
$pluginId = $node->parentNode->parentNode->getAttribute("id");
if (isset($inheritActions[$pluginId])) {
$inheritActions[$pluginId] = array();
}
$inheritActions[$pluginId][] = $paramName;
}
}
AJXP_PluginsService::getInstance()->storeToPluginQueriesCache("//server_settings/param[@inherit='true']", $inheritActions);
}
// Clear ACL, Keep disabled actions, keep 'inherit' parameters.
$childRole = new AJXP_Role("AJXP_PARENT_USR_/");
$childRole->bunchUpdate(array("ACL" => array(), "ACTIONS" => $parentRole->listAllActionsStates(), "APPLIES" => array(), "PARAMETERS" => array()));
$params = $parentRole->listParameters();
foreach ($params as $scope => $plugData) {
foreach ($plugData as $pId => $paramData) {
if (!isset($inheritActions[$pId])) {
continue;
}
foreach ($paramData as $pName => $pValue) {
$childRole->setParameterValue($pId, $pName, $pValue, $scope);
}
}
}
return $childRole;
}
示例7: loadMinisite
public static function loadMinisite($data, $hash = '', $error = null)
{
if (isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true) {
$mess = ConfService::getMessages();
$error = $mess['share_center.164'];
}
$repository = $data["REPOSITORY"];
AJXP_PluginsService::getInstance()->initActivePlugins();
$shareCenter = AJXP_PluginsService::findPlugin("action", "share");
$confs = $shareCenter->getConfigs();
$minisiteLogo = "plugins/gui.ajax/PydioLogo250.png";
if (!empty($confs["CUSTOM_MINISITE_LOGO"])) {
$logoPath = $confs["CUSTOM_MINISITE_LOGO"];
if (strpos($logoPath, "plugins/") === 0 && is_file(AJXP_INSTALL_PATH . "/" . $logoPath)) {
$minisiteLogo = $logoPath;
} else {
$minisiteLogo = "index_shared.php?get_action=get_global_binary_param&binary_id=" . $logoPath;
}
}
// Default value
if (isset($data["AJXP_TEMPLATE_NAME"])) {
$templateName = $data["AJXP_TEMPLATE_NAME"];
if ($templateName == "ajxp_film_strip" && AJXP_Utils::userAgentIsMobile()) {
$templateName = "ajxp_shared_folder";
}
}
if (isset($repository)) {
$repoObject = ConfService::getRepositoryById($repository);
if (!is_object($repoObject)) {
$mess = ConfService::getMessages();
$error = $mess["share_center.166"];
$templateName = "ajxp_unique_strip";
$repoObject = null;
}
}
if (!isset($templateName) && isset($repoObject)) {
$filter = $repoObject->getContentFilter();
if (!empty($filter) && count($filter->virtualPaths) == 1) {
$templateName = "ajxp_unique_strip";
} else {
$templateName = "ajxp_shared_folder";
}
}
if (!isset($templateName) && isset($error)) {
$templateName = "ajxp_unique_strip";
}
// UPDATE TEMPLATE
$html = file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/action.share/res/minisite.php");
AJXP_Controller::applyHook("tpl.filter_html", array(&$html));
$html = AJXP_XMLWriter::replaceAjxpXmlKeywords($html);
$html = str_replace("AJXP_MINISITE_LOGO", $minisiteLogo, $html);
$html = str_replace("AJXP_APPLICATION_TITLE", ConfService::getCoreConf("APPLICATION_TITLE"), $html);
$html = str_replace("PYDIO_APP_TITLE", ConfService::getCoreConf("APPLICATION_TITLE"), $html);
if (isset($repository) && isset($repoObject)) {
$html = str_replace("AJXP_START_REPOSITORY", $repository, $html);
$html = str_replace("AJXP_REPOSITORY_LABEL", ConfService::getRepositoryById($repository)->getDisplay(), $html);
}
$html = str_replace('AJXP_HASH_LOAD_ERROR', isset($error) ? $error : '', $html);
$html = str_replace("AJXP_TEMPLATE_NAME", $templateName, $html);
$html = str_replace("AJXP_LINK_HASH", $hash, $html);
$guiConfigs = AJXP_PluginsService::findPluginById("gui.ajax")->getConfigs();
$html = str_replace("AJXP_THEME", $guiConfigs["GUI_THEME"], $html);
if (isset($_GET["dl"]) && isset($_GET["file"])) {
AuthService::$useSession = false;
} else {
session_name("AjaXplorer_Shared" . str_replace(".", "_", $hash));
session_start();
AuthService::disconnect();
}
if (!empty($data["PRELOG_USER"])) {
AuthService::logUser($data["PRELOG_USER"], "", true);
$html = str_replace("AJXP_PRELOGED_USER", "ajxp_preloged_user", $html);
} else {
if (isset($data["PRESET_LOGIN"])) {
$_SESSION["PENDING_REPOSITORY_ID"] = $repository;
$_SESSION["PENDING_FOLDER"] = "/";
$html = str_replace("AJXP_PRELOGED_USER", $data["PRESET_LOGIN"], $html);
} else {
$html = str_replace("AJXP_PRELOGED_USER", "ajxp_legacy_minisite", $html);
}
}
if (isset($hash)) {
$_SESSION["CURRENT_MINISITE"] = $hash;
}
if (isset($_GET["dl"]) && isset($_GET["file"]) && (!isset($data["DOWNLOAD_DISABLED"]) || $data["DOWNLOAD_DISABLED"] === false)) {
ConfService::switchRootDir($repository);
ConfService::loadRepositoryDriver();
AJXP_PluginsService::deferBuildingRegistry();
AJXP_PluginsService::getInstance()->initActivePlugins();
AJXP_PluginsService::flushDeferredRegistryBuilding();
$errMessage = null;
try {
$params = $_GET;
$ACTION = "download";
if (isset($_GET["ct"])) {
$mime = pathinfo($params["file"], PATHINFO_EXTENSION);
$editors = AJXP_PluginsService::searchAllManifests("//editor[contains(@mimes,'{$mime}') and @previewProvider='true']", "node", true, true, false);
if (count($editors)) {
foreach ($editors as $editor) {
$xPath = new DOMXPath($editor->ownerDocument);
//.........这里部分代码省略.........