Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
FetchedResultPane: pass a label for rootNode via options
Browse files Browse the repository at this point in the history
Use new DataGrid editor for logs viewers
  • Loading branch information
cdujeu committed Sep 10, 2014
1 parent fc25b5d commit 9771e8b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
6 changes: 0 additions & 6 deletions core/src/plugins/editor.ajxp_datagrid/ajxp_datagrid.css
Expand Up @@ -19,10 +19,4 @@
letter-spacing: 1px;
color: rgb(71,71,71);
padding-left: 0;
}

#grid_container td:nth-child(1) span.text_label{
text-align: center;
font-family: 'Open Sans Regular';
font-size: 13px;
}
Expand Up @@ -36,8 +36,9 @@ Class.create("AjxpDataGridEditor", AbstractEditor, {
this.fRP = new FetchedResultPane(this.element.down("#grid_container"), {
displayMode:'list',
fixedDisplayMode:'list',
rootNodeLabel:this.node.getLabel(),
selectionChangeCallback:function(){},
nodeProviderProperties: this._dataSource.toQueryParams()
nodeProviderProperties: this._uniqueSource.toQueryParams()
});
this.fRP._dataLoaded = false;
this.fRP.showElement(true);
Expand All @@ -57,6 +58,7 @@ Class.create("AjxpDataGridEditor", AbstractEditor, {
fit:'content',
displayMode:'list',
fixedDisplayMode:'list',
rootNodeLabel:this.node.getLabel(),
selectionChangeCallback:function(){},
nodeProviderProperties: dS.toQueryParams()
});
Expand All @@ -66,6 +68,7 @@ Class.create("AjxpDataGridEditor", AbstractEditor, {
i++;
}
}
this.element.fire("editor:updateTitle", this.node.getLabel());

},

Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

Expand Up @@ -155,7 +155,7 @@ Class.create("FetchedResultPane", FilesList, {
var rNodeProvider = new RemoteNodeProvider();
dataModel.setAjxpNodeProvider(rNodeProvider);
rNodeProvider.initProvider(ajxpOptions.nodeProviderProperties);
this._rootNode = new AjxpNode("/", false, "Results", "folder.png", rNodeProvider);
this._rootNode = new AjxpNode("/", false, ajxpOptions.rootNodeLabel?ajxpOptions.rootNodeLabel:"Results", "folder.png", rNodeProvider);
dataModel.setRootNode(this._rootNode);
if(ajxpOptions.emptyChildrenMessage){
var emptyMessage = MessageHash[ajxpOptions.emptyChildrenMessage]?MessageHash[ajxpOptions.emptyChildrenMessage]:ajxpOptions.emptyChildrenMessage;
Expand Down
13 changes: 10 additions & 3 deletions core/src/plugins/log.sql/class.sqlLogDriver.php
Expand Up @@ -296,8 +296,15 @@ public function xmlListLogFiles($nodeName="file", $year=null, $month=null, $root
if (is_a($date, "DibiDateTime")) {
$date = $date->format("Y-m-d");
}
$xml_strings[$date] = $this->formatXmlLogList($nodeName, 'toggle_log.png', $date, $date, $date, "$rootPath/$fullYear/$logM/$date");
//"<$nodeName icon=\"toggle_log.png\" date=\"$display\" display=\"$display\" text=\"$date\" is_file=\"0\" filename=\"/logs/$fullYear/$fullMonth/$date\"/>";
$path = "$rootPath/$fullYear/$logM/$date";
$metadata = array(
"icon" => "toggle_log.png",
"date"=> $date,
"ajxp_mime" => "datagrid",
"grid_datasource" => "get_action=ls&dir=".urlencode($path),
"grid_header_title" => "Application Logs for $date"
);
$xml_strings[$date] = AJXP_XMLWriter::renderNode($path, $date, true, $metadata, true, false);
}

} else if ($year != null) { // Get months
Expand All @@ -318,7 +325,7 @@ public function xmlListLogFiles($nodeName="file", $year=null, $month=null, $root

$fullYear = date('Y', $month_time);
$fullMonth = date('F', $month_time);
$logMDisplay = date('M', $month_time);
$logMDisplay = date('F', $month_time);
$logM = date('m', $month_time);

$xml_strings[$r['month']] = $this->formatXmlLogList($nodeName, 'x-office-calendar.png', $logM, $logMDisplay, $logMDisplay, "$rootPath/$fullYear/$logM");
Expand Down

0 comments on commit 9771e8b

Please sign in to comment.