diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-05-05 10:18:45 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-05-05 10:18:45 +0200 |
commit | 9bcc5c11a8785a567ded6c0e4ab3a40966785606 (patch) | |
tree | cb50df0695f11fb8132a35e214caa8cd211bb9a2 /apps | |
parent | 4a89eb77c1732a49075d4f3f6a46ddaad10eef70 (diff) | |
download | nextcloud-server-9bcc5c11a8785a567ded6c0e4ab3a40966785606.tar.gz nextcloud-server-9bcc5c11a8785a567ded6c0e4ab3a40966785606.zip |
porting the hooks and starting with the templates
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/calendar/appinfo/app.php | 2 | ||||
-rwxr-xr-x | apps/calendar/index.php | 2 | ||||
-rwxr-xr-x | apps/calendar/lib/app.php | 2 | ||||
-rwxr-xr-x | apps/contacts/appinfo/app.php | 6 | ||||
-rwxr-xr-x | apps/files_archive/appinfo/app.php | 2 | ||||
-rwxr-xr-x | apps/files_encryption/appinfo/app.php | 2 | ||||
-rwxr-xr-x | apps/files_sharing/appinfo/app.php | 12 | ||||
-rwxr-xr-x | apps/files_sharing/lib_share.php | 4 | ||||
-rwxr-xr-x | apps/files_versions/appinfo/app.php | 2 | ||||
-rwxr-xr-x | apps/gallery/lib/hooks_handlers.php | 6 | ||||
-rwxr-xr-x | apps/media/lib_media.php | 8 |
11 files changed, 24 insertions, 24 deletions
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index 7b5db834fb5..b02fc602c6b 100755 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -7,7 +7,7 @@ OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php'; OC::$CLASSPATH['OC_Calendar_Share'] = 'apps/calendar/lib/share.php'; OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php'; -OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'); +OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'); OCP\Util::addscript('calendar','loader'); OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min"); OCP\Util::addStyle("3rdparty", "chosen/chosen"); diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 3a3915b9669..5aee5f6ace8 100755 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -25,7 +25,7 @@ foreach($calendars as $calendar){ $eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true'); $eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false'); -OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources)); +OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources)); $categories = OC_Calendar_App::getCategoryOptions(); //Fix currentview for fullcalendar diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index f955c59603d..eb440b5794b 100755 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -338,7 +338,7 @@ class OC_Calendar_App{ OCP\Response::setETagHeader($calendar['ctag']); $events = OC_Calendar_Object::allInPeriod($calendar_id, $start, $end); } else { - OC_Hook::emit('OC_Calendar', 'getEvents', array('calendar_id' => $calendar_id, 'events' => &$events)); + OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendar_id, 'events' => &$events)); } } return $events; diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index 4808ea5fa83..e5e1d572f2d 100755 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -5,9 +5,9 @@ OC::$CLASSPATH['OC_Contacts_VCard'] = 'apps/contacts/lib/vcard.php'; OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/connector_sabre.php'; OC::$CLASSPATH['OC_Search_Provider_Contacts'] = 'apps/contacts/lib/search.php'; -OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser'); -OC_HOOK::connect('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents'); -OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources'); +OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser'); +OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents'); +OCP\Util::connectHook('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources'); OCP\App::register( array( 'order' => 10, diff --git a/apps/files_archive/appinfo/app.php b/apps/files_archive/appinfo/app.php index 0b156ced277..67376c4a03a 100755 --- a/apps/files_archive/appinfo/app.php +++ b/apps/files_archive/appinfo/app.php @@ -8,6 +8,6 @@ OC::$CLASSPATH['OC_Filestorage_Archive']='apps/files_archive/lib/storage.php'; -OC_Hook::connect('OC_Filesystem','get_mountpoint','OC_Filestorage_Archive','autoMount'); +OCP\Util::connectHook('OC_Filesystem','get_mountpoint','OC_Filestorage_Archive','autoMount'); OCP\Util::addscript( 'files_archive', 'archive' ); diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index 02fc9dfa267..679d0b95edc 100755 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -6,7 +6,7 @@ OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php OC_FileProxy::register(new OC_FileProxy_Encryption()); -OC_Hook::connect('OC_User','post_login','OC_Crypt','loginListener'); +OCP\Util::connectHook('OC_User','post_login','OC_Crypt','loginListener'); stream_wrapper_register('crypt','OC_CryptStream'); diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index f80bdb9e195..bd81a45cc55 100755 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -4,12 +4,12 @@ require_once('apps/files_sharing/sharedstorage.php'); OC::$CLASSPATH['OC_Share'] = "apps/files_sharing/lib_share.php"; OCP\App::registerAdmin('files_sharing', 'settings'); -OC_Hook::connect("OC_Filesystem", "post_delete", "OC_Share", "deleteItem"); -OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Share", "renameItem"); -OC_Hook::connect("OC_Filesystem", "post_write", "OC_Share", "updateItem"); -OC_Hook::connect('OC_User', 'post_deleteUser', 'OC_Share', 'removeUser'); -OC_Hook::connect('OC_User', 'post_addToGroup', 'OC_Share', 'addToGroupShare'); -OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OC_Share', 'removeFromGroupShare'); +OCP\Util::connectHook("OC_Filesystem", "post_delete", "OC_Share", "deleteItem"); +OCP\Util::connectHook("OC_Filesystem", "post_rename", "OC_Share", "renameItem"); +OCP\Util::connectHook("OC_Filesystem", "post_write", "OC_Share", "updateItem"); +OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Share', 'removeUser'); +OCP\Util::connectHook('OC_User', 'post_addToGroup', 'OC_Share', 'addToGroupShare'); +OCP\Util::connectHook('OC_User', 'post_removeFromGroup', 'OC_Share', 'removeFromGroupShare'); $dir = isset($_GET['dir']) ? $_GET['dir'] : '/'; if ($dir != '/Shared' || OCP\Config::getAppValue('files_sharing', 'resharing', 'yes') == 'yes') { OCP\Util::addscript("files_sharing", "share"); diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index fe8aa64fa81..71cca309776 100755 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -410,7 +410,7 @@ class OC_Share { $source = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['path']); if ($target = self::getTarget($source)) { // Forward hook to notify of changes to target file - OC_Hook::emit("OC_Filesystem", "post_delete", array('path' => $target)); + OCP\Util::emitHook("OC_Filesystem", "post_delete", array('path' => $target)); $query = OCP\DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ?"); $query->execute(array(strlen($source), $source, OCP\USER::getUser())); } @@ -432,7 +432,7 @@ class OC_Share { $source = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['path']); if ($target = self::getTarget($source)) { // Forward hook to notify of changes to target file - OC_Hook::emit("OC_Filesystem", "post_write", array('path' => $target)); + OCP\Util::emitHook("OC_Filesystem", "post_write", array('path' => $target)); } } diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index ebaa7ee0e7e..fd3f78ab575 100755 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -12,7 +12,7 @@ OCP\App::registerAdmin('files_versions', 'settings'); OCP\Util::addscript('files_versions', 'versions'); // Listen to write signals -OC_Hook::connect(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OCA_Versions\Storage", "write_hook"); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OCA_Versions\Storage", "write_hook"); diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php index 678d3fe7531..6391e9f4e54 100755 --- a/apps/gallery/lib/hooks_handlers.php +++ b/apps/gallery/lib/hooks_handlers.php @@ -21,9 +21,9 @@ * */ -OC_Hook::connect(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OC_Gallery_Hooks_Handlers", "addPhotoFromPath"); -OC_Hook::connect(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_delete, "OC_Gallery_Hooks_Handlers", "removePhoto"); -//OC_Hook::connect(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_rename, "OC_Gallery_Hooks_Handlers", "renamePhoto"); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OC_Gallery_Hooks_Handlers", "addPhotoFromPath"); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_delete, "OC_Gallery_Hooks_Handlers", "removePhoto"); +//OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_rename, "OC_Gallery_Hooks_Handlers", "renamePhoto"); require_once(OC::$CLASSPATH['OC_Gallery_Album']); require_once(OC::$CLASSPATH['OC_Gallery_Photo']); diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php index 94c3fabe8a0..71069fdf4b9 100755 --- a/apps/media/lib_media.php +++ b/apps/media/lib_media.php @@ -22,16 +22,16 @@ */ //we need to have the sha256 hash of passwords for ampache -OC_Hook::connect('OC_User','post_login','OC_MEDIA','loginListener'); +OCP\Util::connectHook('OC_User','post_login','OC_MEDIA','loginListener'); //connect to the filesystem for auto updating -OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile'); +OCP\Util::connectHook('OC_Filesystem','post_write','OC_MEDIA','updateFile'); //listen for file deletions to clean the database if a song is deleted -OC_Hook::connect('OC_Filesystem','post_delete','OC_MEDIA','deleteFile'); +OCP\Util::connectHook('OC_Filesystem','post_delete','OC_MEDIA','deleteFile'); //list for file moves to update the database -OC_Hook::connect('OC_Filesystem','post_rename','OC_MEDIA','moveFile'); +OCP\Util::connectHook('OC_Filesystem','post_rename','OC_MEDIA','moveFile'); class OC_MEDIA{ /** |