本文整理汇总了PHP中AJXP_XMLWriter::sendFilesListComponentConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_XMLWriter::sendFilesListComponentConfig方法的具体用法?PHP AJXP_XMLWriter::sendFilesListComponentConfig怎么用?PHP AJXP_XMLWriter::sendFilesListComponentConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_XMLWriter
的用法示例。
在下文中一共展示了AJXP_XMLWriter::sendFilesListComponentConfig方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchAction
function switchAction($action, $httpVars, $fileVars)
{
if (!isset($this->actions[$action])) {
return;
}
parent::accessPreprocess($action, $httpVars, $fileVars);
switch ($action) {
case "ls":
$doc = DOMDocument::load($this->repository->getOption("HOST") . "?request=GetCapabilities");
$xPath = new DOMXPath($doc);
$dir = $httpVars["dir"];
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="wms.1" attributeName="ajxp_label" sortType="String"/><column messageId="wms.6" attributeName="srs" sortType="String"/><column messageId="wms.4" attributeName="style" sortType="String"/><column messageId="wms.5" attributeName="keywords" sortType="String"/></columns>');
$layers = $xPath->query("Capability/Layer/Layer");
// Detect "levels"
$levels = array();
$leafs = array();
$styleLevels = $prefixLevels = false;
foreach ($layers as $layer) {
$name = $xPath->evaluate("Name", $layer)->item(0)->nodeValue;
$stylesList = $xPath->query("Style/Name", $layer);
if (strstr($name, ":") !== false) {
$exp = explode(":", $name);
if (!isset($levels[$exp[0]])) {
$levels[$exp[0]] = array();
}
$levels[$exp[0]][] = $layer;
$prefixLevels = true;
} else {
if ($stylesList->length > 1) {
if (!isset($levels[$name])) {
$levels[$name] = array();
}
foreach ($stylesList as $style) {
$levels[$name][$style->nodeValue] = $layer;
}
$styleLevels = true;
} else {
$leafs[] = $layer;
}
}
}
if ($dir == "/" || $dir == "") {
$this->listLevels($levels);
$this->listLayers($leafs, $xPath);
} else {
if (isset($levels[basename($dir)])) {
$this->listLayers($levels[basename($dir)], $xPath, $styleLevels ? array($this, "replaceStyle") : null);
}
}
AJXP_XMLWriter::close();
break;
default:
break;
}
}
示例2: listRepositories
function listRepositories()
{
$repos = ConfService::getRepositoriesList();
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/><column messageId="ajxp_conf.9" attributeName="accessType" sortType="String"/><column messageId="ajxp_shared.9" attributeName="repo_accesses" sortType="String"/></columns>');
$repoArray = array();
$childRepos = array();
$loggedUser = AuthService::getLoggedUser();
$users = AuthService::listUsers();
foreach ($repos as $repoIndex => $repoObject) {
if ($repoObject->getAccessType() == "ajxp_conf") {
continue;
}
if (!$repoObject->hasOwner() || $repoObject->getOwner() != $loggedUser->getId()) {
continue;
}
if (is_numeric($repoIndex)) {
$repoIndex = "" . $repoIndex;
}
$name = AJXP_Utils::xmlEntities(SystemTextEncoding::toUTF8($repoObject->getDisplay()));
$repoArray[$name] = $repoIndex;
}
// Sort the list now by name
ksort($repoArray);
// Append child repositories
$sortedArray = array();
foreach ($repoArray as $name => $repoIndex) {
$sortedArray[$name] = $repoIndex;
if (isset($childRepos[$repoIndex]) && is_array($childRepos[$repoIndex])) {
foreach ($childRepos[$repoIndex] as $childData) {
$sortedArray[$childData["name"]] = $childData["index"];
}
}
}
foreach ($sortedArray as $name => $repoIndex) {
$repoObject =& $repos[$repoIndex];
$repoAccesses = array();
foreach ($users as $userId => $userObject) {
if (!$userObject->hasParent()) {
continue;
}
if ($userObject->canWrite($repoIndex)) {
$repoAccesses[] = $userId . " (rw)";
} else {
if ($userObject->canRead($repoIndex)) {
$repoAccesses[] = $userId . " (r)";
}
}
}
$metaData = array("repository_id" => $repoIndex, "accessType" => $repoObject->getAccessType(), "icon" => "document_open_remote.png", "openicon" => "document_open_remote.png", "parentname" => "/repositories", "repo_accesses" => implode(", ", $repoAccesses), "ajxp_mime" => "shared_repository");
AJXP_XMLWriter::renderNode("/repositories/{$repoIndex}", $name, true, $metaData);
}
}
示例3: listTasks
public function listTasks($nodeName, $baseDir)
{
$mess = ConfService::getMessages();
AJXP_XMLWriter::renderHeaderNode("/{$baseDir}/{$nodeName}", "Scheduler", false, array("icon" => "scheduler/ICON_SIZE/player_time.png"));
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist" switchDisplayMode="list" template_name="action.scheduler_list">
<column messageId="action.scheduler.12" attributeName="ajxp_label" sortType="String"/>
<column messageId="action.scheduler.2" attributeName="schedule" sortType="String"/>
<column messageId="action.scheduler.1" attributeName="action_name" sortType="String"/>
<column messageId="action.scheduler.4s" attributeName="repository_id" sortType="String"/>
<column messageId="action.scheduler.17" attributeName="user_id" sortType="String"/>
<column messageId="action.scheduler.3" attributeName="NEXT_EXECUTION" sortType="String"/>
<column messageId="action.scheduler.14" attributeName="LAST_EXECUTION" sortType="String"/>
<column messageId="action.scheduler.13" attributeName="STATUS" sortType="String"/>
</columns>');
$tasks = AJXP_Utils::loadSerialFile($this->getDbFile(), false, "json");
foreach ($tasks as $task) {
$timeArray = $this->getTimeArray($task["schedule"]);
$res = $this->getNextExecutionTimeForScript(time(), $timeArray);
$task["NEXT_EXECUTION"] = date($mess["date_format"], $res);
$task["PARAMS"] = implode(", ", $task["PARAMS"]);
$task["icon"] = "scheduler/ICON_SIZE/task.png";
$task["ajxp_mime"] = "scheduler_task";
$sFile = AJXP_CACHE_DIR . "/cmd_outputs/task_" . $task["task_id"] . ".status";
if (is_file($sFile)) {
$s = $this->getTaskStatus($task["task_id"]);
$task["STATUS"] = implode(":", $s);
$task["LAST_EXECUTION"] = date($mess["date_format"], filemtime($sFile));
} else {
$task["STATUS"] = "n/a";
$task["LAST_EXECUTION"] = "n/a";
}
AJXP_XMLWriter::renderNode("/admin/scheduler/" . $task["task_id"], isset($task["label"]) ? $task["label"] : "Action " . $task["action_name"], true, $task);
}
AJXP_XMLWriter::close();
}
示例4: switchAction
//.........这里部分代码省略.........
break;
case "reset_counter":
if (isset($httpVars["hash"])) {
$userId = AuthService::getLoggedUser()->getId();
if (isset($httpVars["owner_id"]) && $httpVars["owner_id"] != $userId) {
if (!AuthService::getLoggedUser()->isAdmin()) {
throw new Exception("You are not allowed to access this resource");
}
$userId = $httpVars["owner_id"];
}
$this->getShareStore()->resetDownloadCounter($httpVars["hash"], $userId);
} else {
$userSelection = new UserSelection($this->repository, $httpVars);
$ajxpNode = $userSelection->getUniqueNode();
$metadata = $this->getShareStore()->getMetaManager()->getNodeMeta($ajxpNode);
if (!isset($metadata["shares"]) || !is_array($metadata["shares"])) {
return null;
}
if (isset($httpVars["element_id"]) && isset($metadata["shares"][$httpVars["element_id"]])) {
$this->getShareStore()->resetDownloadCounter($httpVars["element_id"], $httpVars["owner_id"]);
} else {
$keys = array_keys($metadata["shares"]);
foreach ($keys as $key) {
$this->getShareStore()->resetDownloadCounter($key, null);
}
}
}
break;
case "update_shared_element_data":
if (!in_array($httpVars["p_name"], array("counter", "tags"))) {
return null;
}
$hash = AJXP_Utils::decodeSecureMagic($httpVars["element_id"]);
$userSelection = new UserSelection($this->repository, $httpVars);
$ajxpNode = $userSelection->getUniqueNode();
if ($this->getShareStore()->shareIsLegacy($hash)) {
// Store in metadata
$metadata = $this->getShareStore()->getMetaManager()->getNodeMeta($ajxpNode);
if (isset($metadata["shares"][$httpVars["element_id"]])) {
if (!is_array($metadata["shares"][$httpVars["element_id"]])) {
$metadata["shares"][$httpVars["element_id"]] = array();
}
$metadata["shares"][$httpVars["element_id"]][$httpVars["p_name"]] = $httpVars["p_value"];
// Set Private=true by default.
$this->getShareStore()->getMetaManager()->setNodeMeta($ajxpNode, $metadata, true);
}
} else {
// TODO: testUserCanEditShare ?
$this->getShareStore()->updateShareProperty($hash, $httpVars["p_name"], $httpVars["p_value"]);
}
break;
case "sharelist-load":
$parentRepoId = isset($httpVars["parent_repository_id"]) ? $httpVars["parent_repository_id"] : "";
$userContext = $httpVars["user_context"];
$currentUser = true;
if ($userContext == "global" && AuthService::getLoggedUser()->isAdmin()) {
$currentUser = false;
} else {
if ($userContext == "user" && AuthService::getLoggedUser()->isAdmin() && !empty($httpVars["user_id"])) {
$currentUser = AJXP_Utils::sanitize($httpVars["user_id"], AJXP_SANITIZE_EMAILCHARS);
}
}
$nodes = $this->listSharesAsNodes("/data/repositories/{$parentRepoId}/shares", $currentUser, $parentRepoId);
AJXP_XMLWriter::header();
if ($userContext == "current") {
AJXP_XMLWriter::sendFilesListComponentConfig('<columns template_name="ajxp_user.shares">
<column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/>
<column messageId="share_center.132" attributeName="shared_element_parent_repository_label" sortType="String"/>
<column messageId="3" attributeName="share_type_readable" sortType="String"/>
</columns>');
} else {
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="filelist" template_name="ajxp_conf.repositories">
<column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/>
<column messageId="share_center.159" attributeName="owner" sortType="String"/>
<column messageId="3" attributeName="share_type_readable" sortType="String"/>
<column messageId="share_center.52" attributeName="share_data" sortType="String"/>
</columns>');
}
foreach ($nodes as $node) {
AJXP_XMLWriter::renderAjxpNode($node);
}
AJXP_XMLWriter::close();
break;
case "sharelist-clearExpired":
$accessType = ConfService::getRepository()->getAccessType();
$currentUser = $accessType != "ajxp_conf" && $accessType != "ajxp_admin";
$count = $this->getShareStore()->clearExpiredFiles($currentUser);
AJXP_XMLWriter::header();
if ($count) {
AJXP_XMLWriter::sendMessage("Removed " . count($count) . " expired links", null);
} else {
AJXP_XMLWriter::sendMessage("Nothing to do", null);
}
AJXP_XMLWriter::close();
break;
default:
break;
}
return null;
}
示例5: printDiagnostic
public function printDiagnostic($dir, $root = NULL, $hash = null, $returnNodes = false)
{
$outputArray = array();
$testedParams = array();
$allNodes = array();
AJXP_Utils::runTests($outputArray, $testedParams);
AJXP_Utils::testResultsToFile($outputArray, $testedParams);
if (!$returnNodes) {
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="fileList" template_name="ajxp_conf.diagnostic" defaultWidth="20%"><column messageId="ajxp_conf.23" attributeName="ajxp_label" sortType="String"/><column messageId="ajxp_conf.24" attributeName="data" sortType="String"/></columns>');
}
if (is_file(TESTS_RESULT_FILE)) {
include_once TESTS_RESULT_FILE;
if (isset($diagResults)) {
foreach ($diagResults as $id => $value) {
$value = AJXP_Utils::xmlEntities($value);
$xml = "<tree icon=\"susehelpcenter.png\" is_file=\"1\" filename=\"/{$dir}/{$id}\" text=\"{$id}\" data=\"{$value}\" ajxp_mime=\"testResult\"/>";
if (!$returnNodes) {
print $xml;
} else {
$allNodes["/{$dir}/{$id}"] = $xml;
}
}
}
}
return $allNodes;
}
示例6: listSharedFiles
function listSharedFiles()
{
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist" template_name="ajxp_conf.shared">
<column messageId="ajxp_shared.4" attributeName="ajxp_label" sortType="String" defaultWidth="30%"/>
<column messageId="ajxp_shared.27" attributeName="owner" sortType="String" defaultWidth="10%"/>
<column messageId="ajxp_shared.17" attributeName="download_url" sortType="String" defaultWidth="40%"/>
<column messageId="ajxp_shared.6" attributeName="password" sortType="String" defaultWidth="4%"/>
<column messageId="ajxp_shared.7" attributeName="expiration" sortType="String" defaultWidth="4%"/>
<column messageId="ajxp_shared.20" attributeName="expired" sortType="String" defaultWidth="4%"/>
<column messageId="ajxp_shared.14" attributeName="integrity" sortType="String" defaultWidth="4%" hidden="true"/>
</columns>');
$dlFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER");
if (!is_dir($dlFolder)) {
return;
}
$files = glob($dlFolder . "/*.php");
if ($files === false) {
return;
}
$mess = ConfService::getMessages();
$loggedUser = AuthService::getLoggedUser();
$userId = $loggedUser->getId();
$dlURL = ConfService::getCoreConf("PUBLIC_DOWNLOAD_URL");
if ($dlURL != "") {
$downloadBase = rtrim($dlURL, "/");
} else {
$fullUrl = AJXP_Utils::detectServerURL() . dirname($_SERVER['REQUEST_URI']);
$downloadBase = str_replace("\\", "/", $fullUrl . rtrim(str_replace(AJXP_INSTALL_PATH, "", $dlFolder), "/"));
}
foreach ($files as $file) {
$publicletData = $this->loadPublicletData($file);
AJXP_XMLWriter::renderNode(str_replace(".php", "", basename($file)), "" . SystemTextEncoding::toUTF8($publicletData["REPOSITORY"]->getDisplay()) . ":/" . SystemTextEncoding::toUTF8($publicletData["FILE_PATH"]), true, array("icon" => "html.png", "password" => $publicletData["PASSWORD"] != "" ? $publicletData["PASSWORD"] : "-", "expiration" => $publicletData["EXPIRE_TIME"] != 0 ? date($mess["date_format"], $publicletData["EXPIRE_TIME"]) : "-", "expired" => $publicletData["EXPIRE_TIME"] != 0 ? $publicletData["EXPIRE_TIME"] < time() ? $mess["ajxp_shared.21"] : $mess["ajxp_shared.22"] : "-", "integrity" => !$publicletData["SECURITY_MODIFIED"] ? $mess["ajxp_shared.15"] : $mess["ajxp_shared.16"], "download_url" => $downloadBase . "/" . basename($file), "owner" => isset($publicletData["OWNER_ID"]) ? $publicletData["OWNER_ID"] : "-", "ajxp_mime" => "shared_file"));
}
}
示例7: switchAction
//.........这里部分代码省略.........
$t = "file";
}
$this->getShareStore()->deleteShare($t, $elementId);
$this->removeShareFromMeta($ajxpNode, $elementId);
AJXP_Controller::applyHook("msg.instant", array("<reload_shared_elements/>", ConfService::getRepository()->getId()));
}
}
break;
case "reset_counter":
if (isset($httpVars["hash"])) {
$userId = AuthService::getLoggedUser()->getId();
if (isset($httpVars["owner_id"]) && $httpVars["owner_id"] != $userId) {
if (!AuthService::getLoggedUser()->isAdmin()) {
throw new Exception("You are not allowed to access this resource");
}
$userId = $httpVars["owner_id"];
}
$this->getShareStore()->resetDownloadCounter($httpVars["hash"], $userId);
} else {
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
$ajxpNode = new AJXP_Node($this->urlBase . $file);
$metadata = $ajxpNode->retrieveMetadata("ajxp_shared", true, AJXP_METADATA_SCOPE_REPOSITORY);
if (!isset($metadata["shares"]) || !is_array($metadata["shares"])) {
return null;
}
if (isset($httpVars["element_id"]) && isset($metadata["shares"][$httpVars["element_id"]])) {
$this->getShareStore()->resetDownloadCounter($httpVars["element_id"], $httpVars["owner_id"]);
} else {
$keys = array_keys($metadata["shares"]);
foreach ($keys as $key) {
$this->getShareStore()->resetDownloadCounter($key, null);
}
}
}
break;
case "update_shared_element_data":
if (!in_array($httpVars["p_name"], array("counter", "tags"))) {
return null;
}
$hash = AJXP_Utils::decodeSecureMagic($httpVars["element_id"]);
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
if ($this->getShareStore()->shareIsLegacy($hash)) {
// Store in metadata
$ajxpNode = new AJXP_Node($this->urlBase . $file);
$metadata = $ajxpNode->retrieveMetadata("ajxp_shared", true, AJXP_METADATA_SCOPE_REPOSITORY);
if (isset($metadata["shares"][$httpVars["element_id"]])) {
if (!is_array($metadata["shares"][$httpVars["element_id"]])) {
$metadata["shares"][$httpVars["element_id"]] = array();
}
$metadata["shares"][$httpVars["element_id"]][$httpVars["p_name"]] = $httpVars["p_value"];
$ajxpNode->setMetadata("ajxp_shared", $metadata, true, AJXP_METADATA_SCOPE_REPOSITORY);
}
} else {
$this->getShareStore()->updateShareProperty($hash, $httpVars["p_name"], $httpVars["p_value"]);
}
break;
case "sharelist-load":
$parentRepoId = isset($httpVars["parent_repository_id"]) ? $httpVars["parent_repository_id"] : "";
$userContext = $httpVars["user_context"];
$currentUser = true;
if ($userContext == "global" && AuthService::getLoggedUser()->isAdmin()) {
$currentUser = false;
}
$nodes = $this->listSharesAsNodes("/data/repositories/{$parentRepoId}/shares", $currentUser, $parentRepoId);
AJXP_XMLWriter::header();
if ($userContext == "current") {
AJXP_XMLWriter::sendFilesListComponentConfig('<columns template_name="ajxp_user.shares">
<column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/>
<column messageId="share_center.132" attributeName="shared_element_parent_repository_label" sortType="String"/>
<column messageId="3" attributeName="share_type_readable" sortType="String"/>
</columns>');
} else {
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="filelist" template_name="ajxp_conf.repositories">
<column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/>
<column messageId="share_center.159" attributeName="owner" sortType="String"/>
<column messageId="3" attributeName="share_type_readable" sortType="String"/>
<column messageId="share_center.52" attributeName="share_data" sortType="String"/>
</columns>');
}
foreach ($nodes as $node) {
AJXP_XMLWriter::renderAjxpNode($node);
}
AJXP_XMLWriter::close();
break;
case "sharelist-clearExpired":
$currentUser = ConfService::getRepository()->getAccessType() != "ajxp_conf";
$count = $this->clearExpiredFiles($currentUser);
AJXP_XMLWriter::header();
if ($count) {
AJXP_XMLWriter::sendMessage("Removed " . count($count) . " expired links", null);
} else {
AJXP_XMLWriter::sendMessage("Nothing to do", null);
}
AJXP_XMLWriter::close();
break;
default:
break;
}
return null;
}
示例8: listRepositories
public function listRepositories()
{
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/><column messageId="user_dash.9" attributeName="parent_label" sortType="String"/><column messageId="user_dash.9" attributeName="repo_accesses" sortType="String"/></columns>');
$repoArray = array();
$loggedUser = AuthService::getLoggedUser();
$count = 0;
$repos = ConfService::listRepositoriesWithCriteria(array("owner_user_id" => $loggedUser->getId()), $count);
$searchAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS", "conf");
$displayAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS_DISPLAY", "conf");
if ($searchAll || $displayAll) {
$baseGroup = "/";
} else {
$baseGroup = AuthService::filterBaseGroup("/");
}
AuthService::setGroupFiltering(false);
$users = AuthService::listUsers($baseGroup);
$minisites = $this->listSharedFiles("minisites");
foreach ($repos as $repoIndex => $repoObject) {
if ($repoObject->getAccessType() == "ajxp_conf") {
continue;
}
if (!$repoObject->hasOwner() || $repoObject->getOwner() != $loggedUser->getId()) {
continue;
}
if (is_numeric($repoIndex)) {
$repoIndex = "" . $repoIndex;
}
$name = (isset($minisites[$repoIndex]) ? "[Minisite] " : "") . AJXP_Utils::xmlEntities(SystemTextEncoding::toUTF8($repoObject->getDisplay()));
$repoArray[$name] = $repoIndex;
}
// Sort the list now by name
ksort($repoArray);
foreach ($repoArray as $name => $repoIndex) {
$repoObject =& $repos[$repoIndex];
$repoAccesses = array();
foreach ($users as $userId => $userObject) {
if ($userObject->getId() == $loggedUser->getId()) {
continue;
}
$label = $userObject->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, $userId);
if (empty($label)) {
$label = $userId;
}
$acl = $userObject->mergedRole->getAcl($repoObject->getId());
if (!empty($acl)) {
$repoAccesses[] = $label . " (" . $acl . ")";
}
}
$parent = $repoObject->getParentId();
$parentRepo =& $repos[$parent];
$parentLabel = $this->metaIcon("folder-open") . $parentRepo->getDisplay();
$repoPath = $repoObject->getOption("PATH");
$parentPath = $parentRepo->getOption("PATH");
$parentLabel .= " (" . str_replace($parentPath, "", $repoPath) . ")";
$metaData = array("repository_id" => $repoIndex, "icon" => "document_open_remote.png", "openicon" => "document_open_remote.png", "parentname" => "/repositories", "parent_label" => $parentLabel, "repo_accesses" => count($repoAccesses) ? $this->metaIcon("share-sign") . implode(", ", $repoAccesses) : "", "ajxp_mime" => "shared_repository");
AJXP_XMLWriter::renderNode("/repositories/{$repoIndex}", $name, true, $metaData);
}
}
示例9: switchAction
//.........这里部分代码省略.........
$query = $httpVars["query"];
$_SESSION["LAST_SQL_QUERY"] = $query;
print "<tree store=\"true\"></tree>";
break;
//------------------------------------
// XML LISTING
//------------------------------------
//------------------------------------
// XML LISTING
//------------------------------------
case "ls":
if (!isset($dir) || $dir == "/") {
$dir = "";
}
$searchMode = $fileListMode = $completeMode = false;
if (isset($mode)) {
if ($mode == "search") {
$searchMode = true;
} else {
if ($mode == "file_list") {
$fileListMode = true;
} else {
if ($mode == "complete") {
$completeMode = true;
}
}
}
}
$link = $this->createDbLink();
//AJXP_Exception::errorToXml($link);
if ($dir == "") {
AJXP_XMLWriter::header();
$tables = $this->listTables();
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="filelist"><column messageString="Table Name" attributeName="ajxp_label" sortType="String"/><column messageString="Byte Size" attributeName="bytesize" sortType="NumberKo"/><column messageString="Count" attributeName="count" sortType="Number"/></columns>');
$icon = $mode == "file_list" ? "sql_images/mimes/ICON_SIZE/table_empty.png" : "sql_images/mimes/ICON_SIZE/table_empty_tree.png";
foreach ($tables as $tableName) {
$size = $this->getSize($tableName);
$count = $this->getCount($tableName);
print "<tree is_file=\"0\" text=\"{$tableName}\" filename=\"/{$tableName}\" bytesize=\"{$size}\" count=\"{$count}\" icon=\"{$icon}\" ajxp_mime=\"table\" />";
}
print "<tree is_file=\"0\" text=\"Search Results\" ajxp_node=\"true\" filename=\"/ajxpmysqldriver_searchresults\" bytesize=\"-\" count=\"-\" icon=\"search.png\"/>";
AJXP_XMLWriter::close();
} else {
$tableName = basename($dir);
if (isset($page)) {
$currentPage = $page;
} else {
$currentPage = 1;
}
$query = "SELECT * FROM {$tableName}";
$searchQuery = false;
if ($tableName == "ajxpmysqldriver_searchresults") {
if (isset($_SESSION["LAST_SQL_QUERY"])) {
$query = $_SESSION["LAST_SQL_QUERY"];
$matches = array();
if (preg_match("/SELECT [\\S, ]* FROM (\\S*).*/i", $query, $matches) !== false) {
$tableName = $matches[1];
$searchQuery = true;
} else {
break;
}
} else {
break;
}
}
if (isset($order_column)) {
示例10: printDiagnostic
function printDiagnostic()
{
$outputArray = array();
$testedParams = array();
$passed = AJXP_Utils::runTests($outputArray, $testedParams);
AJXP_Utils::testResultsToFile($outputArray, $testedParams);
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="fileList"><column messageId="ajxp_conf.23" attributeName="ajxp_label" sortType="String"/><column messageId="ajxp_conf.24" attributeName="data" sortType="String"/></columns>');
if (is_file(TESTS_RESULT_FILE)) {
include_once TESTS_RESULT_FILE;
foreach ($diagResults as $id => $value) {
print "<tree icon=\"susehelpcenter.png\" is_file=\"1\" filename=\"{$id}\" text=\"{$id}\" data=\"{$value}\" ajxp_mime=\"testResult\"/>";
}
}
}