From 3161a7b0b27508066f26b8cd920b1817f23beeef Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 13 Sep 2011 21:14:11 -0400 Subject: Fixes #3623 added non-bundled filter option for plugins --- languages/en.php | 1 + 1 file changed, 1 insertion(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index ab3c523de..6e07b256b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -601,6 +601,7 @@ $english = array( 'admin:plugins:category:inactive' => 'Inactive plugins', 'admin:plugins:category:admin' => 'Admin', 'admin:plugins:category:bundled' => 'Bundled', + 'admin:plugins:category:nonbundled' => 'Non-bundled', 'admin:plugins:category:content' => 'Content', 'admin:plugins:category:development' => 'Development', 'admin:plugins:category:enhancement' => 'Enhancements', -- cgit v1.2.3 From 710b17aa37dd5c90db695219defdfef7a889f29a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 14 Sep 2011 21:09:48 -0400 Subject: Fixes #3681 fixed Utilities menu collisions in admin section and added documentation about registering more than one menu item with the same name to a menu --- engine/lib/navigation.php | 3 ++ languages/en.php | 3 +- mod/diagnostics/languages/en.php | 2 +- mod/diagnostics/start.php | 2 +- .../admin/develop_utilities/diagnostics.php | 30 +++++++++++ .../views/default/admin/utilities/diagnostics.php | 30 ----------- mod/logbrowser/languages/en.php | 2 +- mod/logbrowser/start.php | 2 +- .../admin/administer_utilities/logbrowser.php | 63 ++++++++++++++++++++++ .../views/default/admin/utilities/logbrowser.php | 63 ---------------------- mod/reportedcontent/languages/en.php | 2 +- mod/reportedcontent/start.php | 2 +- .../admin/administer_utilities/reportedcontent.php | 13 +++++ .../default/admin/utilities/reportedcontent.php | 13 ----- 14 files changed, 117 insertions(+), 113 deletions(-) create mode 100644 mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php delete mode 100644 mod/diagnostics/views/default/admin/utilities/diagnostics.php create mode 100644 mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php delete mode 100644 mod/logbrowser/views/default/admin/utilities/logbrowser.php create mode 100644 mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php delete mode 100644 mod/reportedcontent/views/default/admin/utilities/reportedcontent.php (limited to 'languages') diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index cefe40ecf..0e9ec1c17 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -53,6 +53,9 @@ * 'register', 'menu:'. If you do, you may end up with many incorrect * links on a context-sensitive menu. * + * @warning A menu item's name must be unique per menu. If more than one menu + * item with the same name are registered, the last menu item takes priority. + * * @see elgg_view_menu() for the plugin hooks available for modifying a menu as * it is being rendered. * diff --git a/languages/en.php b/languages/en.php index 6e07b256b..3a922b889 100644 --- a/languages/en.php +++ b/languages/en.php @@ -544,7 +544,8 @@ $english = array( 'admin:statistics:overview' => 'Overview', 'admin:appearance' => 'Appearance', - 'admin:utilities' => 'Utilities', + 'admin:administer_utilities' => 'Utilities', + 'admin:develop_utilities' => 'Utilities', 'admin:users' => "Users", 'admin:users:online' => 'Currently Online', diff --git a/mod/diagnostics/languages/en.php b/mod/diagnostics/languages/en.php index 6d71945e3..c4e337b50 100644 --- a/mod/diagnostics/languages/en.php +++ b/mod/diagnostics/languages/en.php @@ -7,7 +7,7 @@ $english = array( - 'admin:utilities:diagnostics' => 'System Diagnostics', + 'admin:develop_utilities:diagnostics' => 'System Diagnostics', 'diagnostics' => 'System diagnostics', 'diagnostics:report' => 'Diagnostics Report', 'diagnostics:unittester' => 'Unit Tests', diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php index c55b10483..735e15042 100644 --- a/mod/diagnostics/start.php +++ b/mod/diagnostics/start.php @@ -16,7 +16,7 @@ function diagnostics_init() { elgg_register_page_handler('diagnostics','diagnostics_page_handler'); // Add admin menu item - elgg_register_admin_menu_item('develop', 'diagnostics', 'utilities'); + elgg_register_admin_menu_item('develop', 'diagnostics', 'develop_utilities'); // Register some actions $file = elgg_get_plugins_path() . "diagnostics/actions/download.php"; diff --git a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php new file mode 100644 index 000000000..76f12b0ae --- /dev/null +++ b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php @@ -0,0 +1,30 @@ +' . elgg_echo('diagnostics:unittester:description') . '

'; +$unit_tests .= '

' . elgg_echo('diagnostics:unittester:warning') . '

'; + +if (elgg_get_config('debug')) { + // create a button to run tests + $params = array( + 'text' => elgg_echo('diagnostics:test:executeall'), + 'href' => 'engine/tests/suite.php', + 'class' => 'elgg-button elgg-button-submit', + ); + $unit_tests .= '

' . elgg_view('output/url', $params) . '

'; +} else { + // no tests when not in debug mode + $unit_tests .= elgg_echo('diagnostics:unittester:debug'); +} + +// display admin body +echo elgg_view_module('inline', $diagnostics_title, $diagnostics); +echo elgg_view_module('inline', $unit_tests_title, $unit_tests); diff --git a/mod/diagnostics/views/default/admin/utilities/diagnostics.php b/mod/diagnostics/views/default/admin/utilities/diagnostics.php deleted file mode 100644 index 76f12b0ae..000000000 --- a/mod/diagnostics/views/default/admin/utilities/diagnostics.php +++ /dev/null @@ -1,30 +0,0 @@ -' . elgg_echo('diagnostics:unittester:description') . '

'; -$unit_tests .= '

' . elgg_echo('diagnostics:unittester:warning') . '

'; - -if (elgg_get_config('debug')) { - // create a button to run tests - $params = array( - 'text' => elgg_echo('diagnostics:test:executeall'), - 'href' => 'engine/tests/suite.php', - 'class' => 'elgg-button elgg-button-submit', - ); - $unit_tests .= '

' . elgg_view('output/url', $params) . '

