diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-02 00:43:32 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-02 00:43:32 +0000 |
commit | baa25cf2217ab3db0b21ab7bbf15ce82f01c0dcb (patch) | |
tree | ad7581572fb9359944de6ebd1007369a6ce5a747 /mod | |
parent | 97bbbc70e4545c0ce75affc1a6aae0fe71d721c6 (diff) | |
download | elgg-baa25cf2217ab3db0b21ab7bbf15ce82f01c0dcb.tar.gz elgg-baa25cf2217ab3db0b21ab7bbf15ce82f01c0dcb.tar.bz2 |
Removed redundant requirements checking code
git-svn-id: http://code.elgg.org/elgg/trunk@8559 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/twitterservice/start.php | 59 |
1 files changed, 24 insertions, 35 deletions
diff --git a/mod/twitterservice/start.php b/mod/twitterservice/start.php index 48d3fdd38..f62527593 100644 --- a/mod/twitterservice/start.php +++ b/mod/twitterservice/start.php @@ -12,42 +12,31 @@ function twitterservice_init() { $notice_id = 'twitter_services_disable'; - // @todo there's a better way to do this with requires. - if (!elgg_is_active_plugin('oauth_lib')) { - // disable the plugin - disable_plugin('twitterservice'); - - // alert the admin - if (!elgg_admin_notice_exists($notice_id)) { - elgg_add_admin_notice($notice_id, elgg_echo('twitterservice:requires_oauth')); - } - } else { - // cleanup notices - elgg_delete_admin_notice($notice_id); - - // require libraries - $base = elgg_get_plugins_path() . 'twitterservice'; - require_once "$base/vendors/twitteroauth/twitterOAuth.php"; - require_once "$base/twitterservice_lib.php"; - - // extend site views - elgg_extend_view('metatags', 'twitterservice/metatags'); - elgg_extend_view('css', 'twitterservice/css'); - - // sign on with twitter - if (twitterservice_allow_sign_on_with_twitter()) { - elgg_extend_view('login/extend', 'twitterservice/login'); - } - - // register page handler - elgg_register_page_handler('twitterservice', 'twitterservice_pagehandler'); - - // register Walled Garden public pages - elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'twitterservice_public_pages'); - - // allow plugin authors to hook into this service - elgg_register_plugin_hook_handler('tweet', 'twitter_service', 'twitterservice_tweet'); + // cleanup notices + elgg_delete_admin_notice($notice_id); + + // require libraries + $base = elgg_get_plugins_path() . 'twitterservice'; + require_once "$base/vendors/twitteroauth/twitterOAuth.php"; + require_once "$base/twitterservice_lib.php"; + + // extend site views + elgg_extend_view('metatags', 'twitterservice/metatags'); + elgg_extend_view('css', 'twitterservice/css'); + + // sign on with twitter + if (twitterservice_allow_sign_on_with_twitter()) { + elgg_extend_view('login/extend', 'twitterservice/login'); } + + // register page handler + elgg_register_page_handler('twitterservice', 'twitterservice_pagehandler'); + + // register Walled Garden public pages + elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'twitterservice_public_pages'); + + // allow plugin authors to hook into this service + elgg_register_plugin_hook_handler('tweet', 'twitter_service', 'twitterservice_tweet'); } /** |