improved url generation - made use of OC.linkTo() for linking to versions history page
This commit is contained in:
parent
c99d7dd94f
commit
d98d72aa99
|
@ -54,8 +54,8 @@ if ( isset( $_GET['path'] ) ) {
|
||||||
// show the history only if there is something to show
|
// show the history only if there is something to show
|
||||||
if( OCA_Versions\Storage::isversioned( $path ) ) {
|
if( OCA_Versions\Storage::isversioned( $path ) ) {
|
||||||
|
|
||||||
$count=999; //show the newest revisions
|
$count = 999; //show the newest revisions
|
||||||
$versions=OCA_Versions\Storage::getversions( $path, $count);
|
$versions = OCA_Versions\Storage::getversions( $path, $count );
|
||||||
|
|
||||||
$tmpl->assign( 'versions', array_reverse( $versions ) );
|
$tmpl->assign( 'versions', array_reverse( $versions ) );
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ $(document).ready(function(){
|
||||||
|
|
||||||
function createVersionsDropdown(filename, files) {
|
function createVersionsDropdown(filename, files) {
|
||||||
|
|
||||||
var historyUrl = '../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
|
var historyUrl = OC.linkTo('files_versions', 'history.php?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ) )
|
||||||
|
|
||||||
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
|
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
|
||||||
html += '<div id="private">';
|
html += '<div id="private">';
|
||||||
html += '<select data-placeholder="File Version" id="found_versions" class="chzen-select">';
|
html += '<select data-placeholder="File Version" id="found_versions" class="chzen-select">';
|
||||||
|
|
Loading…
Reference in New Issue