'; -} else { - // no tests when not in debug mode - $unit_tests .= elgg_echo('diagnostics:unittester:debug'); -} - -// display admin body -echo elgg_view_module('inline', $diagnostics_title, $diagnostics); -echo elgg_view_module('inline', $unit_tests_title, $unit_tests); diff --git a/mod/logbrowser/languages/en.php b/mod/logbrowser/languages/en.php index 90689a1b0..3b6ead272 100644 --- a/mod/logbrowser/languages/en.php +++ b/mod/logbrowser/languages/en.php @@ -6,7 +6,7 @@ */ $english = array( - 'admin:utilities:logbrowser' => 'Log browser', + 'admin:administer_utilities:logbrowser' => 'Log browser', 'logbrowser' => 'Log browser', 'logbrowser:browse' => 'Browse system log', 'logbrowser:search' => 'Refine results', diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index 71b6115a5..3bffe800a 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -14,7 +14,7 @@ function logbrowser_init() { elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu'); - elgg_register_admin_menu_item('administer', 'logbrowser', 'utilities'); + elgg_register_admin_menu_item('administer', 'logbrowser', 'administer_utilities'); } /** diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php new file mode 100644 index 000000000..dadc6cda3 --- /dev/null +++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php @@ -0,0 +1,63 @@ +guid; + } +} else { + $user_guid = get_input('user_guid',0); + if ($user_guid) { + $user = (int) $user_guid; + } else { + $user = ""; + } +} + +$timelower = get_input('timelower'); +if ($timelower) { + $timelower = strtotime($timelower); +} + +$timeupper = get_input('timeupper'); +if ($timeupper) { + $timeupper = strtotime($timeupper); +} + +$form = elgg_view('logbrowser/form', array( + 'user_guid' => $user, + 'timeupper' => $timeupper, + 'timelower' => $timelower, +)); + +// Get log entries +$log = get_system_log($user, "", "", "","", $limit, $offset, false, $timeupper, $timelower); +$count = get_system_log($user, "", "", "","", $limit, $offset, true, $timeupper, $timelower); + +$table = elgg_view('logbrowser/table', array('log_entries' => $log)); + +$nav = elgg_view('navigation/pagination',array( + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, +)); + +// display admin body +$body = <<<__HTML +$form +$nav +$table +$nav +__HTML; + +echo $body; diff --git a/mod/logbrowser/views/default/admin/utilities/logbrowser.php b/mod/logbrowser/views/default/admin/utilities/logbrowser.php deleted file mode 100644 index dadc6cda3..000000000 --- a/mod/logbrowser/views/default/admin/utilities/logbrowser.php +++ /dev/null @@ -1,63 +0,0 @@ -guid; - } -} else { - $user_guid = get_input('user_guid',0); - if ($user_guid) { - $user = (int) $user_guid; - } else { - $user = ""; - } -} - -$timelower = get_input('timelower'); -if ($timelower) { - $timelower = strtotime($timelower); -} - -$timeupper = get_input('timeupper'); -if ($timeupper) { - $timeupper = strtotime($timeupper); -} - -$form = elgg_view('logbrowser/form', array( - 'user_guid' => $user, - 'timeupper' => $timeupper, - 'timelower' => $timelower, -)); - -// Get log entries -$log = get_system_log($user, "", "", "","", $limit, $offset, false, $timeupper, $timelower); -$count = get_system_log($user, "", "", "","", $limit, $offset, true, $timeupper, $timelower); - -$table = elgg_view('logbrowser/table', array('log_entries' => $log)); - -$nav = elgg_view('navigation/pagination',array( - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, -)); - -// display admin body -$body = <<<__HTML -$form -$nav -$table -$nav -__HTML; - -echo $body; diff --git a/mod/reportedcontent/languages/en.php b/mod/reportedcontent/languages/en.php index c047644e3..c2e197879 100644 --- a/mod/reportedcontent/languages/en.php +++ b/mod/reportedcontent/languages/en.php @@ -8,7 +8,7 @@ $english = array( 'item:object:reported_content' => 'Reported items', - 'admin:utilities:reportedcontent' => 'Reported content', + 'admin:administer_utilities:reportedcontent' => 'Reported content', 'reportedcontent' => 'Reported content', 'reportedcontent:this' => 'Report this', 'reportedcontent:this:tooltip' => 'Report this page to an administrator', diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php index 87b4b3c7b..66a1248d9 100644 --- a/mod/reportedcontent/start.php +++ b/mod/reportedcontent/start.php @@ -39,7 +39,7 @@ function reportedcontent_init() { // Add admin menu item // @todo Might want to move this to a 'feedback' section. something other than utils - elgg_register_admin_menu_item('administer', 'reportedcontent', 'utilities'); + elgg_register_admin_menu_item('administer', 'reportedcontent', 'administer_utilities'); elgg_register_widget_type( 'reportedcontent', diff --git a/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php new file mode 100644 index 000000000..32f108312 --- /dev/null +++ b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php @@ -0,0 +1,13 @@ + 'object', 'subtypes' => 'reported_content')); +if (!$list) { + $list = '

' . elgg_echo('reportedcontent:none') . '

'; +} + +echo $list; \ No newline at end of file diff --git a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php b/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php deleted file mode 100644 index 32f108312..000000000 --- a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php +++ /dev/null @@ -1,13 +0,0 @@ - 'object', 'subtypes' => 'reported_content')); -if (!$list) { - $list = '

' . elgg_echo('reportedcontent:none') . '

'; -} - -echo $list; \ No newline at end of file -- cgit v1.2.3 From f831b081a4baf64c368a6156712b7151f3497e46 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 17 Sep 2011 11:47:37 -0400 Subject: Fixes #3819 added the request action words to the language file --- languages/en.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 3a922b889..6c3c041cd 100644 --- a/languages/en.php +++ b/languages/en.php @@ -811,6 +811,9 @@ $english = array( 'upgrade' => 'Upgrade', 'sort' => 'Sort', 'filter' => 'Filter', + 'new' => 'New', + 'add' => 'Add', + 'create' => 'Create', 'site' => 'Site', 'activity' => 'Activity', @@ -1053,10 +1056,10 @@ If you requested this click on the link below, otherwise ignore this email. * user default access */ -'default_access:settings' => "Your default access level", -'default_access:label' => "Default access", -'user:default_access:success' => "Your new default access level was saved.", -'user:default_access:failure' => "Your new default access level could not be saved.", + 'default_access:settings' => "Your default access level", + 'default_access:label' => "Default access", + 'user:default_access:success' => "Your new default access level was saved.", + 'user:default_access:failure' => "Your new default access level could not be saved.", /** * XML-RPC -- cgit v1.2.3 From 57c409526195ebbd46b239f4af06ef199d001df9 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Mon, 19 Sep 2011 16:21:41 -0400 Subject: forward throws Exception if headers sent. fix for http://trac.elgg.org/ticket/3765 --- engine/lib/elgglib.php | 4 ++-- engine/lib/group.php | 4 +--- engine/lib/sessions.php | 9 ++------- languages/en.php | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) (limited to 'languages') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 198ffe60c..8358b08ab 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -143,9 +143,9 @@ function forward($location = "", $reason = 'system') { } else if ($location === '') { exit; } + } else { + throw new SecurityException(elgg_echo('SecurityException:ForwardFailedToRedirect')); } - - return false; } /** diff --git a/engine/lib/group.php b/engine/lib/group.php index e7b70fd10..7fa188cd6 100644 --- a/engine/lib/group.php +++ b/engine/lib/group.php @@ -276,9 +276,7 @@ function group_gatekeeper($forward = true) { if ($forward && $allowed == false) { register_error(elgg_echo('membershiprequired')); - if (!forward($url, 'member')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward($url, 'member'); } return $allowed; diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 407bb69c5..ae42956a9 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -472,10 +472,7 @@ function gatekeeper() { if (!elgg_is_logged_in()) { $_SESSION['last_forward_from'] = current_page_url(); register_error(elgg_echo('loggedinrequired')); - - if (!forward('', 'login')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward('', 'login'); } } @@ -490,9 +487,7 @@ function admin_gatekeeper() { if (!elgg_is_admin_logged_in()) { $_SESSION['last_forward_from'] = current_page_url(); register_error(elgg_echo('adminrequired')); - if (!forward('', 'admin')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward('', 'admin'); } } diff --git a/languages/en.php b/languages/en.php index 6c3c041cd..aabf91dfb 100644 --- a/languages/en.php +++ b/languages/en.php @@ -171,7 +171,7 @@ $english = array( 'ConfigurationException:NoSiteID' => "No site ID has been specified.", 'SecurityException:APIAccessDenied' => "Sorry, API access has been disabled by the administrator.", 'SecurityException:NoAuthMethods' => "No authentication methods were found that could authenticate this API request.", - 'SecurityException:UnexpectedOutputInGatekeeper' => 'Unexpected output in gatekeeper call. Halting execution for security. Search http://docs.elgg.org/ for more information.', + 'SecurityException:ForwardFailedToRedirect' => 'Redirect could not be issued due to headers already being sent. Halting execution for security. Search http://docs.elgg.org/ for more information.', 'InvalidParameterException:APIMethodOrFunctionNotSet' => "Method or function not set in call in expose_method()", 'InvalidParameterException:APIParametersArrayStructure' => "Parameters array structure is incorrect for call to expose method '%s'", 'InvalidParameterException:UnrecognisedHttpMethod' => "Unrecognised http method %s for api method '%s'", -- cgit v1.2.3 From 9858bd526fce9016dc82d1f21b35e6ceb969c140 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 22 Sep 2011 21:32:49 -0400 Subject: Fixes #3808 not translating manifest fields through elgg_echo() --- engine/classes/ElggPluginManifest.php | 38 +++++++---------------------------- languages/en.php | 1 + views/default/admin/plugins.php | 8 +++++++- 3 files changed, 15 insertions(+), 32 deletions(-) (limited to 'languages') diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 0f3b1d7a8..0e47f388d 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -224,20 +224,15 @@ class ElggPluginManifest { /** * Returns the plugin name * - * @param bool $elgg_echo Run the name through elgg_echo. * @return string */ - public function getName($elgg_echo = true) { + public function getName() { $name = $this->parser->getAttribute('name'); if (!$name && $this->pluginID) { $name = ucwords(str_replace('_', ' ', $this->pluginID)); } - if ($elgg_echo) { - $name = elgg_echo($name); - } - return $name; } @@ -245,33 +240,21 @@ class ElggPluginManifest { /** * Return the description * - * @param bool $elgg_echo Run the description through elgg_echo. * @return string */ - public function getDescription($elgg_echo = true) { - $desc = $this->parser->getAttribute('description'); - - if ($elgg_echo) { - return elgg_echo($desc); - } else { - return $desc; - } + public function getDescription() { + return $this->parser->getAttribute('description'); } /** * Return the short description * - * @param bool $elgg_echo Run the blurb through elgg_echo. * @return string */ - public function getBlurb($elgg_echo = true) { + public function getBlurb() { $blurb = $this->parser->getAttribute('blurb'); - if ($blurb) { - if ($elgg_echo) { - $blurb = elgg_echo($blurb); - } - } else { + if (!$blurb) { $blurb = elgg_get_excerpt($this->getDescription()); } @@ -348,10 +331,9 @@ class ElggPluginManifest { /** * Return the screenshots listed. * - * @param bool $elgg_echo Run the screenshot's description through elgg_echo. * @return array */ - public function getScreenshots($elgg_echo = true) { + public function getScreenshots() { $ss = $this->parser->getAttribute('screenshot'); if (!$ss) { @@ -360,13 +342,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($ss as $s) { - $normalized_s = $this->buildStruct($this->screenshotStruct, $s); - - if ($elgg_echo) { - $normalized_s['description'] = elgg_echo($normalized_s['description']); - } - - $normalized[] = $normalized_s; + $normalized[] = $this->buildStruct($this->screenshotStruct, $s); } return $normalized; diff --git a/languages/en.php b/languages/en.php index 6c3c041cd..d83d4773b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -613,6 +613,7 @@ $english = array( 'admin:plugins:category:multimedia' => 'Multimedia', 'admin:plugins:category:theme' => 'Themes', 'admin:plugins:category:widget' => 'Widgets', + 'admin:plugins:category:utility' => 'Utilities', 'admin:plugins:sort:priority' => 'Priority', 'admin:plugins:sort:alpha' => 'Alphabetical', diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 62e6f556a..451936335 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -60,7 +60,13 @@ foreach ($installed_plugins as $id => $plugin) { if (isset($plugin_categories)) { foreach ($plugin_categories as $category) { if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:category:$category"); + // if localization string not defined, fall back to original category string + $cat_raw_string = "admin:plugins:category:$category"; + $cat_display_string = elgg_echo($cat_raw_string); + if ($cat_display_string == $cat_raw_string) { + $cat_display_string = ucwords($category); + } + $categories[$category] = $cat_display_string; } } } -- cgit v1.2.3 From 0a0414619d4a82494403e8334e9a5367f893667e Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 25 Sep 2011 15:41:30 -0400 Subject: Refs #3842 adding river view back so that those upgrading from earlier Elgg views don't have empty river messages --- languages/en.php | 1 + views/default/river/user/default/profileupdate.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 views/default/river/user/default/profileupdate.php (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index d83d4773b..9d0590b2d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -408,6 +408,7 @@ $english = array( 'river' => "River", 'river:friend:user:default' => "%s is now a friend with %s", 'river:update:user:avatar' => '%s has a new avatar', + 'river:update:user:profile' => '%s has updated their profile', 'river:noaccess' => 'You do not have permission to view this item.', 'river:posted:generic' => '%s posted', 'riveritem:single:user' => 'a user', diff --git a/views/default/river/user/default/profileupdate.php b/views/default/river/user/default/profileupdate.php new file mode 100644 index 000000000..a344131d6 --- /dev/null +++ b/views/default/river/user/default/profileupdate.php @@ -0,0 +1,19 @@ +getSubjectEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', +)); + +$string = elgg_echo('river:update:user:profile', array($subject_link)); + +echo elgg_view('river/item', array( + 'item' => $vars['item'], + 'summary' => $string, +)); -- cgit v1.2.3 From dc0a24816ee224962511739b312898ffaf19d8ae Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 1 Oct 2011 19:36:29 -0400 Subject: more was defined twice in the core language file --- languages/en.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 9d0590b2d..27b07d11c 100644 --- a/languages/en.php +++ b/languages/en.php @@ -826,8 +826,6 @@ $english = array( 'top' => 'Top', 'bottom' => 'Bottom', - 'more' => 'more', - 'invite' => "Invite", 'resetpassword' => "Reset password", -- cgit v1.2.3 From 58b66643c1921706d764b2bb1ea4729519ca31f8 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 2 Oct 2011 11:18:55 -0700 Subject: Fixes #3915. Added ElggPlugin->getFriendlyName() to check for manifest->getName() first, then for plugin ID. Added better descriptions for plugin activation errors. --- actions/admin/plugins/activate.php | 4 +++- actions/admin/plugins/activate_all.php | 4 +++- actions/admin/plugins/deactivate.php | 4 +++- actions/admin/plugins/deactivate_all.php | 4 +++- actions/admin/plugins/set_priority.php | 4 +++- engine/classes/ElggPlugin.php | 22 +++++++++++++++++++++- engine/classes/ElggPluginPackage.php | 2 ++ languages/en.php | 4 ++++ 8 files changed, 42 insertions(+), 6 deletions(-) (limited to 'languages') diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php index 0049878e3..224b5a2ae 100644 --- a/actions/admin/plugins/activate.php +++ b/actions/admin/plugins/activate.php @@ -29,7 +29,9 @@ foreach ($plugin_guids as $guid) { if ($plugin->activate()) { $activated_guids[] = $guid; } else { - register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php index 19eb82142..19c142346 100644 --- a/actions/admin/plugins/activate_all.php +++ b/actions/admin/plugins/activate_all.php @@ -18,7 +18,9 @@ foreach ($guids as $guid) { if ($plugin->activate()) { //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); } else { - register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } } diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php index f5eca3aaa..2ce796eff 100644 --- a/actions/admin/plugins/deactivate.php +++ b/actions/admin/plugins/deactivate.php @@ -28,7 +28,9 @@ foreach ($plugin_guids as $guid) { if ($plugin->deactivate()) { //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->getManifest()->getName()))); } else { - register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php index 436a3ad30..479e9c607 100644 --- a/actions/admin/plugins/deactivate_all.php +++ b/actions/admin/plugins/deactivate_all.php @@ -18,7 +18,9 @@ foreach ($guids as $guid) { if ($plugin->deactivate()) { //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); } else { - register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } } diff --git a/actions/admin/plugins/set_priority.php b/actions/admin/plugins/set_priority.php index 1f8bc24af..79b1c4c53 100644 --- a/actions/admin/plugins/set_priority.php +++ b/actions/admin/plugins/set_priority.php @@ -26,7 +26,9 @@ if (!($plugin instanceof ElggPlugin)) { if ($plugin->setPriority($priority)) { //system_message(elgg_echo('admin:plugins:set_priority:yes', array($plugin->getManifest()->getName()))); } else { - register_error(elgg_echo('admin:plugins:set_priority:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:set_priority:no_with_msg' : 'admin:plugins:set_priority:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } // don't regenerate the simplecache because the plugin won't be diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php index d837431fc..4aee1e898 100644 --- a/engine/classes/ElggPlugin.php +++ b/engine/classes/ElggPlugin.php @@ -115,6 +115,21 @@ class ElggPlugin extends ElggObject { return $this->title; } + /** + * Returns the manifest's name if available, otherwise the ID. + * + * @return string + * @since 1.8.1 + */ + public function getFriendlyName() { + $manifest = $this->getManifest(); + if ($manifest) { + return $manifest->getName(); + } + + return $this->getID(); + } + /** * Returns the plugin's full path with trailing slash. * @@ -597,7 +612,12 @@ class ElggPlugin extends ElggObject { */ public function canActivate($site_guid = null) { if ($this->getPackage()) { - return $this->getPackage()->isValid() && $this->getPackage()->checkDependencies(); + $result = $this->getPackage()->isValid() && $this->getPackage()->checkDependencies(); + if (!$result) { + $this->errorMsg = $this->getPackage()->getError(); + } + + return $result; } return false; diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 02b985285..145f71fcd 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -347,6 +347,7 @@ class ElggPluginPackage { $conflict['name'] = $plugin->getManifest()->getName(); if (!$full_report && !$result['status']) { + $this->errorMsg = "Conflicts with plugin \"{$plugin->getManifest()->getName()}\"."; return $result['status']; } else { $report[] = array( @@ -399,6 +400,7 @@ class ElggPluginPackage { // unless we're doing a full report, break as soon as we fail. if (!$full_report && !$result['status']) { + $this->errorMsg = "Missing dependencies."; return $result['status']; } else { // build report element and comment diff --git a/languages/en.php b/languages/en.php index 27b07d11c..c4eb212c4 100644 --- a/languages/en.php +++ b/languages/en.php @@ -69,6 +69,7 @@ $english = array( 'PluginException:InvalidManifest' => 'Invalid manifest file for plugin %s', 'PluginException:InvalidPlugin' => '%s is not a valid plugin.', 'PluginException:InvalidPlugin:Details' => '%s is not a valid plugin: %s', + 'PluginException:NullInstantiated' => 'ElggPlugin cannot be null instantiated. You must pass a GUID, a plugin ID, or a full path.', 'ElggPlugin:MissingID' => 'Missing plugin ID (guid %s)', 'ElggPlugin:NoPluginPackagePackage' => 'Missing ElggPluginPackage for plugin ID %s (guid %s)', @@ -663,10 +664,13 @@ $english = array( 'admin:plugins:set_priority:yes' => "Reordered %s.", 'admin:plugins:set_priority:no' => "Could not reorder %s.", + 'admin:plugins:set_priority:no_with_msg' => "Could not reorder %s. Error: %s", 'admin:plugins:deactivate:yes' => "Deactivated %s.", 'admin:plugins:deactivate:no' => "Could not deactivate %s.", + 'admin:plugins:deactivate:no_with_msg' => "Could not deactivate %s. Error: %s", 'admin:plugins:activate:yes' => "Activated %s.", 'admin:plugins:activate:no' => "Could not activate %s.", + 'admin:plugins:activate:no_with_msg' => "Could not activate %s. Error: %s", 'admin:plugins:categories:all' => 'All categories', 'admin:plugins:plugin_website' => 'Plugin website', 'admin:plugins:author' => '%s', -- cgit v1.2.3 From 4706f47ca0b19d9baa45742ae7c8d270c42e9490 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 5 Oct 2011 21:28:30 -0400 Subject: Fixes #3704 displaying error messages when adding users through admin interface --- actions/useradd.php | 13 ++++++++++++- engine/lib/users.php | 2 ++ languages/en.php | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'languages') diff --git a/actions/useradd.php b/actions/useradd.php index 8e588d073..be08b4be5 100644 --- a/actions/useradd.php +++ b/actions/useradd.php @@ -20,11 +20,22 @@ if (is_array($admin)) { $admin = $admin[0]; } +// no blank fields +if ($username == '' || $password == '' || $password2 == '' || $email == '' || $name == '') { + register_error(elgg_echo('register:fields')); + forward(REFERER); +} + +if (strcmp($password, $password2) != 0) { + register_error(elgg_echo('RegistrationException:PasswordMismatch')); + forward(REFERER); +} + // For now, just try and register the user try { $guid = register_user($username, $password, $name, $email, TRUE); - if (((trim($password) != "") && (strcmp($password, $password2) == 0)) && ($guid)) { + if ($guid) { $new_user = get_entity($guid); if (($guid) && ($admin)) { $new_user->makeAdmin(); diff --git a/engine/lib/users.php b/engine/lib/users.php index 2d6b7cabd..ce1b409f6 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -813,6 +813,7 @@ function validate_username($username) { if ( preg_match($blacklist, $username) ) { + // @todo error message needs work throw new RegistrationException(elgg_echo('registration:invalidchars')); } @@ -823,6 +824,7 @@ function validate_username($username) { for ($n = 0; $n < strlen($blacklist2); $n++) { if (strpos($username, $blacklist2[$n]) !== false) { $msg = elgg_echo('registration:invalidchars', array($blacklist2[$n], $blacklist2)); + $msg = htmlentities($msg, ENT_COMPAT, 'UTF-8'); throw new RegistrationException($msg); } } diff --git a/languages/en.php b/languages/en.php index c4eb212c4..f1bc8e3b7 100644 --- a/languages/en.php +++ b/languages/en.php @@ -473,13 +473,14 @@ $english = array( 'registerok' => "You have successfully registered for %s.", 'registerbad' => "Your registration was unsuccessful because of an unknown error.", 'registerdisabled' => "Registration has been disabled by the system administrator", + 'register:fields' => 'All fields are required', 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', - 'registration:invalidchars' => 'Sorry, your username contains the following invalid character: %s. All of these characters are invalid: %s', + 'registration:invalidchars' => 'Sorry, your username contains the character %s which is invalid. The following characters are invalid: %s', 'registration:emailnotvalid' => 'Sorry, the email address you entered is invalid on this system', 'registration:passwordnotvalid' => 'Sorry, the password you entered is invalid on this system', 'registration:usernamenotvalid' => 'Sorry, the username you entered is invalid on this system', -- cgit v1.2.3 From 996a185c557357ccd3f5c257d17699eb874e1898 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 7 Oct 2011 08:05:14 -0400 Subject: Fixes #3644 localized profile field names --- languages/en.php | 8 ++++++++ views/default/admin/appearance/profile_fields/list.php | 11 +++++++---- views/default/forms/profile/fields/add.php | 12 +++++++----- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index c739d554e..da4e6a901 100644 --- a/languages/en.php +++ b/languages/en.php @@ -379,6 +379,14 @@ $english = array( 'profile:twitter' => "Twitter username", 'profile:saved' => "Your profile was successfully saved.", + 'profile:field:text' => 'Short text', + 'profile:field:longtext' => 'Large text area', + 'profile:field:tags' => 'Tags', + 'profile:field:url' => 'Web address', + 'profile:field:email' => 'Email address', + 'profile:field:location' => 'Location', + 'profile:field:date' => 'Date', + 'admin:appearance:profile_fields' => 'Edit Profile Fields', 'profile:edit:default' => 'Edit profile fields', 'profile:label' => "Profile label", diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index 542ab1b6f..6e79838ea 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -9,15 +9,18 @@ $n = 0; $loaded_defaults = array(); $items = array(); -if ($fieldlist = elgg_get_config('profile_custom_fields')) { +$fieldlist = elgg_get_config('profile_custom_fields'); +if ($fieldlist) { $fieldlistarray = explode(',', $fieldlist); foreach ($fieldlistarray as $listitem) { - if ($translation = elgg_get_config("admin_defined_profile_{$listitem}")) { + $translation = elgg_get_config("admin_defined_profile_$listitem"); + $type = elgg_get_config("admin_defined_profile_type_$listitem"); + if ($translation && $type) { $item = new stdClass; $item->translation = $translation; $item->shortname = $listitem; - $item->name = "admin_defined_profile_{$listitem}"; - $item->type = elgg_get_config("admin_defined_profile_type_{$listitem}"); + $item->name = "admin_defined_profile_$listitem"; + $item->type = elgg_echo("profile:field:$type"); $items[] = $item; } } diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index c1d07d2ce..bd58ae381 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -8,11 +8,13 @@ $type_text = elgg_echo('profile:type'); $label_control = elgg_view('input/text', array('name' => 'label')); $type_control = elgg_view('input/dropdown', array('name' => 'type', 'options_values' => array( - 'text' => elgg_echo('text'), - 'longtext' => elgg_echo('longtext'), - 'tags' => elgg_echo('tags'), - 'url' => elgg_echo('url'), - 'email' => elgg_echo('email') + 'text' => elgg_echo('profile:field:text'), + 'longtext' => elgg_echo('profile:field:longtext'), + 'tags' => elgg_echo('profile:field:tags'), + 'url' => elgg_echo('profile:field:url'), + 'email' => elgg_echo('profile:field:email'), + 'location' => elgg_echo('profile:field:location'), + 'date' => elgg_echo('profile:field:date'), ))); $submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); -- cgit v1.2.3 From 86547ed43ca5a970bf118e4f3c88fb6733209c45 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 9 Oct 2011 17:54:42 -0400 Subject: Fixes #595 separating email address from email notification in language strings --- languages/en.php | 1 + mod/messages/languages/en.php | 2 +- mod/notifications/languages/en.php | 1 - views/default/core/settings/account/notifications.php | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index da4e6a901..3271967ed 100644 --- a/languages/en.php +++ b/languages/en.php @@ -436,6 +436,7 @@ $english = array( */ 'notifications:usersettings' => "Notification settings", 'notifications:methods' => "Please specify which methods you want to permit.", + 'notification:method:email' => 'Email', 'notifications:usersettings:save:ok' => "Your notification settings were successfully saved.", 'notifications:usersettings:save:fail' => "There was a problem saving your notification settings.", diff --git a/mod/messages/languages/en.php b/mod/messages/languages/en.php index 2002905b7..308c3d519 100644 --- a/mod/messages/languages/en.php +++ b/mod/messages/languages/en.php @@ -39,7 +39,7 @@ $english = array( 'messages:new' => 'New message', - 'notification:method:site' => 'Messages', + 'notification:method:site' => 'Site', 'messages:error' => 'There was a problem saving your message. Please try again.', diff --git a/mod/notifications/languages/en.php b/mod/notifications/languages/en.php index 586d66892..b29c9df25 100644 --- a/mod/notifications/languages/en.php +++ b/mod/notifications/languages/en.php @@ -13,7 +13,6 @@ $english = array( 'notifications:subscriptions:changesettings' => 'Notifications', 'notifications:subscriptions:changesettings:groups' => 'Group notifications', - 'notification:method:email' => 'Email', 'notifications:subscriptions:title' => 'Notifications per user', 'notifications:subscriptions:description' => 'To receive notifications from your friends (on an individual basis) when they create new content, find them below and select the notification method you would like to use.', diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php index ae5fe40bb..51292b2c9 100644 --- a/views/default/core/settings/account/notifications.php +++ b/views/default/core/settings/account/notifications.php @@ -24,7 +24,7 @@ $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid foreach ($NOTIFICATION_HANDLERS as $k => $v) { ?> - : + : Date: Mon, 10 Oct 2011 20:51:19 -0400 Subject: Fixes #3952 handling exceptions when password checks fail when changing password --- engine/lib/user_settings.php | 24 +++++++++++++++++------- languages/en.php | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'languages') diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php index 7c29e73c1..bb5d8d6c4 100644 --- a/engine/lib/user_settings.php +++ b/engine/lib/user_settings.php @@ -36,15 +36,15 @@ function elgg_set_user_password() { $current_password = get_input('current_password'); $password = get_input('password'); $password2 = get_input('password2'); - $user_id = get_input('guid'); + $user_guid = get_input('guid'); - if (!$user_id) { + if (!$user_guid) { $user = elgg_get_logged_in_user_entity(); } else { - $user = get_entity($user_id); + $user = get_entity($user_guid); } - if (($user) && ($password != "")) { + if ($user && $password) { // let admin user change anyone's password without knowing it except his own. if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) { $credentials = array( @@ -52,13 +52,22 @@ function elgg_set_user_password() { 'password' => $current_password ); - if (!pam_auth_userpass($credentials)) { - register_error(elgg_echo('user:password:fail:incorrect_current_password')); + try { + pam_auth_userpass($credentials); + } catch (LoginException $e) { + register_error(elgg_echo('LoginException:ChangePasswordFailure')); return false; } } - if (strlen($password) >= 4) { + try { + $result = validate_password($password); + } catch (RegistrationException $e) { + register_error($e->getMessage()); + return false; + } + + if ($result) { if ($password == $password2) { $user->salt = generate_random_cleartext_password(); // Reset the salt $user->password = generate_user_password($user, $password); @@ -78,6 +87,7 @@ function elgg_set_user_password() { // no change return null; } + return false; } diff --git a/languages/en.php b/languages/en.php index 3271967ed..5aecf559e 100644 --- a/languages/en.php +++ b/languages/en.php @@ -225,6 +225,7 @@ $english = array( 'LoginException:UsernameFailure' => 'We could not log you in. Please check your username and password.', 'LoginException:PasswordFailure' => 'We could not log you in. Please check your username and password.', 'LoginException:AccountLocked' => 'Your account has been locked for too many log in failures.', + 'LoginException:ChangePasswordFailure' => 'Failed current password check.', 'memcache:notinstalled' => 'PHP memcache module not installed, you must install php5-memcache', 'memcache:noservers' => 'No memcache servers defined, please populate the $CONFIG->memcache_servers variable', -- cgit v1.2.3 From 83f959ea0f131aea42c7a14614af27a48694e710 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Thu, 13 Oct 2011 18:35:37 -0700 Subject: Fixes #3734. Changed "Tested value" to "Expected value" in the plugin deps matrix. --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 5aecf559e..9967bc34d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -696,7 +696,7 @@ $english = array( 'admin:plugins:dependencies:type' => 'Type', 'admin:plugins:dependencies:name' => 'Name', - 'admin:plugins:dependencies:expected_value' => 'Tested Value', + 'admin:plugins:dependencies:expected_value' => 'Expected Value', 'admin:plugins:dependencies:local_value' => 'Actual value', 'admin:plugins:dependencies:comment' => 'Comment', -- cgit v1.2.3 From 96604b6836edc0ee2f9bfc58fdbaedf19a6f099c Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Thu, 13 Oct 2011 22:08:26 -0700 Subject: Fixes #3917. Removed uses of admin interface in manifests. Removed related code. --- actions/admin/plugins/simple_update_states.php | 48 -------------------------- documentation/examples/plugins/manifest.xml | 4 --- engine/classes/ElggPluginManifest.php | 18 ---------- engine/classes/ElggPluginManifestParser18.php | 3 +- engine/lib/admin.php | 2 -- engine/tests/api/plugins.php | 5 --- engine/tests/test_files/plugin_18/manifest.xml | 1 - languages/en.php | 5 --- mod/blog/manifest.xml | 1 - mod/bookmarks/manifest.xml | 1 - mod/categories/manifest.xml | 1 - mod/custom_index/manifest.xml | 1 - mod/dashboard/manifest.xml | 3 +- mod/developers/manifest.xml | 3 -- mod/diagnostics/manifest.xml | 1 - mod/embed/manifest.xml | 1 - mod/externalpages/manifest.xml | 1 - mod/file/manifest.xml | 1 - mod/garbagecollector/manifest.xml | 1 - mod/groups/manifest.xml | 1 - mod/htmlawed/manifest.xml | 1 - mod/invitefriends/manifest.xml | 1 - mod/likes/manifest.xml | 3 +- mod/logbrowser/manifest.xml | 1 - mod/logrotate/manifest.xml | 1 - mod/members/manifest.xml | 3 +- mod/messageboard/manifest.xml | 1 - mod/messages/manifest.xml | 1 - mod/notifications/manifest.xml | 1 - mod/pages/manifest.xml | 1 - mod/profile/manifest.xml | 1 - mod/reportedcontent/manifest.xml | 1 - mod/search/manifest.xml | 1 - mod/tagcloud/manifest.xml | 1 - mod/thewire/manifest.xml | 1 - mod/tinymce/manifest.xml | 1 - mod/twitter/manifest.xml | 1 - mod/uservalidationbyemail/manifest.xml | 1 - mod/zaudio/manifest.xml | 1 - 39 files changed, 4 insertions(+), 121 deletions(-) delete mode 100644 actions/admin/plugins/simple_update_states.php (limited to 'languages') diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php deleted file mode 100644 index 7601013a7..000000000 --- a/actions/admin/plugins/simple_update_states.php +++ /dev/null @@ -1,48 +0,0 @@ -getManifest()->getAdminInterface() != 'simple') { - continue; - } - - // only effect changes to plugins not already in that state. - if ($plugin->isActive() && !in_array($plugin->guid, $active_plugin_guids)) { - $success = $success && $plugin->deactivate(); - } elseif (!$plugin->isActive() && in_array($plugin->guid, $active_plugin_guids)) { - $success = $success && $plugin->activate(); - } -} - -if ($success) { - //system_message(elgg_echo('admin:plugins:simple_simple_success')); -} else { - register_error(elgg_echo('admin:plugins:simple_simple_fail')); -} - -// don't regenerate the simplecache because the plugin won't be -// loaded until next run. Just invalidate and let it regnerate as needed -elgg_invalidate_simplecache(); -elgg_filepath_cache_reset(); - -forward(REFERER); \ No newline at end of file diff --git a/documentation/examples/plugins/manifest.xml b/documentation/examples/plugins/manifest.xml index 1602a7358..2a8a2bd5c 100644 --- a/documentation/examples/plugins/manifest.xml +++ b/documentation/examples/plugins/manifest.xml @@ -32,10 +32,6 @@ admin api - setup_function - teardown_function - simple - php_extension gd diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 0e47f388d..eacc16455 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -552,24 +552,6 @@ class ElggPluginManifest { return $normalized; } - /** - * Returns the admin interface to use. - * - * @return string simple or advanced - */ - public function getAdminInterface() { - $interface = $this->parser->getAttribute('admin_interface'); - - switch ($interface) { - case 'simple': - case 'advanced': - return $interface; - - default: - return 'advanced'; - } - } - /** * Returns the admin interface to use. * diff --git a/engine/classes/ElggPluginManifestParser18.php b/engine/classes/ElggPluginManifestParser18.php index db8b3dc6a..554e28c02 100644 --- a/engine/classes/ElggPluginManifestParser18.php +++ b/engine/classes/ElggPluginManifestParser18.php @@ -16,7 +16,7 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser { 'name', 'author', 'version', 'blurb', 'description', 'website', 'copyright', 'license', 'requires', 'suggests', 'screenshot', 'category', 'conflicts', 'provides', - 'admin_interface', 'activate_on_install' + 'activate_on_install' ); /** @@ -46,7 +46,6 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser { case 'website': case 'copyright': case 'license': - case 'admin_interface': case 'activate_on_install': $parsed[$element->name] = $element->content; break; diff --git a/engine/lib/admin.php b/engine/lib/admin.php index d12baed50..ae6429baf 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -230,8 +230,6 @@ function admin_init() { elgg_register_action('admin/delete_admin_notice', '', 'admin'); - elgg_register_action('admin/plugins/simple_update_states', '', 'admin'); - elgg_register_action('profile/fields/reset', '', 'admin'); elgg_register_action('profile/fields/add', '', 'admin'); elgg_register_action('profile/fields/edit', '', 'admin'); diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 72092b688..8f5f5dd1e 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -105,7 +105,6 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => 1.0), ), - 'admin_interface' => 'simple', 'activate_on_install' => true ); @@ -265,10 +264,6 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { $this->assertEqual($this->manifest17->getConflicts(), array()); } - public function testElggPluginManifestGetAdminInterface() { - $this->assertEqual($this->manifest18->getAdminInterface(), 'simple'); - } - public function testElggPluginManifestGetActivateOnInstall() { $this->assertEqual($this->manifest18->getActivateOnInstall(), true); } diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml index 23f0fa0bf..445a41c2e 100644 --- a/engine/tests/test_files/plugin_18/manifest.xml +++ b/engine/tests/test_files/plugin_18/manifest.xml @@ -34,7 +34,6 @@ ServiceAPI - simple true diff --git a/languages/en.php b/languages/en.php index 9967bc34d..67e447901 100644 --- a/languages/en.php +++ b/languages/en.php @@ -686,12 +686,7 @@ $english = array( 'admin:plugins:plugin_website' => 'Plugin website', 'admin:plugins:author' => '%s', 'admin:plugins:version' => 'Version %s', - 'admin:plugins:simple' => 'Simple', - 'admin:plugins:advanced' => 'Advanced', 'admin:plugin_settings' => 'Plugin Settings', - 'admin:plugins:simple_simple_fail' => 'Could not save settings.', - 'admin:plugins:simple_simple_success' => 'Settings saved.', - 'admin:plugins:simple:cannot_activate' => 'Cannot activate this plugin. Check the advanced plugin admin area for more information.', 'admin:plugins:warning:unmet_dependencies_active' => 'This plugin is active but has unmet dependencies. You may encounter problems. See "more info" below for details.', 'admin:plugins:dependencies:type' => 'Type', diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml index 991462060..dfbd7a1a6 100644 --- a/mod/blog/manifest.xml +++ b/mod/blog/manifest.xml @@ -15,6 +15,5 @@ elgg_version 2010030101 - simple true diff --git a/mod/bookmarks/manifest.xml b/mod/bookmarks/manifest.xml index 72e9af9b0..24969b837 100644 --- a/mod/bookmarks/manifest.xml +++ b/mod/bookmarks/manifest.xml @@ -16,5 +16,4 @@ 2010030101 true - simple diff --git a/mod/categories/manifest.xml b/mod/categories/manifest.xml index 15d7192c1..db6f0324f 100644 --- a/mod/categories/manifest.xml +++ b/mod/categories/manifest.xml @@ -14,5 +14,4 @@ elgg_version 2010030101 - advanced diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml index 7bb2a2543..dd00f2c49 100644 --- a/mod/custom_index/manifest.xml +++ b/mod/custom_index/manifest.xml @@ -12,5 +12,4 @@ elgg_version 2009030702 - advanced diff --git a/mod/dashboard/manifest.xml b/mod/dashboard/manifest.xml index b5e9cff2e..7096fc86a 100644 --- a/mod/dashboard/manifest.xml +++ b/mod/dashboard/manifest.xml @@ -12,5 +12,4 @@ elgg_version 2010030101 - advanced - \ No newline at end of file + diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml index 4a7ed82bd..25840e164 100644 --- a/mod/developers/manifest.xml +++ b/mod/developers/manifest.xml @@ -15,7 +15,4 @@ elgg_version 2009030802 - - advanced - diff --git a/mod/diagnostics/manifest.xml b/mod/diagnostics/manifest.xml index e85b19aef..5ebd7cf55 100644 --- a/mod/diagnostics/manifest.xml +++ b/mod/diagnostics/manifest.xml @@ -14,5 +14,4 @@ elgg_version 2010030101 - advanced diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml index 02c012330..27e9b9ada 100644 --- a/mod/embed/manifest.xml +++ b/mod/embed/manifest.xml @@ -18,5 +18,4 @@ file true - advanced diff --git a/mod/externalpages/manifest.xml b/mod/externalpages/manifest.xml index 32528585d..4064ea602 100644 --- a/mod/externalpages/manifest.xml +++ b/mod/externalpages/manifest.xml @@ -12,5 +12,4 @@ elgg_version 2010030101 - advanced diff --git a/mod/file/manifest.xml b/mod/file/manifest.xml index aac9c3f6b..8a80e38dc 100644 --- a/mod/file/manifest.xml +++ b/mod/file/manifest.xml @@ -14,6 +14,5 @@ elgg_version 2010030101 - simple true diff --git a/mod/garbagecollector/manifest.xml b/mod/garbagecollector/manifest.xml index 466e49d61..0da71cd6b 100644 --- a/mod/garbagecollector/manifest.xml +++ b/mod/garbagecollector/manifest.xml @@ -14,5 +14,4 @@ 2009030702 true - advanced diff --git a/mod/groups/manifest.xml b/mod/groups/manifest.xml index 4188aa861..542e9de01 100644 --- a/mod/groups/manifest.xml +++ b/mod/groups/manifest.xml @@ -15,5 +15,4 @@ 2010030101 true - simple diff --git a/mod/htmlawed/manifest.xml b/mod/htmlawed/manifest.xml index 0c48bbd28..b176834e5 100644 --- a/mod/htmlawed/manifest.xml +++ b/mod/htmlawed/manifest.xml @@ -14,5 +14,4 @@ 2009041701 true - advanced diff --git a/mod/invitefriends/manifest.xml b/mod/invitefriends/manifest.xml index e02c19c36..75a2d17f2 100644 --- a/mod/invitefriends/manifest.xml +++ b/mod/invitefriends/manifest.xml @@ -13,6 +13,5 @@ elgg_version 2010030101 - advanced true diff --git a/mod/likes/manifest.xml b/mod/likes/manifest.xml index f63c643a6..946cfd86b 100644 --- a/mod/likes/manifest.xml +++ b/mod/likes/manifest.xml @@ -14,5 +14,4 @@ 2010030101 true - advanced - \ No newline at end of file + diff --git a/mod/logbrowser/manifest.xml b/mod/logbrowser/manifest.xml index 585288912..846ad155a 100644 --- a/mod/logbrowser/manifest.xml +++ b/mod/logbrowser/manifest.xml @@ -14,5 +14,4 @@ 2009030702 true - advanced diff --git a/mod/logrotate/manifest.xml b/mod/logrotate/manifest.xml index ab6250ac0..503bf6cd1 100644 --- a/mod/logrotate/manifest.xml +++ b/mod/logrotate/manifest.xml @@ -14,5 +14,4 @@ 2009030702 true - advanced diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml index b96684198..f5e95eb41 100644 --- a/mod/members/manifest.xml +++ b/mod/members/manifest.xml @@ -13,5 +13,4 @@ 2010030101 true - advanced - \ No newline at end of file + diff --git a/mod/messageboard/manifest.xml b/mod/messageboard/manifest.xml index 25c42ee93..5881c4e46 100644 --- a/mod/messageboard/manifest.xml +++ b/mod/messageboard/manifest.xml @@ -14,5 +14,4 @@ 2010030101 true - simple diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml index 66ca4b444..30acc240d 100644 --- a/mod/messages/manifest.xml +++ b/mod/messages/manifest.xml @@ -14,5 +14,4 @@ 2010030101 true - simple diff --git a/mod/notifications/manifest.xml b/mod/notifications/manifest.xml index 16a67cb00..97b88fb75 100644 --- a/mod/notifications/manifest.xml +++ b/mod/notifications/manifest.xml @@ -12,6 +12,5 @@ elgg_version 2010030101 - advanced true diff --git a/mod/pages/manifest.xml b/mod/pages/manifest.xml index 4b5e5c747..a91881cab 100644 --- a/mod/pages/manifest.xml +++ b/mod/pages/manifest.xml @@ -14,6 +14,5 @@ elgg_version 2010030101 - simple true diff --git a/mod/profile/manifest.xml b/mod/profile/manifest.xml index d811e373b..a1cff4dc2 100644 --- a/mod/profile/manifest.xml +++ b/mod/profile/manifest.xml @@ -10,7 +10,6 @@ See COPYRIGHT.txt GNU Public License Version 2 true - advanced elgg_version 2011010401 diff --git a/mod/reportedcontent/manifest.xml b/mod/reportedcontent/manifest.xml index c51134608..d65b55ca3 100644 --- a/mod/reportedcontent/manifest.xml +++ b/mod/reportedcontent/manifest.xml @@ -13,5 +13,4 @@ 2010030101 true - advanced diff --git a/mod/search/manifest.xml b/mod/search/manifest.xml index 053e22178..b13e127d0 100644 --- a/mod/search/manifest.xml +++ b/mod/search/manifest.xml @@ -13,5 +13,4 @@ 2009030702 true - advanced diff --git a/mod/tagcloud/manifest.xml b/mod/tagcloud/manifest.xml index 6fcad14e2..7c64829fc 100644 --- a/mod/tagcloud/manifest.xml +++ b/mod/tagcloud/manifest.xml @@ -13,5 +13,4 @@ elgg_version 2010030101 - advanced diff --git a/mod/thewire/manifest.xml b/mod/thewire/manifest.xml index 27dd5732d..74e811bed 100644 --- a/mod/thewire/manifest.xml +++ b/mod/thewire/manifest.xml @@ -13,6 +13,5 @@ elgg_version 2010030101 - simple true diff --git a/mod/tinymce/manifest.xml b/mod/tinymce/manifest.xml index 5e69055d8..2d062d399 100644 --- a/mod/tinymce/manifest.xml +++ b/mod/tinymce/manifest.xml @@ -14,5 +14,4 @@ 2010030101 true - advanced diff --git a/mod/twitter/manifest.xml b/mod/twitter/manifest.xml index bd7176620..ffb6ccc05 100644 --- a/mod/twitter/manifest.xml +++ b/mod/twitter/manifest.xml @@ -13,5 +13,4 @@ elgg_version 2010030101 - advanced diff --git a/mod/uservalidationbyemail/manifest.xml b/mod/uservalidationbyemail/manifest.xml index df0a7cb58..3358e1119 100644 --- a/mod/uservalidationbyemail/manifest.xml +++ b/mod/uservalidationbyemail/manifest.xml @@ -14,5 +14,4 @@ 2009033101 true - advanced diff --git a/mod/zaudio/manifest.xml b/mod/zaudio/manifest.xml index ecbff85fe..423a7e863 100644 --- a/mod/zaudio/manifest.xml +++ b/mod/zaudio/manifest.xml @@ -15,5 +15,4 @@ 2010111501 true - advanced -- cgit v1.2.3 From b301ca4285c3c9866276d495a883258feef1d5a2 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Thu, 20 Oct 2011 17:45:51 -0700 Subject: Fixes #3968. Added 'on' and 'off' to core language. --- languages/en.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 67e447901..9c5d1701d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -883,6 +883,9 @@ $english = array( 'tagcloud' => "Tag cloud", 'tagcloud:allsitetags' => "All site tags", + 'on' => 'On', + 'off' => 'Off', + /** * Entity actions */ -- cgit v1.2.3 From deda57ffd5e91cd0a032d29ecbc0970b345bdb72 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 26 Oct 2011 07:16:11 -0400 Subject: Fixes #3926 updated spacing for edit profile field forms --- languages/en.php | 6 +++--- views/default/admin/appearance/profile_fields/list.php | 2 +- views/default/forms/profile/fields/add.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 9c5d1701d..3216be5e7 100644 --- a/languages/en.php +++ b/languages/en.php @@ -393,11 +393,11 @@ $english = array( 'profile:label' => "Profile label", 'profile:type' => "Profile type", 'profile:editdefault:delete:fail' => 'Removed default profile item field failed', - 'profile:editdefault:delete:success' => 'Default profile item deleted!', - 'profile:defaultprofile:reset' => 'Default system profile reset', + 'profile:editdefault:delete:success' => 'Profile field deleted', + 'profile:defaultprofile:reset' => 'Profile fields reset to the system default', 'profile:resetdefault' => 'Reset default profile', 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will lose any information already entered into custom fields on profile pages.", - 'profile:editdefault:success' => 'Item successfully added to default profile', + 'profile:editdefault:success' => 'New profile field added', 'profile:editdefault:fail' => 'Default profile could not be saved', diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index 3e287ceac..b9440a95d 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -26,7 +26,7 @@ if ($fieldlist) { } } ?> -
    +
      'type', 'options_val $submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); $formbody = <<< END -
      $label_text: $label_control - $type_text: $type_control +
      $label_text: $label_control
      +
      $type_text: $type_control $submit_control
      END; -- cgit v1.2.3 From 4106d50727d5a56ec1442b16e182fbd9acc6b167 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 29 Oct 2011 15:07:43 -0400 Subject: Fixes #3201 updates rss view type for core Elgg --- engine/classes/ElggEntity.php | 15 ++++---- engine/classes/Locatable.php | 2 +- languages/en.php | 2 ++ views/default/annotation/generic_comment.php | 4 +-- views/rss/annotation/default.php | 34 ------------------ views/rss/annotation/generic_comment.php | 33 +++++++++++++++++ views/rss/group/default.php | 54 ++++++++++++++-------------- views/rss/object/creator.php | 8 ----- views/rss/object/default.php | 17 ++++----- views/rss/object/georss.php | 10 ------ views/rss/output/url.php | 2 +- views/rss/page/components/creator.php | 14 ++++++++ views/rss/page/components/georss.php | 15 ++++++++ views/rss/page/default.php | 17 ++++----- views/rss/page/elements/comments.php | 13 +++++++ views/rss/river/item.php | 27 +++++++------- views/rss/search/entity_list.php | 12 ------- views/rss/user/default.php | 43 ++++++++++++---------- 18 files changed, 169 insertions(+), 153 deletions(-) delete mode 100644 views/rss/annotation/default.php create mode 100644 views/rss/annotation/generic_comment.php delete mode 100644 views/rss/object/creator.php delete mode 100644 views/rss/object/georss.php create mode 100644 views/rss/page/components/creator.php create mode 100644 views/rss/page/components/georss.php create mode 100644 views/rss/page/elements/comments.php delete mode 100644 views/rss/search/entity_list.php (limited to 'languages') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index ccf88a6f7..fdf2a80ea 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -1434,10 +1434,11 @@ abstract class ElggEntity extends ElggData implements * * @param string $location String representation of the location * - * @return true + * @return bool */ public function setLocation($location) { - return $this->location = $location; + $this->location = $location; + return true; } /** @@ -1446,7 +1447,7 @@ abstract class ElggEntity extends ElggData implements * @param float $lat Latitude * @param float $long Longitude * - * @return true + * @return bool * @todo Unimplemented */ public function setLatLong($lat, $long) { @@ -1459,20 +1460,20 @@ abstract class ElggEntity extends ElggData implements /** * Return the entity's latitude. * - * @return int + * @return float * @todo Unimplemented */ public function getLatitude() { - return $this->get('geo:lat'); + return (float)$this->get('geo:lat'); } /** * Return the entity's longitude * - * @return Int + * @return float */ public function getLongitude() { - return $this->get('geo:long'); + return (float)$this->get('geo:long'); } /* diff --git a/engine/classes/Locatable.php b/engine/classes/Locatable.php index 0977dde99..7287d9798 100644 --- a/engine/classes/Locatable.php +++ b/engine/classes/Locatable.php @@ -13,7 +13,7 @@ interface Locatable { * @param string $location Textual representation of location * * @return bool - **/ + */ public function setLocation($location); /** diff --git a/languages/en.php b/languages/en.php index 3216be5e7..5af005814 100644 --- a/languages/en.php +++ b/languages/en.php @@ -425,6 +425,7 @@ $english = array( 'riveritem:plural:user' => 'some users', 'river:ingroup' => 'in the group %s', 'river:none' => 'No activity', + 'river:update' => 'Update for %s', 'river:widget:title' => "Activity", 'river:widget:description' => "Display latest activity", @@ -1098,6 +1099,7 @@ If you requested this click on the link below, otherwise ignore this email. 'generic_comment:notdeleted' => "Sorry, we could not delete this comment.", 'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.", 'generic_comment:none' => 'No comments', + 'generic_comment:title' => 'Comment by %s', 'generic_comment:email:subject' => 'You have a new comment!', 'generic_comment:email:body' => "You have a new comment on your item \"%s\" from %s. It reads: diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index a4fbf904e..56a06f842 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -2,8 +2,8 @@ /** * Elgg generic comment view * - * @uses $vars['annotation'] ElggAnnotation object - * @uses $vars['full_view'] Display fill view or brief view + * @uses $vars['annotation'] ElggAnnotation object + * @uses $vars['full_view'] Display fill view or brief view */ if (!isset($vars['annotation'])) { diff --git a/views/rss/annotation/default.php b/views/rss/annotation/default.php deleted file mode 100644 index 98329f132..000000000 --- a/views/rss/annotation/default.php +++ /dev/null @@ -1,34 +0,0 @@ -entity_guid); - -$title = substr($vars['annotation']->value, 0, 32); -if (strlen($vars['annotation']->value) > 32) { - $title .= " ..."; -} - -$permalink = $entity->getURL(); -$pubdate = date('r', $entity->time_created); - -$creator = elgg_view('object/creator', array('entity' => $entity)); -$georss = elgg_view('object/georss', array('entity' => $entity)); -$extensions = elgg_view('extensions/item'); - -$item = <<<__HTML - - $permalink#{$vars['annotation']->id} - $pubdate - $permalink#{$vars['annotation']->id} - <![CDATA[$title]]> - value}]]> - $creator$georss$extensions - -__HTML; - -echo $item; diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php new file mode 100644 index 000000000..9e9107568 --- /dev/null +++ b/views/rss/annotation/generic_comment.php @@ -0,0 +1,33 @@ +getOwnerEntity(); +$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $annotation->getTimeCreated()); +$permalink = $annotation->getURL(); + +$title = elgg_echo('generic_comment:title', array($poster_name)); + +$creator = elgg_view('page/components/creator', array('entity' => $annotation)); +$extensions = elgg_view('extensions/item'); + +$item = <<<__HTML + + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + value}]]> + $creator$extensions + + +__HTML; + +echo $item; diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 4ffceba78..1276ab8f1 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -1,37 +1,37 @@ +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = autop($vars['entity']->description); +} elseif ($vars['entity']->briefdescription) { + $description = autop($vars['entity']->briefdescription); +} else { + $description = ''; +} + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item'); + +$item = <<<__HTML -getURL()); ?> -time_created) ?> -getURL()); ?> -<![CDATA[<?php echo (($vars['entity']->name)); ?>]]> -description)); ?>]]> -getOwnerEntity(); - if ($owner) { -?> -name; ?> - -getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $creator$georss$extension + +__HTML; + +echo $item; diff --git a/views/rss/object/creator.php b/views/rss/object/creator.php deleted file mode 100644 index 2bc6fd57d..000000000 --- a/views/rss/object/creator.php +++ /dev/null @@ -1,8 +0,0 @@ -getOwnerEntity()) { - echo "{$owner->name}"; -} diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 29e5d4591..b5d269ac7 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -1,6 +1,6 @@ title; if (empty($title)) { - $subtitle = strip_tags($vars['entity']->description); - $title = substr($subtitle, 0, 32); - if (strlen($subtitle) > 32) { - $title .= ' ...'; - } + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -$permalink = htmlspecialchars($vars['entity']->getURL()); -$pubdate = date('r', $vars['entity']->time_created); +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); -$creator = elgg_view('object/creator', $vars); -$georss = elgg_view('object/georss', $vars); +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); $extension = elgg_view('extensions/item'); $item = <<<__HTML diff --git a/views/rss/object/georss.php b/views/rss/object/georss.php deleted file mode 100644 index 8aa027519..000000000 --- a/views/rss/object/georss.php +++ /dev/null @@ -1,10 +0,0 @@ -getLongitude()) && ($longitude = $vars['entity']->getLatitude()) -) { - echo "$latitude $longitude"; -} \ No newline at end of file diff --git a/views/rss/output/url.php b/views/rss/output/url.php index e0b94bf8d..b0f4d9792 100644 --- a/views/rss/output/url.php +++ b/views/rss/output/url.php @@ -1,6 +1,6 @@ getOwnerEntity(); +if ($owner) { + $owner_name = htmlspecialchars($owner->name, ENT_NOQUOTES, 'UTF-8'); + echo "$owner_name"; +} diff --git a/views/rss/page/components/georss.php b/views/rss/page/components/georss.php new file mode 100644 index 000000000..d176b8cac --- /dev/null +++ b/views/rss/page/components/georss.php @@ -0,0 +1,15 @@ +getLongitude(); +$latitude = $vars['entity']->getLatitude(); + +if ($vars['entity'] instanceof Locatable && $longitude && $latitude) { + echo "$latitude $longitude"; +} diff --git a/views/rss/page/default.php b/views/rss/page/default.php index cd94b0242..246ec972e 100644 --- a/views/rss/page/default.php +++ b/views/rss/page/default.php @@ -4,7 +4,6 @@ * * @package Elgg * @subpackage Core - * */ header("Content-Type: text/xml"); @@ -12,7 +11,7 @@ header("Content-Type: text/xml"); // allow caching as required by stupid MS products for https feeds. header('Pragma: public', TRUE); -echo "\n"; +echo ""; // Set title if (empty($vars['title'])) { @@ -22,8 +21,8 @@ if (empty($vars['title'])) { } // Remove RSS from URL -$url = str_replace('?view=rss','', full_url()); -$url = str_replace('&view=rss','', $url); +$url = str_replace('?view=rss', '', full_url()); +$url = str_replace('&view=rss', '', $url); ?> @@ -32,11 +31,9 @@ $url = str_replace('&view=rss','', $url); <![CDATA[<?php echo $title; ?>]]> - - + diff --git a/views/rss/page/elements/comments.php b/views/rss/page/elements/comments.php new file mode 100644 index 000000000..9c655ffef --- /dev/null +++ b/views/rss/page/elements/comments.php @@ -0,0 +1,13 @@ + $vars['entity']->getGUID(), + 'annotation_name' => 'generic_comment', + 'order_by' => 'n_table.time_created desc', +); +echo elgg_list_annotations($options); diff --git a/views/rss/river/item.php b/views/rss/river/item.php index f84e6ccf0..fa2914eff 100644 --- a/views/rss/river/item.php +++ b/views/rss/river/item.php @@ -6,27 +6,30 @@ */ $item = $vars['item']; -$view = $item->getView(); - $name = $item->getSubjectEntity()->name; -$body = elgg_view($item->getView(), array('item' => $item), false, false, 'default'); -$body = "$name $body"; +$name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8'); +$title = elgg_echo('river:update', array($name)); -$title = strip_tags($body); $timestamp = date('r', $item->getPostedTime()); +$body = elgg_view('river/elements/summary', $vars, false, false, 'default'); + $object = $item->getObjectEntity(); if ($object) { $url = htmlspecialchars($object->getURL()); } else { - $url = elgg_get_site_url() . 'activity'; + $url = elgg_normalize_url('activity'); } -?> +$html = <<<__HTML - - - - <![CDATA[<?php echo $title; ?>]]> - ]]> + $item->id + $timestamp + $url + <![CDATA[$title]]> + + +__HTML; + +echo $html; diff --git a/views/rss/search/entity_list.php b/views/rss/search/entity_list.php deleted file mode 100644 index 1e44adf18..000000000 --- a/views/rss/search/entity_list.php +++ /dev/null @@ -1,12 +0,0 @@ - 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -} \ No newline at end of file diff --git a/views/rss/user/default.php b/views/rss/user/default.php index a8b9d073c..1500881f8 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -1,29 +1,34 @@ +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = autop($vars['entity']->description); +} else { + $description = ''; +} + +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item'); + +$item = <<<__HTML -getURL(); ?> -time_created) ?> -getURL(); ?> -<![CDATA[<?php echo (($vars['entity']->name)); ?>]]> -description)); ?>]]> -getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $georss$extension + +__HTML; + +echo $item; -- cgit v1.2.3 From 3f9abf384029bf3fc899be2eead4e3121d20e331 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 30 Oct 2011 12:00:12 -0700 Subject: Fixes #2821. Plugins that are active and cannot be started emit an admin notice. --- engine/lib/plugins.php | 2 +- languages/en.php | 8 ++++---- views/default/admin/plugins.php | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'languages') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 86070a2aa..fac52b152 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -324,7 +324,7 @@ function elgg_load_plugins() { $plugin->deactivate(); $msg = elgg_echo('PluginException:CannotStart', array($plugin->getID(), $plugin->guid, $e->getMessage())); - register_error($msg); + elgg_add_admin_notice('cannot_start' . $plugin->getID(), $msg); $return = false; continue; diff --git a/languages/en.php b/languages/en.php index 5af005814..6aa292e5a 100644 --- a/languages/en.php +++ b/languages/en.php @@ -63,7 +63,7 @@ $english = array( 'InvalidClassException:NotValidElggStar' => "GUID:%d is not a valid %s", 'PluginException:MisconfiguredPlugin' => "%s (guid: %s) is a misconfigured plugin. It has been disabled. Please search the Elgg wiki for possible causes (http://docs.elgg.org/wiki/).", - 'PluginException:CannotStart' => '%s (guid: %s) cannot start. Reason: %s', + 'PluginException:CannotStart' => '%s (guid: %s) cannot start and has been deactivated. Reason: %s', 'PluginException:InvalidID' => "%s is an invalid plugin ID.", 'PluginException:InvalidPath' => "%s is an invalid plugin path.", 'PluginException:InvalidManifest' => 'Invalid manifest file for plugin %s', @@ -79,9 +79,9 @@ $english = array( 'ElggPluginPackage:InvalidPlugin:InvalidProvides' => 'Invalid provides type "%s"', 'ElggPluginPackage:InvalidPlugin:CircularDep' => 'Invalid %s dependency "%s" in plugin %s. Plugins cannot conflict with or require something they provide!', - 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s. Check permissions!', - 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s. Check permissions!', - 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s. Check permissions!', + 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s.', + 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s.', + 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s.', 'ElggPlugin:Exception:NoID' => 'No ID for plugin guid %s!', 'PluginException:ParserError' => 'Error parsing manifest with API version %s in plugin %s.', diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 5bd0dd55d..c3e7e3ab0 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -22,7 +22,8 @@ foreach ($installed_plugins as $id => $plugin) { if (!$plugin->isValid()) { if ($plugin->isActive()) { // force disable and warn - register_error(elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); + elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(), + elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); $plugin->deactivate(); } continue; -- cgit v1.2.3 From 8fb06897d3c1f6655e98dcf68eac02dcd7e26040 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 10 Nov 2011 21:45:55 -0500 Subject: fixed WSOD when trying to edit a private page --- languages/en.php | 2 ++ mod/pages/pages/pages/edit.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 6aa292e5a..62effb334 100644 --- a/languages/en.php +++ b/languages/en.php @@ -237,6 +237,8 @@ $english = array( 'pageownerunavailable' => 'Warning: The page owner %d is not accessible!', 'viewfailure' => 'There was an internal failure in the view %s', 'changebookmark' => 'Please change your bookmark for this page', + 'noaccess' => 'This content has been removed, is invalid, or you do not have permission to view it.', + /** * API */ diff --git a/mod/pages/pages/pages/edit.php b/mod/pages/pages/pages/edit.php index 6f54d72bf..1f411b94d 100644 --- a/mod/pages/pages/pages/edit.php +++ b/mod/pages/pages/pages/edit.php @@ -10,12 +10,14 @@ gatekeeper(); $page_guid = (int)get_input('guid'); $page = get_entity($page_guid); if (!$page) { - + register_error(elgg_echo('noaccess')); + forward(''); } $container = $page->getContainerEntity(); if (!$container) { - + register_error(elgg_echo('noaccess')); + forward(''); } elgg_set_page_owner_guid($container->getGUID()); -- cgit v1.2.3