mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
df76dbf35a
|
@ -191,6 +191,7 @@
|
||||||
- remove document/folder from index before adding a new one after editing the
|
- remove document/folder from index before adding a new one after editing the
|
||||||
meta data
|
meta data
|
||||||
- fix potential clickjacking attack with manipulated email address of a user
|
- fix potential clickjacking attack with manipulated email address of a user
|
||||||
|
- loading more items on ViewFolder page obeys sort order
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.21
|
Changes in version 5.1.21
|
||||||
|
|
|
@ -30,8 +30,10 @@
|
||||||
*/
|
*/
|
||||||
class SeedDMS_ExtBase {
|
class SeedDMS_ExtBase {
|
||||||
var $settings;
|
var $settings;
|
||||||
|
var $dms;
|
||||||
|
|
||||||
public function __construct($settings) {
|
public function __construct($settings, $dms) {
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
|
$this->dms = $dms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,19 +308,21 @@ class SeedDMS_Extension_Mgr {
|
||||||
* @param SeedDMS_Core_DMS $dms
|
* @param SeedDMS_Core_DMS $dms
|
||||||
* @return boolean true on success, false on error
|
* @return boolean true on success, false on error
|
||||||
*/
|
*/
|
||||||
public function migrate($extname, $dms) { /* {{{ */
|
public function migrate($extname, $settings, $dms) { /* {{{ */
|
||||||
if(!isset($this->extconf[$extname]))
|
if(!isset($this->extconf[$extname]))
|
||||||
return false;
|
return false;
|
||||||
$extconf = $this->extconf[$extname];
|
$extconf = $this->extconf[$extname];
|
||||||
|
$ret = null;
|
||||||
if(isset($extconf['class']) && isset($extconf['class']['file']) && isset($extconf['class']['name'])) {
|
if(isset($extconf['class']) && isset($extconf['class']['file']) && isset($extconf['class']['name'])) {
|
||||||
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
|
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
|
||||||
if(file_exists($classfile)) {
|
if(file_exists($classfile)) {
|
||||||
include($classfile);
|
require_once($classfile);
|
||||||
$obj = new $extconf['class']['name']($settings);
|
$obj = new $extconf['class']['name']($settings, $dms);
|
||||||
if(method_exists($obj, 'migrate'))
|
if(method_exists($obj, 'migrate'))
|
||||||
$obj->migrate(isset($settings->_extensions[$extname]) ? $settings->_extensions[$extname] : null);
|
$ret = $obj->migrate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $ret;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -88,6 +88,10 @@ class SeedDMS_View_Common {
|
||||||
$this->baseurl = $baseurl;
|
$this->baseurl = $baseurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTheme() {
|
||||||
|
return $this->theme;
|
||||||
|
}
|
||||||
|
|
||||||
public function show() {
|
public function show() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@ foreach($extMgr->getExtensionConfiguration() as $extname=>$extconf) {
|
||||||
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
|
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
|
||||||
if(file_exists($classfile)) {
|
if(file_exists($classfile)) {
|
||||||
include($classfile);
|
include($classfile);
|
||||||
$obj = new $extconf['class']['name']($settings);
|
$obj = new $extconf['class']['name']($settings, null);
|
||||||
if(method_exists($obj, 'init'))
|
if(method_exists($obj, 'init'))
|
||||||
$obj->init(isset($settings->_extensions[$extname]) ? $settings->_extensions[$extname] : null);
|
$obj->init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($extconf['language']['file'])) {
|
if(isset($extconf['language']['file'])) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ elseif ($action == "getlist") { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
elseif ($action == "toggle") { /* {{{ */
|
elseif ($action == "toggle") { /* {{{ */
|
||||||
if (!isset($_POST["extname"])) {
|
if (!isset($_POST["extname"])) {
|
||||||
echo json_encode(array('success'=>false, 'msg'=>'Could not toggle extension'));
|
echo json_encode(array('success'=>false, 'msg'=>getMLText('extension_missing_name')));
|
||||||
}
|
}
|
||||||
$extname = trim($_POST["extname"]);
|
$extname = trim($_POST["extname"]);
|
||||||
if (!file_exists($settings->_rootDir.'/ext/'.$extname) ) {
|
if (!file_exists($settings->_rootDir.'/ext/'.$extname) ) {
|
||||||
|
@ -140,9 +140,21 @@ elseif ($action == "toggle") { /* {{{ */
|
||||||
$controller->setParam('extmgr', $extMgr);
|
$controller->setParam('extmgr', $extMgr);
|
||||||
$controller->setParam('extname', $extname);
|
$controller->setParam('extname', $extname);
|
||||||
if (!$controller($_POST)) {
|
if (!$controller($_POST)) {
|
||||||
echo json_encode(array('success'=>false, 'msg'=>'Could not toggle extension'));
|
echo json_encode(array('success'=>false, 'msg'=>getMLText('extinsion_toggle_error')));
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('success'=>true, 'msg'=>'Operation succeded'));
|
if($settings->extensionIsDisabled($extname))
|
||||||
|
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_is_off_now')));
|
||||||
|
else {
|
||||||
|
$ret = $extMgr->migrate($extname, $settings, $dms);
|
||||||
|
if($ret !== null) {
|
||||||
|
if($ret === true)
|
||||||
|
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_migration_success')));
|
||||||
|
else
|
||||||
|
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_migration_error')));
|
||||||
|
} else {
|
||||||
|
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_is_on_now')));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
add_log_line();
|
add_log_line();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
|
@ -1239,6 +1239,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
$icons["zip"] = "package.svg";
|
$icons["zip"] = "package.svg";
|
||||||
$icons["rar"] = "package.svg";
|
$icons["rar"] = "package.svg";
|
||||||
$icons["mpg"] = "video.svg";
|
$icons["mpg"] = "video.svg";
|
||||||
|
$icons["mp4"] = "video.svg";
|
||||||
$icons["avi"] = "video.svg";
|
$icons["avi"] = "video.svg";
|
||||||
$icons["webm"] = "video.svg";
|
$icons["webm"] = "video.svg";
|
||||||
$icons["mkv"] = "video.svg";
|
$icons["mkv"] = "video.svg";
|
||||||
|
|
|
@ -130,7 +130,7 @@ function folderSelectedmaintree(id, name) {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
<?php if($maxItemsPerPage) { ?>
|
<?php if($maxItemsPerPage) { ?>
|
||||||
function loadMoreObjects(element, limit) {
|
function loadMoreObjects(element, limit, orderby) {
|
||||||
if(!$(element).is(":visible"))
|
if(!$(element).is(":visible"))
|
||||||
return;
|
return;
|
||||||
element.text('<?= getMLText('more_objects_loading') ?>');
|
element.text('<?= getMLText('more_objects_loading') ?>');
|
||||||
|
@ -138,7 +138,7 @@ function loadMoreObjects(element, limit) {
|
||||||
var folder = element.data('folder')
|
var folder = element.data('folder')
|
||||||
var offset = element.data('offset')
|
var offset = element.data('offset')
|
||||||
// var limit = element.data('limit')
|
// var limit = element.data('limit')
|
||||||
url = seeddms_webroot+"out/out.ViewFolder.php?action=entries&folderid="+folder+"&offset="+offset+"&limit="+limit<?= $orderby ? '+"&orderby='.$orderby.'"' : "" ?>;
|
url = seeddms_webroot+"out/out.ViewFolder.php?action=entries&folderid="+folder+"&offset="+offset+"&limit="+limit+"&orderby="+orderby;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: url,
|
url: url,
|
||||||
|
@ -158,11 +158,11 @@ function loadMoreObjects(element, limit) {
|
||||||
}
|
}
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
if($(window).scrollTop() + $(window).height() == $(document).height()) {
|
if($(window).scrollTop() + $(window).height() == $(document).height()) {
|
||||||
loadMoreObjects($('#loadmore'), $('#loadmore').data('limit'));
|
loadMoreObjects($('#loadmore'), $('#loadmore').data('limit'), $('#loadmore').data('orderby'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('body').on('click', '#loadmore', function(e) {
|
$('body').on('click', '#loadmore', function(e) {
|
||||||
loadMoreObjects($(this), $(this).data('all'));
|
loadMoreObjects($(this), $(this).data('all'), $(this).data('orderby'));
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
@ -426,7 +426,7 @@ $('body').on('click', '.order-btn', function(ev) {
|
||||||
echo "</tbody>\n</table>\n";
|
echo "</tbody>\n</table>\n";
|
||||||
|
|
||||||
if($maxItemsPerPage && $i > $maxItemsPerPage)
|
if($maxItemsPerPage && $i > $maxItemsPerPage)
|
||||||
echo "<button id=\"loadmore\" style=\"width: 100%; margin-bottom: 20px;\" class=\"btn btn-secondary\" data-folder=\"".$folder->getId()."\"data-offset=\"".$maxItemsPerPage."\" data-limit=\"".$incItemsPerPage."\" data-all=\"".($i-$maxItemsPerPage)."\">".getMLText('x_more_objects', array('number'=>($i-$maxItemsPerPage)))."</button>";
|
echo "<button id=\"loadmore\" style=\"width: 100%; margin-bottom: 20px;\" class=\"btn btn-secondary\" data-folder=\"".$folder->getId()."\"data-offset=\"".$maxItemsPerPage."\" data-limit=\"".$incItemsPerPage."\" data-orderby=\"".$orderby."\" data-all=\"".($i-$maxItemsPerPage)."\">".getMLText('x_more_objects', array('number'=>($i-$maxItemsPerPage)))."</button>";
|
||||||
}
|
}
|
||||||
else printMLText("empty_folder_list");
|
else printMLText("empty_folder_list");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user