зеркало из https://github.com/nextcloud/activity.git
Merge pull request #20 from owncloud/issue/9
Remove search for activities
This commit is contained in:
Коммит
2485d7db2a
|
@ -38,8 +38,5 @@ OCA\Activity\Hooks::register();
|
|||
// Personal settings for notifications and emails
|
||||
OCP\App::registerPersonal('activity', 'personal');
|
||||
|
||||
// Search
|
||||
OC_Search::registerProvider('\OCA\Activity\Search');
|
||||
|
||||
// Cron job for sending Emails
|
||||
OCP\Backgroundjob::registerJob('OCA\Activity\BackgroundJob\EmailNotification');
|
||||
|
|
62
lib/ocs.php
62
lib/ocs.php
|
@ -1,62 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Activities App
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2013 Frank Karlitschek frank@owncloud.org
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
namespace OCA\Activity;
|
||||
|
||||
use \OC_OCS_Result;
|
||||
|
||||
/**
|
||||
* @brief The class to handle the filesystem hooks
|
||||
*/
|
||||
class OCS {
|
||||
|
||||
/**
|
||||
* @brief Registers the filesystem hooks for basic filesystem operations. All other events has to be triggered by the apps.
|
||||
*/
|
||||
public static function getActivities() {
|
||||
|
||||
$start = isset($_GET['start']) ? $_GET['start'] : 0;
|
||||
$count = isset($_GET['count']) ? $_GET['count'] : 30;
|
||||
|
||||
$data = Data::read($start,$count);
|
||||
$activities = array();
|
||||
|
||||
foreach($data as $d) {
|
||||
$activity = array();
|
||||
$activity['id'] = $d['activity_id'];
|
||||
$activity['subject'] = $d['subject'];
|
||||
$activity['message'] = $d['message'];
|
||||
$activity['file'] = $d['file'];
|
||||
$activity['link'] = $d['link'];
|
||||
$activity['date'] = date('c', $d['timestamp']);
|
||||
|
||||
$activities[] = $activity;
|
||||
}
|
||||
|
||||
return new OC_OCS_Result($activities);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Activities App
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2013 Frank Karlitschek frank@owncloud.org
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
namespace OCA\Activity;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Class for provide search results for the system search
|
||||
*/
|
||||
class Search extends \OC_Search_Provider{
|
||||
|
||||
/**
|
||||
* @brief Search in the activities and return search results
|
||||
* @param $query
|
||||
* @return search results
|
||||
*/
|
||||
function search($query){
|
||||
|
||||
$data = Data::search($query, 100);
|
||||
|
||||
$results = array();
|
||||
foreach($data as $d){
|
||||
$file = $d['file'];
|
||||
$results[] = new \OC_Search_Result(
|
||||
basename($file),
|
||||
$d['subject'].' ('.\OCP\Util::formatDate($d['timestamp']).')',
|
||||
\OC_Helper::linkTo( 'activity', 'index.php' ), 'Activity', dirname($file));
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
Загрузка…
Ссылка в новой задаче