msgid "Files"
msgstr "Files"
-msgid "For see a file versions please double click file on the left files browser."
-msgstr "For see a file versions please double click file on the left files browser."
+msgid "For see a file versions please click file on the left files browser."
+msgstr "For see a file versions please click file on the left files browser."
-msgid "For add a file to restore please drag a file from frame on left or from above frame and drop it here"
-msgstr "For add a file to restore please drag a file from frame on left or from above frame and drop it here"
+msgid "For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here"
+msgstr "For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here"
msgid "It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired)"
msgstr "It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired)"
msgid "Finished jobs:"
msgstr "Finished jobs:"
+msgid "Add"
+msgstr "Add"
+
msgid "It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired)"
msgstr "Wygląda na to, że nie ma żadnych plików do przywrócenia lub rekordy plików w bazie danych dla tego wybranego backupu zostały wyczyszczone (miała zastosowanie retencja plików)"
-msgid "For see a file versions please double click file on the left files browser."
-msgstr "Aby zobaczyć wersje pliku proszę podwójnie klinąć plik z przeglądarki plików po lewej stronie."
+msgid "For see a file versions please click file on the left files browser."
+msgstr "Aby zobaczyć wersje pliku proszę klinąć plik z przeglądarki plików po lewej stronie."
-msgid "For add a file to restore please drag a file from frame on left or from above frame and drop it here"
-msgstr "Aby dodać plik do przywrócenia proszę złapać plik z panelu po lewej lub z panelu powyżej, przeciągnąć go tutaj i upuścić go"
+msgid "For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here"
+msgstr "Aby dodać plik do przywrócenia proszę kliknąć link 'Dodaj' lub złapać plik z panelu po lewej lub z panelu powyżej, przeciągnąć go tutaj i upuścić go"
msgid "Source parameters"
msgstr "Parametry źródła"
msgid "Finished jobs:"
msgstr "Zakończone zadania:"
+msgid "Add"
+msgstr "Dodaj"
+
<table id="restore-browser">
<tr>
<td rowspan="2">
+ <div id="restore-browser-files-loading" style="display: none"></div>
<div id="restore-browser-files">
<com:TActiveDataGrid
ID="DataGridFiles"
<prop:ItemTemplate>
<com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
<img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file' %>" /> <%=($this->getParent()->Data['name'] != '/') ? preg_replace('/\/$/', '', $this->getParent()->Data['name']) : '/'%>
+ <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : null%>" ActiveControl.EnableUpdate="false" Visible="<%=!in_array($this->getParent()->Data['name'], $this->getPage()->excludedElementsFromAdd)%>" Text="<%[ Add ]%>" />
</com:TDraggable>
<com:TCallback ID="FileElementCall" OnCallback="Page.getVersions" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['name'] . '|' . @$this->getParent()->Data['pathid'] . '|' . @$this->getParent()->Data['filenameid'] . '|' . @$this->getParent()->Data['jobid']%>">
+ <prop:ClientSide.OnLoading>
+ $('restore-browser-files-loading').show();
+ </prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- <%=$this->getPage()->UniqueID%>_lock = false;
+ $('restore-browser-files-loading').hide();
</prop:ClientSide.OnComplete>
</com:TCallback>
<script type="text/javascript">
- $('<%=$this->FileElementLeft->ClientID%>').observe('mouseup', function(event) {
- event.findElement('div').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
- $('<%=$this->FileElementLeft->ClientID%>').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
+ document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
+ event.findElement('div').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
+ $('<%=$this->FileElementLeft->ClientID%>').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
});
- var <%=$this->getPage()->UniqueID%>_lock;
-
- $('<%=$this->FileElementLeft->ClientID%>').up('tr').observe('dblclick', function(event) {
- if(<%=$this->getPage()->UniqueID%>_lock){
+ document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
+ var el = event.target || event.srcElement;
+ var vposition = $(el).getStyle('left');
+ if(vposition == null || vposition == '0px'){
event.stop();
} else {
var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
request.dispatch();
- <%=$this->getPage()->UniqueID%>_lock = true;
}
- }.bind(<%=$this->getPage()->UniqueID%>_lock));
+ });
</script>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
>
<prop:EmptyTemplate>
<div class="file-browser-watermark">
- <%[ For see a file versions please double click file on the left files browser. ]%>
+ <%[ For see a file versions please click file on the left files browser. ]%>
</div>
</prop:EmptyTemplate>
<com:TActiveTemplateColumn>
<prop:ItemTemplate>
- <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable">
+ <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
<img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
<com:TLabel Text="<%=$this->getParent()->Data['name']%>" Width="50%" /> <%=is_array($this->getParent()->Data['lstat']) && array_key_exists('mtime', $this->getParent()->Data['lstat']) ? date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime']) : ''%>
</com:TDraggable>
+ <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : false%>" ActiveControl.EnableUpdate="false" Text="<%[ Add ]%>"/>
<script type="text/javascript">
$('<%=$this->FileElementToRestore->ClientID%>').observe('mouseup', function(event) {
event.findElement('div').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
>
<prop:EmptyTemplate>
<div class="file-browser-watermark" style="padding: 50px 10px">
- <%[ For add a file to restore please drag a file from frame on left or from above frame and drop it here ]%>
+ <%[ For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here ]%>
</div>
</prop:EmptyTemplate>
<com:TActiveTemplateColumn>
Prado::using('System.Exceptions.TException');
Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
Prado::using('System.Web.UI.ActiveControls.TActiveImageButton');
Prado::using('System.Web.UI.ActiveControls.TDropContainer');
Prado::using('System.Web.UI.ActiveControls.TDraggable');
private $browserRootDir = array('name' => '.', 'type' => 'dir');
private $browserUpDir = array('name' => '..', 'type' => 'dir');
+ public $excludedElementsFromAdd = array('.', '..');
+
const BVFS_PATH_PREFIX = 'b2';
public function onInit($param) {
}
public function addFileToRestore($sender, $param) {
- $control=$param->getDroppedControl();
- $item=$control->getNamingContainer();
- list(, , , $dragElementID, , ) = explode('_', $param->getDragElementID(), 6); // I know that it is ugly.
- if($dragElementID == $this->VersionsDataGrid->ID) {
- $fileid = $this->VersionsDataGrid->getDataKeys()->itemAt($item->getItemIndex());
+ $fileid = null;
+ if (isset($param->callbackParameter)) {
+ list(, , , $sourceElementID, , ) = explode('_', $sender->ClientID, 6);
+ $fileid = $param->callbackParameter;
+ } else {
+ $control = $param->getDroppedControl();
+ $item = $control->getNamingContainer();
+ list(, , , $sourceElementID, , ) = explode('_', $param->getDragElementID(), 6); // I know that it is ugly.
+ }
+ if($sourceElementID == $this->VersionsDataGrid->ID) {
+ if (is_null($fileid)) {
+ $fileid = $this->VersionsDataGrid->getDataKeys()->itemAt($item->getItemIndex());
+ }
$fileProperties = $this->getFileVersions($fileid);
} else {
- $fileid = $this->DataGridFiles->getDataKeys()->itemAt($item->getItemIndex());
+ if (is_null($fileid)) {
+ $fileid = $this->DataGridFiles->getDataKeys()->itemAt($item->getItemIndex());
+ }
$fileProperties = $this->getBrowserFile($fileid);
}
if($fileProperties['name'] != $this->browserRootDir['name'] && $fileProperties['name'] != $this->browserUpDir['name']) {
height: 206px;
}
+#restore-browser-files-loading {
+ position: absolute;
+ z-index: 10;
+ width: 347px;
+ height: 438px;
+ border-radius: 4px;
+ background: rgba(182,182,182,0.7) url('progress.gif') no-repeat center center;
+}
+
.file-browser-watermark {
padding: 64px 10px;
text-align: center;
div.button-prev-next {
margin-left: 84px
}
+
+a.link {
+ color: #3f4449;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a.link:hover {
+ text-decoration: underline;
+}