diff --git a/core/src/plugins/access.fs/class.fsAccessDriver.php b/core/src/plugins/access.fs/class.fsAccessDriver.php index 8a946130f5..12887d2e4b 100644 --- a/core/src/plugins/access.fs/class.fsAccessDriver.php +++ b/core/src/plugins/access.fs/class.fsAccessDriver.php @@ -1963,7 +1963,7 @@ public function makeSharedRepositoryOptions($httpVars, $repository) $newOptions = array( "PATH" => $repository->getOption("PATH").AJXP_Utils::decodeSecureMagic($httpVars["file"]), "CREATE" => false, - "RECYCLE_BIN" => "", + "RECYCLE_BIN" => isSet($httpVars["inherit_recycle"])? $repository->getOption("RECYCLE_BIN") : "", "DEFAULT_RIGHTS" => ""); if ($repository->getOption("USE_SESSION_CREDENTIALS")===true) { $newOptions["ENCODED_CREDENTIALS"] = AJXP_Safe::getEncodedCredentialString(); diff --git a/core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php b/core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php index 9fece68793..0a5b85b3f1 100755 --- a/core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php +++ b/core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php @@ -122,7 +122,9 @@ public function loadUserFeed($actionName, $httpVars, $fileVars) if($rightString == "r" | $rightString == "rw") $authRepos[] = $repoId; } } - $res = $this->eventStore->loadEvents($authRepos, $userId, $userGroup, 0, 10); + $offset = isSet($httpVars["offset"]) ? intval($httpVars["offset"]): 0; + $limit = isSet($httpVars["limit"]) ? intval($httpVars["limit"]): 15; + $res = $this->eventStore->loadEvents($authRepos, $userId, $userGroup, $offset, $limit, (isSet($httpVars["repository_id"])?false:true)); $mess = ConfService::getMessages(); $format = "html"; if (isSet($httpVars["format"])) { diff --git a/core/src/plugins/core.notifications/interface.AJXP_FeedStore.php b/core/src/plugins/core.notifications/interface.AJXP_FeedStore.php index aea640a59c..0767d84c21 100644 --- a/core/src/plugins/core.notifications/interface.AJXP_FeedStore.php +++ b/core/src/plugins/core.notifications/interface.AJXP_FeedStore.php @@ -47,9 +47,10 @@ public function persistEvent($hookName, $data, $repositoryId, $repositoryScope, * @param string $userGroup * @param integer $offset * @param integer $limit + * @param boolean $enlargeToOwned * @return AJXP_Notification[] */ - public function loadEvents($filterByRepositories, $userId, $userGroup, $offset = 0, $limit = 10); + public function loadEvents($filterByRepositories, $userId, $userGroup, $offset = 0, $limit = 10, $enlargeToOwned = true); /** * @abstract diff --git a/core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php b/core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php index 9d1df04da2..6ab24c2a7e 100644 --- a/core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php +++ b/core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php @@ -90,12 +90,13 @@ public function persistEvent($hookName, $data, $repositoryId, $repositoryScope, * @param integer $limit * @return An array of stdClass objects with keys hookname, arguments, author, date, repository */ - public function loadEvents($filterByRepositories, $userId, $userGroup, $offset = 0, $limit = 10) + public function loadEvents($filterByRepositories, $userId, $userGroup, $offset = 0, $limit = 10, $enlargeToOwned = true) { if($this->sqlDriver["password"] == "XXXX") return array(); require_once(AJXP_BIN_FOLDER."/dibi.compact.php"); dibi::connect($this->sqlDriver); - $res = dibi::query("SELECT * FROM [ajxp_feed] WHERE [etype] = %s AND + if ($enlargeToOwned) { + $res = dibi::query("SELECT * FROM [ajxp_feed] WHERE [etype] = %s AND ( [repository_id] IN (%s) OR [repository_owner] = %s ) AND ( [repository_scope] = 'ALL' @@ -103,6 +104,16 @@ public function loadEvents($filterByRepositories, $userId, $userGroup, $offset = OR ([repository_scope] = 'GROUP' AND [user_group] = %s ) ) ORDER BY [edate] DESC %lmt %ofs", "event", $filterByRepositories, $userId, $userId, $userGroup, $limit, $offset); + } else { + $res = dibi::query("SELECT * FROM [ajxp_feed] WHERE [etype] = %s AND + ( [repository_id] IN (%s)) + AND ( + [repository_scope] = 'ALL' + OR ([repository_scope] = 'USER' AND [user_id] = %s ) + OR ([repository_scope] = 'GROUP' AND [user_group] = %s ) + ) + ORDER BY [edate] DESC %lmt %ofs", "event", $filterByRepositories, $userId, $userGroup, $limit, $offset); + } $data = array(); foreach ($res as $n => $row) { $object = new stdClass(); diff --git a/core/src/plugins/meta.comments/class.CommentsMetaManager.php b/core/src/plugins/meta.comments/class.CommentsMetaManager.php index c39db14451..bb5a3400d4 100644 --- a/core/src/plugins/meta.comments/class.CommentsMetaManager.php +++ b/core/src/plugins/meta.comments/class.CommentsMetaManager.php @@ -135,7 +135,7 @@ public function switchActions($actionName, $httpVars, $fileVars) HTMLWriter::charsetHeader("application/json"); if ($feedStore !== false) { - $data = $feedStore->findMetaObjectsByIndexPath(ConfService::getRepository()->getId(), $uniqNode->getPath(), AuthService::getLoggedUser()->getId(), AuthService::getLoggedUser()->getGroupPath(), 0, 20, "date", "asc"); + $data = $feedStore->findMetaObjectsByIndexPath(ConfService::getRepository()->getId(), $uniqNode->getPath(), AuthService::getLoggedUser()->getId(), AuthService::getLoggedUser()->getGroupPath(), 0, 100, "date", "asc"); $theFeed = array(); foreach ($data as $stdObject) { $rPath = substr($stdObject->path, strlen($uniqNode->getPath())); @@ -150,7 +150,7 @@ public function switchActions($actionName, $httpVars, $fileVars) "rpath" => $rPath ); if (isSet($previous) && $previous["author"] == $newItem["author"] && $previous["path"] == $newItem["path"] && $previous["hdate"] == $newItem["hdate"] ) { - $theFeed[count($theFeed) - 1]["content"].= $newItem["content"]; + $theFeed[count($theFeed) - 1]["content"].= '
--
'.$newItem["content"]; } else { $theFeed[] = $newItem; diff --git a/core/src/plugins/meta.comments/class.CommentsPanel.js b/core/src/plugins/meta.comments/class.CommentsPanel.js index 6d05dc4c3b..4db7d5ad9c 100644 --- a/core/src/plugins/meta.comments/class.CommentsPanel.js +++ b/core/src/plugins/meta.comments/class.CommentsPanel.js @@ -17,6 +17,43 @@ * * The latest code can be found at . */ + + +(function() { + var autoLink, + __slice = [].slice; + + autoLink = function() { + var k, linkAttributes, option, options, pattern, v; + options = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + pattern = /(^|\s)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi; + if (!(options.length > 0)) { + return this.replace(pattern, "$1$2"); + } + option = options[0]; + linkAttributes = ((function() { + var _results; + _results = []; + for (k in option) { + v = option[k]; + if (k !== 'callback') { + _results.push(" " + k + "='" + v + "'"); + } + } + return _results; + })()).join(''); + return this.replace(pattern, function(match, space, url) { + var link; + link = (typeof option.callback === "function" ? option.callback(url) : void 0) || ("" + url + ""); + return "" + space + link; + }); + }; + + String.prototype['autoLink'] = autoLink; + +}).call(this); + + Class.create("CommentsPanel", { // Warning, method is called statically, there is no "this" @@ -108,6 +145,7 @@ Class.create("CommentsPanel", { commentObjectToDOM: function(hash, container, node, skipAnim){ var pFactory = new PreviewFactory(); + hash.set('content', hash.get('content').autoLink({target:'_blank'})); var tpl = new Template('
#{author}, #{hdate}
#{content}
'); var el = new Element("div", {className:'comment_content'}).update(tpl.evaluate(hash._object)); if(hash.get('rpath')){ diff --git a/core/src/plugins/meta.comments/comments_feed.css b/core/src/plugins/meta.comments/comments_feed.css index ec0bc31054..bd21604838 100644 --- a/core/src/plugins/meta.comments/comments_feed.css +++ b/core/src/plugins/meta.comments/comments_feed.css @@ -82,6 +82,16 @@ div.double #comments_form textarea, div.triple #comments_form textarea{ padding: 5px; } +.comment_text_content a{ + display: inline !important; + background-color: transparent !important; + font-size: inherit !important; + cursor: pointer !important; + margin: 0 !important; + border: 0 !important; + padding: 0 !important; +} + .foldedPanel_tooltip .comment_legend{ display: none; }