parent::__construct($plugin);
$this->path = get_config('plugins_path') . $this->getID();
} else {
- $plugin_path = elgg_get_plugin_path();
+ $plugin_path = elgg_get_plugins_path();
// not a full path, so assume an id
// use the default path
* @throws PluginException
*/
public function __construct($plugin, $validate = true) {
- $plugin_path = elgg_get_plugin_path();
+ $plugin_path = elgg_get_plugins_path();
// @todo wanted to avoid another is_dir() call here.
// should do some profiling to see how much it affects
if (strpos($plugin, $plugin_path) === 0 || is_dir($plugin)) {
* @return string
* @since 1.8.0
*/
-function elgg_get_plugin_path() {
+function elgg_get_plugins_path() {
global $CONFIG;
return $CONFIG->pluginspath;
}
*/
function elgg_get_plugin_ids_in_dir($dir = null) {
if (!$dir) {
- $dir = elgg_get_plugin_path();
+ $dir = elgg_get_plugins_path();
}
$plugin_idss = array();
*/
function elgg_generate_plugin_entities() {
$site = get_config('site');
- $dir = elgg_get_plugin_path();
+ $dir = elgg_get_plugins_path();
$options = array(
'type' => 'object',
function elgg_load_plugins() {
global $CONFIG;
- $plugins_path = elgg_get_plugin_path();
+ $plugins_path = elgg_get_plugins_path();
$start_flags = ELGG_PLUGIN_INCLUDE_START
| ELGG_PLUGIN_REGISTER_VIEWS
| ELGG_PLUGIN_REGISTER_LANGUAGES
*/
function blog_init() {
- elgg_register_library('elgg:blog', elgg_get_plugin_path() . 'blog/lib/blog.php');
+ elgg_register_library('elgg:blog', elgg_get_plugins_path() . 'blog/lib/blog.php');
// add a site navigation item
$item = new ElggMenuItem('blog', elgg_echo('blog:blogs'), 'pg/blog/all');
elgg_register_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), 'profile');
// register actions
- $action_path = elgg_get_plugin_path() . 'blog/actions/blog';
+ $action_path = elgg_get_plugins_path() . 'blog/actions/blog';
elgg_register_action('blog/save', "$action_path/save.php");
elgg_register_action('blog/auto_save_revision', "$action_path/auto_save_revision.php");
elgg_register_action('blog/delete', "$action_path/delete.php");
elgg_extend_view('css/screen', 'categories/css');
- $action_base = elgg_get_plugin_path() . 'categories/actions';
+ $action_base = elgg_get_plugins_path() . 'categories/actions';
elgg_register_action('settings/categories/save', "$action_base/save.php", 'admin');
register_page_handler('categories', 'categories_page_handler');
elgg_register_event_handler('validate', 'user', 'defaultwidgets_reset_access');
}
- $action_dir = elgg_get_plugin_path() . 'defaultwidgets/actions';
+ $action_dir = elgg_get_plugins_path() . 'defaultwidgets/actions';
elgg_register_action("defaultwidgets/update", "$action_dir/update.php", 'admin');
elgg_register_plugin_hook_handler('permissions_check', 'user', 'defaultwidgets_can_edit');
function developers_init() {
elgg_register_event_handler('pagesetup', 'system', 'developers_setup_menu');
- $action_base = elgg_get_plugin_path() . 'developers/actions/developers';
+ $action_base = elgg_get_plugins_path() . 'developers/actions/developers';
elgg_register_action('developers/settings', "$action_base/settings.php", 'admin');
}
elgg_add_admin_menu_item('diagnostics', elgg_echo('diagnostics'), 'utilities');
// Register some actions
- $file = elgg_get_plugin_path() . "diagnostics/actions/download.php";
+ $file = elgg_get_plugins_path() . "diagnostics/actions/download.php";
elgg_register_action("diagnostics/download", $file, 'admin');
}
*/
// @todo this is here for backwards compatibility (first version of embed plugin?)
-$download_page_handler = elgg_get_plugin_path() . 'file/download.php';
+$download_page_handler = elgg_get_plugins_path() . 'file/download.php';
include $download_page_handler;
function file_init() {
// register a library of helper functions
- elgg_register_library('elgg:file', elgg_get_plugin_path() . 'file/lib/file.php');
+ elgg_register_library('elgg:file', elgg_get_plugins_path() . 'file/lib/file.php');
// Site navigation
$item = new ElggMenuItem('file', elgg_echo('file'), 'pg/file/all');
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'file_owner_block_menu');
// Register actions
- $action_path = elgg_get_plugin_path() . 'file/actions/file';
+ $action_path = elgg_get_plugins_path() . 'file/actions/file';
elgg_register_action("file/upload", "$action_path/upload.php");
elgg_register_action("file/delete", "$action_path/delete.php");
// temporary - see #2010
$page[0] = 'all';
}
- $file_dir = elgg_get_plugin_path() . 'file';
+ $file_dir = elgg_get_plugins_path() . 'file';
$page_type = $page[0];
switch ($page_type) {
}
if (!$success) {
- $location = elgg_get_plugin_path() . "groups/graphics/default{$size}.jpg";
+ $location = elgg_get_plugins_path() . "groups/graphics/default{$size}.jpg";
$contents = @file_get_contents($location);
}
*/
function groups_init() {
- elgg_register_library('elgg:groups', elgg_get_plugin_path() . 'groups/lib/groups.php');
+ elgg_register_library('elgg:groups', elgg_get_plugins_path() . 'groups/lib/groups.php');
// register group entities for search
register_entity_type('group', '');
register_page_handler('groupicon', 'groups_icon_handler');
// Register some actions
- $action_base = elgg_get_plugin_path() . 'groups/actions';
+ $action_base = elgg_get_plugins_path() . 'groups/actions';
elgg_register_action("groups/edit", "$action_base/edit.php");
elgg_register_action("groups/delete", "$action_base/delete.php");
elgg_register_action("groups/join", "$action_base/join.php");
set_input('size', $page[1]);
}
// Include the standard profile index
- $plugin_dir = elgg_get_plugin_path();
+ $plugin_dir = elgg_get_plugins_path();
include("$plugin_dir/groups/icon.php");
}
*/
function discussion_init() {
- elgg_register_library('elgg:discussion', elgg_get_plugin_path() . 'groups/lib/discussion.php');
+ elgg_register_library('elgg:discussion', elgg_get_plugins_path() . 'groups/lib/discussion.php');
register_page_handler('discussion', 'discussion_page_handler');
register_entity_url_handler('discussion_override_topic_url', 'object', 'groupforumtopic');
//register_extender_url_handler('group_topicpost_url', 'annotation', 'group_topic_post');
- $action_base = elgg_get_plugin_path() . 'groups/actions/discussion';
+ $action_base = elgg_get_plugins_path() . 'groups/actions/discussion';
elgg_register_action('discussion/save', "$action_base/save.php");
elgg_register_action('discussion/delete', "$action_base/delete.php");
function invitefriends_init() {
register_page_handler('invite', 'invitefriends_page_handler');
- elgg_register_action('invitefriends/invite', elgg_get_plugin_path() . 'invitefriends/actions/invite.php');
+ elgg_register_action('invitefriends/invite', elgg_get_plugins_path() . 'invitefriends/actions/invite.php');
$params = array(
'name' => 'invite',
elgg_register_widget_type('messageboard', elgg_echo("messageboard:board"), elgg_echo("messageboard:desc"), "profile");
// Register actions
- $action_path = elgg_get_plugin_path() . 'messageboard/actions';
+ $action_path = elgg_get_plugins_path() . 'messageboard/actions';
elgg_register_action("messageboard/add", "$action_path/add.php");
elgg_register_action("messageboard/delete", "$action_path/delete.php");
}
}
// Include the standard messageboard index
- include(elgg_get_plugin_path() . "messageboard/index.php");
+ include(elgg_get_plugins_path() . "messageboard/index.php");
}
/**
function messages_init() {
// register a library of helper functions
- elgg_register_library('elgg:messages', elgg_get_plugin_path() . 'messages/lib/messages.php');
+ elgg_register_library('elgg:messages', elgg_get_plugins_path() . 'messages/lib/messages.php');
// add page menu items
if (isloggedin()) {
elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'messages_can_edit_container');
// Register actions
- $action_path = elgg_get_plugin_path() . 'messages/actions/messages';
+ $action_path = elgg_get_plugins_path() . 'messages/actions/messages';
elgg_register_action("messages/send", "$action_path/send.php");
elgg_register_action("messages/delete", "$action_path/delete.php");
elgg_register_action("messages/process", "$action_path/process.php");
$page[1] = get_loggedin_user()->username;
}
- $base_dir = elgg_get_plugin_path() . 'messages';
+ $base_dir = elgg_get_plugins_path() . 'messages';
switch ($page[0]) {
case 'inbox':
elgg_register_event_handler('create', 'friend', 'notifications_update_friend_notify');
elgg_register_plugin_hook_handler('access:collections:add-user', 'collection', 'notifications_update_collection_notify');
- $actions_base = elgg_get_plugin_path() . 'notifications/actions';
+ $actions_base = elgg_get_plugins_path() . 'notifications/actions';
elgg_register_action("notificationsettings/save", "$actions_base/save.php");
elgg_register_action("notificationsettings/groupsave", "$actions_base/groupsave.php");
}
$page[0] = 'personal';
}
- $base = elgg_get_plugin_path() . 'notifications';
+ $base = elgg_get_plugins_path() . 'notifications';
switch ($page[0]) {
case 'group':
function pages_init() {
// register a library of helper functions
- elgg_register_library('elgg:pages', elgg_get_plugin_path() . 'pages/lib/pages.php');
+ elgg_register_library('elgg:pages', elgg_get_plugins_path() . 'pages/lib/pages.php');
$item = new ElggMenuItem('pages', elgg_echo('pages'), 'pg/pages/all');
elgg_register_menu_item('site', $item);
register_extender_url_handler('pages_revision_url', 'annotation', 'page');
// Register some actions
- $action_base = elgg_get_plugin_path() . 'pages/actions/pages';
+ $action_base = elgg_get_plugins_path() . 'pages/actions/pages';
elgg_register_action("pages/edit", "$action_base/edit.php");
elgg_register_action("pages/editwelcome", "$action_base/editwelcome.php");
elgg_register_action("pages/delete", "$action_base/delete.php");
elgg_push_breadcrumb(elgg_echo('pages'), 'pg/pages/all');
- $base_dir = elgg_get_plugin_path() . 'pages';
+ $base_dir = elgg_get_plugins_path() . 'pages';
$page_type = $page[0];
switch ($page_type) {
'admin');
// Register actions
- $action_path = elgg_get_plugin_path() . "reportedcontent/actions";
+ $action_path = elgg_get_plugins_path() . "reportedcontent/actions";
elgg_register_action('reportedcontent/add', "$action_path/add.php");
elgg_register_action('reportedcontent/delete', "$action_path/delete.php", 'admin');
elgg_register_action('reportedcontent/archive', "$action_path/archive.php", 'admin');
// hook into the walled garden pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'sitepages_public_pages');
- $action_path = elgg_get_plugin_path() . 'sitepages/actions';
+ $action_path = elgg_get_plugins_path() . 'sitepages/actions';
elgg_register_action('settings/sitepages/save', "$action_path/edit_settings.php");
}
// Listen to notification events and supply a more useful message for SMS'
elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'thewire_notify_message');
- $action_path = elgg_get_plugin_path() . 'thewire/actions';
+ $action_path = elgg_get_plugins_path() . 'thewire/actions';
elgg_register_action("thewire/add", "$action_path/add.php");
elgg_register_action("thewire/delete", "$action_path/delete.php");
}
elgg_delete_admin_notice($notice_id);
// require libraries
- $base = elgg_get_plugin_path() . 'twitterservice';
+ $base = elgg_get_plugins_path() . 'twitterservice';
require_once "$base/vendors/twitteroauth/twitterOAuth.php";
require_once "$base/twitterservice_lib.php";
$screenshot_html = '';
$screenshots = $plugin->manifest->getScreenshots();
if ($screenshots) {
- $base_url = elgg_get_plugin_path() . $plugin->getID() . '/';
+ $base_url = elgg_get_plugins_path() . $plugin->getID() . '/';
$limit = 4;
foreach ($screenshots as $screenshot) {
if ($limit <= 0) {