From 17c28c8161e8c551ce4e4a1345e525cbb785fb59 Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 8 Jul 2012 09:48:50 +0200 Subject: Fixes #3646. Added suport for Repository, Bugtracker and Donations in manifest. --- views/default/css/admin.php | 3 ++- views/default/object/plugin/full.php | 28 ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 78ec95c26..437b0f00f 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1460,7 +1460,8 @@ a.elgg-widget-collapsed:before { padding: 5px 10px; margin: 4px 0; } -ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { +ul.elgg-plugin-categories, ul.elgg-plugin-categories > li, +ul.elgg-plugin-resources, ul.elgg-plugin-resources > li { display: inline; } .elgg-plugin-category-bundled { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index db0a52416..a96acd4ec 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -172,6 +172,26 @@ $website = elgg_view('output/url', array( 'is_trusted' => true, )); +$resources = array( + 'repository' => $plugin->getManifest()->getRepository(), + 'bugtracker' => $plugin->getManifest()->getBugTracker(), + 'donate' => $plugin->getManifest()->getDonationsPage(), +); + +$resources_html = ""; + $copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright())); $license = elgg_view('output/text', array('value' => $plugin->getManifest()->getLicense())); @@ -242,7 +262,11 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)

- + +
- \ No newline at end of file + -- cgit v1.2.3 From b7edff977107e928660256f37bbf4bc35fdea0a9 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 00:58:12 +0200 Subject: Refs #3646. "getRepositoryURL" is more descriptive than "getRepository". --- engine/classes/ElggPluginManifest.php | 10 +++++----- engine/tests/api/plugins.php | 4 ++-- views/default/object/plugin/full.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'views') diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 5eb248c2c..5706d1e42 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -264,7 +264,7 @@ class ElggPluginManifest { /** * Returns the license * - * @return sting + * @return string */ public function getLicense() { // license vs licence. Use license. @@ -279,16 +279,16 @@ class ElggPluginManifest { /** * Returns the repository url * - * @return sting + * @return string */ - public function getRepository() { + public function getRepositoryURL() { return $this->parser->getAttribute('repository'); } /** * Returns the bug tracker page * - * @return sting + * @return string */ public function getBugTracker() { return $this->parser->getAttribute('bugtracker'); @@ -297,7 +297,7 @@ class ElggPluginManifest { /** * Returns the donations page * - * @return sting + * @return string */ public function getDonationsPage() { return $this->parser->getAttribute('donations'); diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 66297266c..3b650f1b0 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -169,8 +169,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { } public function testElggPluginManifestGetRepository() { - $this->assertEqual($this->manifest18->getRepository(), 'https://github.com/Elgg/Elgg'); - $this->assertEqual($this->manifest17->getRepository(), ''); + $this->assertEqual($this->manifest18->getRepositoryURL(), 'https://github.com/Elgg/Elgg'); + $this->assertEqual($this->manifest17->getRepositoryURL(), ''); } public function testElggPluginManifestGetBugtracker() { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index a96acd4ec..76e1136f2 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -173,7 +173,7 @@ $website = elgg_view('output/url', array( )); $resources = array( - 'repository' => $plugin->getManifest()->getRepository(), + 'repository' => $plugin->getManifest()->getRepositoryURL(), 'bugtracker' => $plugin->getManifest()->getBugTracker(), 'donate' => $plugin->getManifest()->getDonationsPage(), ); -- cgit v1.2.3 From d7a5c24dd7c31318cf2e4405337919b7fd5ec304 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 07:12:12 -0400 Subject: Fixes #4691 not passing name to the form since not valid --- mod/blog/lib/blog.php | 1 - mod/blog/views/default/js/blog/save_draft.php | 6 +++--- views/default/page/elements/comments.php | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'views') diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 9a02a8cc3..4622a9e7e 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -272,7 +272,6 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) { $vars = array(); $vars['id'] = 'blog-post-edit'; - $vars['name'] = 'blog_post'; $vars['class'] = 'elgg-form-alt'; if ($page == 'edit') { diff --git a/mod/blog/views/default/js/blog/save_draft.php b/mod/blog/views/default/js/blog/save_draft.php index 8a994ffb0..8cd07ff5d 100644 --- a/mod/blog/views/default/js/blog/save_draft.php +++ b/mod/blog/views/default/js/blog/save_draft.php @@ -12,7 +12,7 @@ elgg.provide('elgg.blog'); */ elgg.blog.saveDraftCallback = function(data, textStatus, XHR) { if (textStatus == 'success' && data.success == true) { - var form = $('form[name=blog_post]'); + var form = $('form[id=blog-post-edit]'); // update the guid input element for new posts that now have a guid form.find('input[name=guid]').val(data.guid); @@ -36,7 +36,7 @@ elgg.blog.saveDraft = function() { } // only save on changed content - var form = $('form[name=blog_post]'); + var form = $('form[id=blog-post-edit]'); var description = form.find('textarea[name=description]').val(); var title = form.find('input[name=title]').val(); @@ -59,7 +59,7 @@ elgg.blog.saveDraft = function() { elgg.blog.init = function() { // get a copy of the body to compare for auto save - oldDescription = $('form[name=blog_post]').find('textarea[name=description]').val(); + oldDescription = $('form[id=blog-post-edit]').find('textarea[name=description]').val(); setInterval(elgg.blog.saveDraft, 60000); }; diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php index cf9b5f08b..97cb9574e 100644 --- a/views/default/page/elements/comments.php +++ b/views/default/page/elements/comments.php @@ -36,8 +36,7 @@ if ($html) { } if ($show_add_form) { - $form_vars = array('name' => 'elgg_add_comment'); - echo elgg_view_form('comments/add', $form_vars, $vars); + echo elgg_view_form('comments/add', array(), $vars); } echo ''; -- cgit v1.2.3 From cf151b55922b638feeeb9477b1d5dea764f4427b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 13:10:41 -0400 Subject: added .elgg-text-help to admin theme --- views/default/css/admin.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'views') diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 78ec95c26..6f9ed643e 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1510,6 +1510,12 @@ ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { margin-bottom: 5px; } +.elgg-text-help { + display: block; + font-size: 85%; + font-style: italic; +} + .elgg-longtext-control { margin-left: 14px; font-size: 80%; -- cgit v1.2.3 From 1ed326672a833f020bdb15f0b9cb047ab57f0b5b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 21:32:35 -0400 Subject: Fixes #3817 cleans up advanced settings form --- actions/admin/site/update_advanced.php | 2 -- views/default/forms/admin/site/update_advanced.php | 31 ++++++++++------------ 2 files changed, 14 insertions(+), 19 deletions(-) (limited to 'views') diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php index 897a2f983..0fd8d1f35 100644 --- a/actions/admin/site/update_advanced.php +++ b/actions/admin/site/update_advanced.php @@ -53,8 +53,6 @@ if ($site = elgg_get_site_entity()) { $user_default_access = (get_input('allow_user_default_access')) ? 1 : 0; set_config('allow_user_default_access', $user_default_access, $site->getGUID()); - set_config('view', get_input('view'), $site->getGUID()); - $debug = get_input('debug'); if ($debug) { set_config('debug', $debug, $site->getGUID()); diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php index b935090f0..14b74e4f9 100644 --- a/views/default/forms/admin/site/update_advanced.php +++ b/views/default/forms/admin/site/update_advanced.php @@ -30,21 +30,21 @@ $form_body .= elgg_view('input/access', array( )) . ""; $form_body .= "
" . elgg_echo('installation:allow_user_default_access:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:allow_user_default_access:label') => elgg_echo('installation:allow_user_default_access:label')), + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => 1), 'name' => 'allow_user_default_access', - 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), + 'value' => (elgg_get_config('allow_user_default_access') ? 1 : 0), )) . "
"; $form_body .= "
" . elgg_echo('installation:simplecache:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:simplecache:label') => elgg_echo('installation:simplecache:label')), + 'options' => array(elgg_echo('installation:simplecache:label') => 1), 'name' => 'simplecache_enabled', - 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), + 'value' => (elgg_get_config('simplecache_enabled') ? 1 : 0), )) . "
"; $form_body .= "
" . elgg_echo('installation:systemcache:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:systemcache:label') => elgg_echo('installation:systemcache:label')), + 'options' => array(elgg_echo('installation:systemcache:label') => 1), 'name' => 'system_cache_enabled', - 'value' => (elgg_get_config('system_cache_enabled') ? elgg_echo('installation:systemcache:label') : ""), + 'value' => (elgg_get_config('system_cache_enabled') ? 1 : 0), )) . "
"; $debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); @@ -58,9 +58,9 @@ $form_body .= ''; // control new user registration $options = array( - 'options' => array(elgg_echo('installation:registration:label') => elgg_echo('installation:registration:label')), + 'options' => array(elgg_echo('installation:registration:label') => 1), 'name' => 'allow_registration', - 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', + 'value' => elgg_get_config('allow_registration') ? 1 : 0, ); $form_body .= '
' . elgg_echo('installation:registration:description'); $form_body .= '
' .elgg_view('input/checkboxes', $options) . '
'; @@ -68,28 +68,25 @@ $form_body .= '
' .elgg_view('input/checkboxes', $options) . ''; // control walled garden $walled_garden = elgg_get_config(walled_garden); $options = array( - 'options' => array(elgg_echo('installation:walled_garden:label') => elgg_echo('installation:walled_garden:label')), + 'options' => array(elgg_echo('installation:walled_garden:label') => 1), 'name' => 'walled_garden', - 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', + 'value' => $walled_garden ? 1 : 0, ); $form_body .= '
' . elgg_echo('installation:walled_garden:description'); $form_body .= '
' . elgg_view('input/checkboxes', $options) . '
'; $form_body .= "
" . elgg_echo('installation:httpslogin') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:httpslogin:label') => elgg_echo('installation:httpslogin:label')), + 'options' => array(elgg_echo('installation:httpslogin:label') => 1), 'name' => 'https_login', - 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") + 'value' => (elgg_get_config('https_login') ? 1 : 0) )) . "
"; $form_body .= "
" . elgg_echo('installation:disableapi') . "
"; -$on = elgg_echo('installation:disableapi:label'); $disable_api = elgg_get_config('disable_api'); -if ($disable_api) { - $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); -} +$on = $disable_api ? 0 : 1; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:disableapi:label') => elgg_echo('installation:disableapi:label')), + 'options' => array(elgg_echo('installation:disableapi:label') => 1), 'name' => 'api', 'value' => $on, )); -- cgit v1.2.3 From 2e0cc0343715adec8a0843750016f89acc3c2394 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 21:44:14 -0400 Subject: Fixes #4661 not showing access on widgets loaded through ajax if the layout does not show access --- actions/widgets/add.php | 3 ++- js/lib/ui.widgets.js | 1 + views/default/page/layouts/widgets.php | 1 + views/default/page/layouts/widgets/add_panel.php | 9 ++++++--- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'views') diff --git a/actions/widgets/add.php b/actions/widgets/add.php index f65d11134..d7b2f291c 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -9,6 +9,7 @@ $owner_guid = get_input('owner_guid'); $handler = get_input('handler'); $context = get_input('context'); +$show_access = (bool)get_input('show_access', true); $column = get_input('column', 1); $default_widgets = get_input('default_widgets', 0); @@ -29,7 +30,7 @@ if (!empty($owner_guid)) { $widget->move($column, 0); // send widget html for insertion - echo elgg_view_entity($widget); + echo elgg_view_entity($widget, array('show_access' => $show_access)); //system_message(elgg_echo('widgets:add:success')); forward(REFERER); diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index b7d4b2fe4..26020bb4b 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -58,6 +58,7 @@ elgg.ui.widgets.add = function(event) { handler: type, owner_guid: elgg.get_page_owner_guid(), context: $("input[name='widget_context']").val(), + show_access: $("input[name='show_access']").val(), default_widgets: $("input[name='default_widgets']").val() || 0 }, success: function(json) { diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php index e3819cc20..c6b162516 100644 --- a/views/default/page/layouts/widgets.php +++ b/views/default/page/layouts/widgets.php @@ -31,6 +31,7 @@ if (elgg_can_edit_widget_layout($context)) { 'widgets' => $widgets, 'context' => $context, 'exact_match' => $exact_match, + 'show_access' => $show_access, ); echo elgg_view('page/layouts/widgets/add_panel', $params); } diff --git a/views/default/page/layouts/widgets/add_panel.php b/views/default/page/layouts/widgets/add_panel.php index 9eb78cdb6..d9b11342a 100644 --- a/views/default/page/layouts/widgets/add_panel.php +++ b/views/default/page/layouts/widgets/add_panel.php @@ -50,10 +50,13 @@ foreach ($widgets as $column_widgets) { ?> 'widget_context', 'value' => $context - ); - echo elgg_view('input/hidden', $params); + )); + echo elgg_view('input/hidden', array( + 'name' => 'show_access', + 'value' => (int)$vars['show_access'] + )); ?>
-- cgit v1.2.3 From 1080fecabc592c9c319c1aa816f61eb922cf3285 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 16 Jul 2012 20:05:39 -0400 Subject: added URL to the other new method names --- engine/classes/ElggPluginManifest.php | 4 ++-- engine/tests/api/plugins.php | 8 ++++---- views/default/object/plugin/full.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'views') diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 5706d1e42..a1fe66856 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -290,7 +290,7 @@ class ElggPluginManifest { * * @return string */ - public function getBugTracker() { + public function getBugTrackerURL() { return $this->parser->getAttribute('bugtracker'); } @@ -299,7 +299,7 @@ class ElggPluginManifest { * * @return string */ - public function getDonationsPage() { + public function getDonationsPageURL() { return $this->parser->getAttribute('donations'); } diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 3b650f1b0..114f3991b 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -174,13 +174,13 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { } public function testElggPluginManifestGetBugtracker() { - $this->assertEqual($this->manifest18->getBugTracker(), 'http://trac.elgg.org'); - $this->assertEqual($this->manifest17->getBugTracker(), ''); + $this->assertEqual($this->manifest18->getBugTrackerURL(), 'http://trac.elgg.org'); + $this->assertEqual($this->manifest17->getBugTrackerURL(), ''); } public function testElggPluginManifestGetDonationsPage() { - $this->assertEqual($this->manifest18->getDonationsPage(), 'http://elgg.org/supporter.php'); - $this->assertEqual($this->manifest17->getDonationsPage(), ''); + $this->assertEqual($this->manifest18->getDonationsPageURL(), 'http://elgg.org/supporter.php'); + $this->assertEqual($this->manifest17->getDonationsPageURL(), ''); } public function testElggPluginManifestGetCopyright() { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index 76e1136f2..2de65b555 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -174,8 +174,8 @@ $website = elgg_view('output/url', array( $resources = array( 'repository' => $plugin->getManifest()->getRepositoryURL(), - 'bugtracker' => $plugin->getManifest()->getBugTracker(), - 'donate' => $plugin->getManifest()->getDonationsPage(), + 'bugtracker' => $plugin->getManifest()->getBugTrackerURL(), + 'donate' => $plugin->getManifest()->getDonationsPageURL(), ); $resources_html = "
    "; -- cgit v1.2.3 From 4dd2ca9d54b64ebbf5eba3e3036f747cadb40825 Mon Sep 17 00:00:00 2001 From: Sem Date: Sat, 28 Jul 2012 03:34:59 +0200 Subject: Fixes #4740. Added language fallback in javascript. --- views/default/js/languages.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'views') diff --git a/views/default/js/languages.php b/views/default/js/languages.php index 009e8159c..c51d7bcb2 100644 --- a/views/default/js/languages.php +++ b/views/default/js/languages.php @@ -6,4 +6,10 @@ global $CONFIG; $language = $vars['language']; -echo json_encode($CONFIG->translations[$language]); \ No newline at end of file +$translations = $CONFIG->translations['en']; + +if ($language != 'en') { + $translations = array_merge($translations, $CONFIG->translations[$language]); +} + +echo json_encode($translations); \ No newline at end of file -- cgit v1.2.3