diff --git a/CHANGELOG b/CHANGELOG
index 5210baca5..0c4e93f82 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -191,6 +191,7 @@
- remove document/folder from index before adding a new one after editing the
meta data
- 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
diff --git a/inc/inc.ClassExtBase.php b/inc/inc.ClassExtBase.php
index 1c63891b6..10237b04a 100644
--- a/inc/inc.ClassExtBase.php
+++ b/inc/inc.ClassExtBase.php
@@ -30,8 +30,10 @@
*/
class SeedDMS_ExtBase {
var $settings;
+ var $dms;
- public function __construct($settings) {
+ public function __construct($settings, $dms) {
$this->settings = $settings;
+ $this->dms = $dms;
}
}
diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php
index c75a2fb7c..81caa4536 100644
--- a/inc/inc.ClassExtensionMgr.php
+++ b/inc/inc.ClassExtensionMgr.php
@@ -308,19 +308,21 @@ class SeedDMS_Extension_Mgr {
* @param SeedDMS_Core_DMS $dms
* @return boolean true on success, false on error
*/
- public function migrate($extname, $dms) { /* {{{ */
+ public function migrate($extname, $settings, $dms) { /* {{{ */
if(!isset($this->extconf[$extname]))
return false;
$extconf = $this->extconf[$extname];
+ $ret = null;
if(isset($extconf['class']) && isset($extconf['class']['file']) && isset($extconf['class']['name'])) {
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
if(file_exists($classfile)) {
- include($classfile);
- $obj = new $extconf['class']['name']($settings);
+ require_once($classfile);
+ $obj = new $extconf['class']['name']($settings, $dms);
if(method_exists($obj, 'migrate'))
- $obj->migrate(isset($settings->_extensions[$extname]) ? $settings->_extensions[$extname] : null);
+ $ret = $obj->migrate();
}
}
+ return $ret;
} /* }}} */
/**
diff --git a/inc/inc.ClassViewCommon.php b/inc/inc.ClassViewCommon.php
index 2f9ce8f08..b9672056a 100644
--- a/inc/inc.ClassViewCommon.php
+++ b/inc/inc.ClassViewCommon.php
@@ -88,6 +88,10 @@ class SeedDMS_View_Common {
$this->baseurl = $baseurl;
}
+ public function getTheme() {
+ return $this->theme;
+ }
+
public function show() {
}
diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php
index 6e685e010..42a3f73ef 100644
--- a/inc/inc.Extension.php
+++ b/inc/inc.Extension.php
@@ -44,9 +44,9 @@ foreach($extMgr->getExtensionConfiguration() as $extname=>$extconf) {
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
if(file_exists($classfile)) {
include($classfile);
- $obj = new $extconf['class']['name']($settings);
+ $obj = new $extconf['class']['name']($settings, null);
if(method_exists($obj, 'init'))
- $obj->init(isset($settings->_extensions[$extname]) ? $settings->_extensions[$extname] : null);
+ $obj->init();
}
}
if(isset($extconf['language']['file'])) {
diff --git a/op/op.ExtensionMgr.php b/op/op.ExtensionMgr.php
index 5ccf6d41d..1eddfabb2 100644
--- a/op/op.ExtensionMgr.php
+++ b/op/op.ExtensionMgr.php
@@ -131,7 +131,7 @@ elseif ($action == "getlist") { /* {{{ */
} /* }}} */
elseif ($action == "toggle") { /* {{{ */
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"]);
if (!file_exists($settings->_rootDir.'/ext/'.$extname) ) {
@@ -140,9 +140,21 @@ elseif ($action == "toggle") { /* {{{ */
$controller->setParam('extmgr', $extMgr);
$controller->setParam('extname', $extname);
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 {
- 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();
} /* }}} */
diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php
index 5ff3c287f..c4858d95f 100644
--- a/views/bootstrap/class.Bootstrap.php
+++ b/views/bootstrap/class.Bootstrap.php
@@ -1239,6 +1239,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$icons["zip"] = "package.svg";
$icons["rar"] = "package.svg";
$icons["mpg"] = "video.svg";
+ $icons["mp4"] = "video.svg";
$icons["avi"] = "video.svg";
$icons["webm"] = "video.svg";
$icons["mkv"] = "video.svg";
diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php
index 7d7a31f2f..30b491764 100644
--- a/views/bootstrap/class.ViewFolder.php
+++ b/views/bootstrap/class.ViewFolder.php
@@ -130,7 +130,7 @@ function folderSelectedmaintree(id, name) {
}
-function loadMoreObjects(element, limit) {
+function loadMoreObjects(element, limit, orderby) {
if(!$(element).is(":visible"))
return;
element.text('= getMLText('more_objects_loading') ?>');
@@ -138,7 +138,7 @@ function loadMoreObjects(element, limit) {
var folder = element.data('folder')
var offset = element.data('offset')
// 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({
type: 'GET',
url: url,
@@ -158,11 +158,11 @@ function loadMoreObjects(element, limit) {
}
$(window).scroll(function() {
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) {
- loadMoreObjects($(this), $(this).data('all'));
+ loadMoreObjects($(this), $(this).data('all'), $(this).data('orderby'));
});
@@ -426,7 +426,7 @@ $('body').on('click', '.order-btn', function(ev) {
echo "\n\n";
if($maxItemsPerPage && $i > $maxItemsPerPage)
- echo "";
+ echo "";
}
else printMLText("empty_folder_list");