From 82593cd2bc056da73caa1b1e981c5a9ead0f1bf2 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 27 Apr 2011 02:37:16 +0000 Subject: Refs #3362. Plugins don't check deps upon boot. Made package and manifest private properties of ElggPlugin and added ->getPackage() and ->getManifest(). git-svn-id: http://code.elgg.org/elgg/trunk@9030 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/object/plugin/advanced.php | 24 +++++++++++----------- .../object/plugin/elements/dependencies.php | 2 +- views/default/object/plugin/simple.php | 10 ++++----- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'views/default/object') diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index a346d4ff1..4c8bc8c17 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -13,7 +13,7 @@ $plugin = $vars['entity']; $priority = $plugin->getPriority(); $active = $plugin->isActive(); -$name = $plugin->manifest->getName(); +$name = $plugin->getManifest()->getName(); $can_activate = $plugin->canActivate(); $max_priority = elgg_get_max_plugin_priority(); $actions_base = '/action/admin/plugins/'; @@ -123,7 +123,7 @@ if ($categories) { } $screenshots_html = ''; -$screenshots = $plugin->manifest->getScreenshots(); +$screenshots = $plugin->getManifest()->getScreenshots(); if ($screenshots) { $base_url = elgg_get_plugins_path() . $plugin->getID() . '/'; foreach ($screenshots as $screenshot) { @@ -138,17 +138,17 @@ if ($screenshots) { } // metadata -$description = elgg_view('output/longtext', array('value' => $plugin->manifest->getDescription())); +$description = elgg_view('output/longtext', array('value' => $plugin->getManifest()->getDescription())); $author = '' . elgg_echo('admin:plugins:label:author') . ': ' - . elgg_view('output/text', array('value' => $plugin->manifest->getAuthor())); -$version = htmlspecialchars($plugin->manifest->getVersion()); + . elgg_view('output/text', array('value' => $plugin->getManifest()->getAuthor())); +$version = htmlspecialchars($plugin->getManifest()->getVersion()); $website = elgg_view('output/url', array( - 'href' => $plugin->manifest->getWebsite(), - 'text' => $plugin->manifest->getWebsite() + 'href' => $plugin->getManifest()->getWebsite(), + 'text' => $plugin->getManifest()->getWebsite() )); -$copyright = elgg_view('output/text', array('value' => $plugin->manifest->getCopyright())); -$license = elgg_view('output/text', array('value' => $plugin->manifest->getLicense())); +$copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright())); +$license = elgg_view('output/text', array('value' => $plugin->getManifest()->getLicense())); // show links to text files $files = $plugin->getAvailableTextFiles(); @@ -189,11 +189,11 @@ if (elgg_view_exists($settings_view)) { } ?>
-

manifest->getName(). " $version $settings_link"; ?>

+

getManifest()->getName(). " $version $settings_link"; ?>

manifest->getApiVersion() < 1.8) { - $reqs = $plugin->manifest->getRequires(); + if ($plugin->getManifest()->getApiVersion() < 1.8) { + $reqs = $plugin->getManifest()->getRequires(); if (!$reqs) { $message = elgg_echo('admin:plugins:warning:elgg_version_unknown'); echo "

$message

"; diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php index 11a441a4a..b5cdaf8b6 100644 --- a/views/default/object/plugin/elements/dependencies.php +++ b/views/default/object/plugin/elements/dependencies.php @@ -9,7 +9,7 @@ */ $plugin = elgg_extract('plugin', $vars, false); -$deps = $plugin->package->checkDependencies(true); +$deps = $plugin->getPackage()->checkDependencies(true); $columns = array('type', 'name', 'expected_value', 'local_value', 'comment'); diff --git a/views/default/object/plugin/simple.php b/views/default/object/plugin/simple.php index d57d81934..5f5b08f10 100644 --- a/views/default/object/plugin/simple.php +++ b/views/default/object/plugin/simple.php @@ -5,11 +5,11 @@ $plugin_guid = $plugin->guid; $plugin_id = $plugin->getID(); $active = $plugin->isActive(); $can_activate = $plugin->canActivate(); -$name = $plugin->manifest->getName(); -$author = $plugin->manifest->getAuthor(); -$version = $plugin->manifest->getVersion(); -$website = $plugin->manifest->getWebsite(); -$description = $plugin->manifest->getDescription(); +$name = $plugin->getManifest()->getName(); +$author = $plugin->getManifest()->getAuthor(); +$version = $plugin->getManifest()->getVersion(); +$website = $plugin->getManifest()->getWebsite(); +$description = $plugin->getManifest()->getDescription(); if ($active) { $active_class = 'elgg-state-active'; -- cgit v1.2.3 From 4661a25efbdec0680681d76fd1da41519d4d7eb9 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 28 Apr 2011 19:53:05 +0000 Subject: Refs #3236 removed elgg-states-* from admin css since it was overaggressive git-svn-id: http://code.elgg.org/elgg/trunk@9045 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/css/admin.php | 81 +++++++++------------- .../object/plugin/elements/dependencies.php | 4 +- 2 files changed, 34 insertions(+), 51 deletions(-) (limited to 'views/default/object') diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 3a9db0fd0..ae3002dcb 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -226,6 +226,17 @@ table.mceLayout { border: 2px solid #ddd; cursor: pointer; } +.elgg-message.elgg-state-error { + background: #fbe3e4; + color: #8a1f11; + border-color: #fbc2c4; + font-weight: bold; +} +.elgg-message.elgg-state-success { + background: #e6efc2; + color: #264409; + border-color: #c6d880; +} /* *************************************** BODY @@ -685,6 +696,16 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover .elgg-widgets-add-panel li a { display: block; } +.elgg-widget-single.elgg-state-available { + color: #333; + cursor: pointer; +} +.elgg-widget-single.elgg-state-available:hover { + border-color: #aaa; +} +.elgg-widget-single.elgg-state-unavailable { + color: #888; +} .elgg-module-widget { background-color: #dedede; @@ -1044,58 +1065,11 @@ a.elgg-longtext-control { .right {float:right} .elgg-toggle {cursor:pointer} -/* *************************************** - STATES -*************************************** */ - -.elgg-state-active { - background:#ccc; - color: #333; -} - -.elgg-state-inactive { - background:#dedede; -} - -.elgg-state-available { - color: #333; - cursor: pointer; -} - -.elgg-state-available:hover { - border-color: #aaa; -} - -.elgg-state-unavailable { - color: #888; -} - -.elgg-state-success { - background: #e6efc2; - color: #264409; - border-color: #c6d880; -} - -.elgg-state-error { - background: #fbe3e4; - color: #8a1f11; - border-color: #fbc2c4; - font-weight: bold; -} - -p.elgg-state-error { - padding: 5px; -} - .elgg-state-draggable .elgg-head { cursor: move; } - -.elgg-state-selected {} -.elgg-state-disabled {} - /* *************************************** ADMIN MISC *************************************** */ @@ -1134,8 +1108,8 @@ form.admin_plugins_simpleview .elgg-button-submit { margin-right: 10px; } ul.admin_plugins { - margin-bottom:0; - padding-left:0; + margin-bottom: 0; + padding-left: 0; list-style: none; } .elgg-plugin { @@ -1185,6 +1159,15 @@ ul.admin_plugins { .elgg-plugin.elgg-state-active { background: white; } +.elgg-plugin.elgg-state-inactive { + background: #dedede; +} +.elgg-dependency.elgg-state-error { + background: #fbe3e4; + color: #8a1f11; + border-color: #fbc2c4; + font-weight: bold; +} .admin_notices { padding-bottom: 15px; diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php index b5cdaf8b6..f4d1ccc5a 100644 --- a/views/default/object/plugin/elements/dependencies.php +++ b/views/default/object/plugin/elements/dependencies.php @@ -28,9 +28,9 @@ foreach ($deps as $dep) { $type = $dep['type']; if ($dep['status']) { - $class = "elgg-state-success elgg-dependency-$type"; + $class = "elgg-state-success elgg-dependency elgg-dependency-$type"; } else { - $class = "elgg-state-error elgg-dependency-$type"; + $class = "elgg-state-error elgg-dependency elgg-dependency-$type"; } echo ""; -- cgit v1.2.3 From 7ee9c7cacbe5da9ecc8c5bb8d3ba51be3ce1d30a Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 19 May 2011 23:42:41 +0000 Subject: Fixes #3163 plugin//settings.php is now the preferred way to add settings plugins git-svn-id: http://code.elgg.org/elgg/trunk@9101 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/admin.php | 8 +++++--- views/default/object/plugin/advanced.php | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'views/default/object') diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 5528a29cc..8016a2fd6 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -325,7 +325,9 @@ function elgg_admin_add_plugin_settings_menu() { foreach ($active_plugins as $plugin) { $plugin_id = $plugin->getID(); - if (elgg_view_exists("settings/$plugin_id/edit")) { + $settings_view_old = 'settings/' . $plugin_id . '/edit'; + $settings_view_new = 'plugins/' . $plugin_id . '/settings'; + if (elgg_view_exists($settings_view_new) || elgg_view_exists($settings_view_old)) { elgg_register_menu_item('page', array( 'name' => $plugin_id, 'href' => "admin/plugin_settings/$plugin_id", @@ -413,8 +415,8 @@ function admin_settings_page_handler($page) { $vars = array('page' => $page); // special page for plugin settings since we create the form for them - if ($page[0] == 'plugin_settings' && isset($page[1]) - && elgg_view_exists("settings/{$page[1]}/edit")) { + if ($page[0] == 'plugin_settings' && isset($page[1]) && + (elgg_view_exists("settings/{$page[1]}/edit") || elgg_view_exists("plugins/{$page[1]}/settings"))) { $view = 'admin/plugin_settings'; $plugin = elgg_get_plugin_from_id($page[1]); diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 4c8bc8c17..9aed4163c 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -182,8 +182,9 @@ if ($files) {
getID() . '/edit'; -if (elgg_view_exists($settings_view)) { +$settings_view_old = 'settings/' . $plugin->getID() . '/edit'; +$settings_view_new = 'plugins/' . $plugin->getID() . '/settings'; +if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)) { $link = elgg_get_site_url() . "admin/plugin_settings/" . $plugin->getID(); $settings_link = "[" . elgg_echo('settings') . "]"; } -- cgit v1.2.3 From 9a68be3c337ed98475535ab6b0483f53073678e1 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 24 May 2011 17:59:51 +0000 Subject: Fixes #3467. Fixed bugs in priority deps. Can now disable active plugins with unmet dependencies. git-svn-id: http://code.elgg.org/elgg/trunk@9111 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggPluginPackage.php | 13 +++---- languages/en.php | 1 + views/default/css/admin.php | 9 ++++- views/default/object/plugin/advanced.php | 61 +++++++++++++++++++------------- 4 files changed, 50 insertions(+), 34 deletions(-) (limited to 'views/default/object') diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 9aa4af8bf..977b72d76 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -457,16 +457,11 @@ class ElggPluginPackage { // grab the ElggPlugin using this package. $plugin_package = elgg_get_plugin_from_id($this->getID()); $plugin_priority = $plugin_package->getPriority(); + $test_plugin = elgg_get_plugin_from_id($dep['plugin']); - foreach ($plugins as $test_plugin) { - if ($test_plugin->getID() == $dep['plugin']) { - break; - } - } - - // If this isn't a plugin or there are no active plugins, - // we can't satisfy this dep. - if (!$plugin_package || !$plugins) { + // If this isn't a plugin or the plugin isn't installed or active + // priority doesn't matter. Use requires to check if a plugin is active. + if (!$plugin_package || !$test_plugin || !$test_plugin->isActive()) { return array( 'status' => true, 'value' => 'uninstalled' diff --git a/languages/en.php b/languages/en.php index 509de7fb0..83fb66dad 100644 --- a/languages/en.php +++ b/languages/en.php @@ -661,6 +661,7 @@ $english = array( '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', 'admin:plugins:dependencies:name' => 'Name', diff --git a/views/default/css/admin.php b/views/default/css/admin.php index c4dacad91..744211a20 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1179,12 +1179,19 @@ ul.admin_plugins { .elgg-plugin.elgg-state-inactive { background: #dedede; } -.elgg-dependency.elgg-state-error { + +.elgg-state-error { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; font-weight: bold; } +.elgg-state-warning { + background: #fbedb5; + color: #000000; + border-color: #fbe58b; + font-weight: bold; +} .admin_notices { padding-bottom: 15px; diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 9aed4163c..56e680ad5 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -20,7 +20,6 @@ $actions_base = '/action/admin/plugins/'; $ts = time(); $token = generate_action_token($ts); -$active_class = ($active && $can_activate) ? 'elgg-state-active' : 'elgg-state-inactive'; // build reordering links $links = ''; @@ -80,33 +79,42 @@ if ($priority < $max_priority) { } // activate / deactivate links -if ($can_activate) { - if ($active) { - $action = 'deactivate'; - $class = 'elgg-button-cancel'; - } else { - $action = 'activate'; - $class = 'elgg-button-submit'; + +// always let them deactivate +$options = array( + 'is_action' => true +); +if ($active) { + $active_class = 'elgg-state-active'; + $action = 'deactivate'; + $options['text'] = elgg_echo('deactivate'); + $options['class'] = "elgg-button elgg-button-cancel"; + + if (!$can_activate) { + $active_class = 'elgg-state-active'; + $options['class'] = 'elgg-button elgg-state-warning'; } +} else if ($can_activate) { + $active_class = 'elgg-state-inactive'; + $action = 'activate'; + $options['text'] = elgg_echo('activate'); + $options['class'] = "elgg-button elgg-button-submit"; +} else { + $active_class = 'elgg-state-inactive'; + $action = ''; + $options['text'] = elgg_echo('admin:plugins:cannot_activate'); + $options['class'] = "elgg-button elgg-button-disabled"; + $options['disabled'] = 'disabled'; +} +if ($action) { $url = elgg_http_add_url_query_elements($actions_base . $action, array( - 'plugin_guids[]' => $plugin->guid, - 'is_action' => true + 'plugin_guids[]' => $plugin->guid )); - $action_button = elgg_view('output/url', array( - 'href' => $url, - 'text' => elgg_echo($action), - 'is_action' => true, - 'class' => "elgg-button $class" - )); -} else { - $action_button = elgg_view('output/url', array( - 'text' => elgg_echo('admin:plugins:cannot_activate'), - 'disabled' => 'disabled', - 'class' => "elgg-button elgg-button-action elgg-state-disabled" - )); + $options['href'] = $url; } +$action_button = elgg_view('output/url', $options); // Display categories $categories_html = ''; @@ -202,8 +210,13 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) } if (!$can_activate) { - $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); - echo "

$message

"; + if ($active) { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies_active'); + echo "

$message

"; + } else { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); + echo "

$message

"; + } } ?> -- cgit v1.2.3 From 727ba0b25e7b5737dcffb3061b96dba5f1a7f034 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 19:11:55 +0000 Subject: Refs #2871 only showing links for changing priority when all plugins are shown in priority order git-svn-id: http://code.elgg.org/elgg/trunk@9154 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/admin/plugins/advanced.php | 11 ++- views/default/object/plugin/advanced.php | 100 +++++++++++---------- .../object/plugin/elements/dependencies.php | 2 +- 3 files changed, 65 insertions(+), 48 deletions(-) (limited to 'views/default/object') diff --git a/views/default/admin/plugins/advanced.php b/views/default/admin/plugins/advanced.php index deae9dcdd..9f426fae2 100644 --- a/views/default/admin/plugins/advanced.php +++ b/views/default/admin/plugins/advanced.php @@ -156,7 +156,16 @@ $buttons .= $category_form . $sort_form;
0, + 'full_view' => true, + 'list_type_toggle' => false, + 'pagination' => false, +); +if ($show_category == 'all' && $sort == 'priority') { + $options['display_reordering'] = true; +} +echo elgg_view_entity_list($plugin_list, $options); ?>
\ No newline at end of file diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 56e680ad5..21c99f619 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -5,11 +5,15 @@ * This file renders a plugin for the admin screen, including active/deactive, * manifest details & display plugin settings. * + * @uses $vars['entity'] + * @uses $vars['display_reordering'] Do we display the priority reordering links? + * * @package Elgg.Core * @subpackage Plugins */ $plugin = $vars['entity']; +$reordering = elgg_extract('display_reordering', $vars, false); $priority = $plugin->getPriority(); $active = $plugin->isActive(); @@ -24,58 +28,60 @@ $token = generate_action_token($ts); // build reordering links $links = ''; -// top and up link only if not at top -if ($priority > 1) { - $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'first', - 'is_action' => true - )); +if ($reordering) { + // top and up link only if not at top + if ($priority > 1) { + $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'first', + 'is_action' => true + )); - $links .= "
  • " . elgg_view('output/url', array( - 'href' => $top_url, - 'text' => elgg_echo('top'), - 'is_action' => true - )) . "
  • "; + $links .= "
  • " . elgg_view('output/url', array( + 'href' => $top_url, + 'text' => elgg_echo('top'), + 'is_action' => true + )) . "
  • "; - $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '-1', - 'is_action' => true - )); + $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '-1', + 'is_action' => true + )); - $links .= "
  • " . elgg_view('output/url', array( - 'href' => $up_url, - 'text' => elgg_echo('up'), - 'is_action' => true - )) . "
  • "; -} + $links .= "
  • " . elgg_view('output/url', array( + 'href' => $up_url, + 'text' => elgg_echo('up'), + 'is_action' => true + )) . "
  • "; + } -// down and bottom links only if not at bottom -if ($priority < $max_priority) { - $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '+1', - 'is_action' => true - )); + // down and bottom links only if not at bottom + if ($priority < $max_priority) { + $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '+1', + 'is_action' => true + )); - $links .= "
  • " . elgg_view('output/url', array( - 'href' => $down_url, - 'text' => elgg_echo('down'), - 'is_action' => true - )) . "
  • "; + $links .= "
  • " . elgg_view('output/url', array( + 'href' => $down_url, + 'text' => elgg_echo('down'), + 'is_action' => true + )) . "
  • "; - $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'last', - 'is_action' => true - )); + $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'last', + 'is_action' => true + )); - $links .= "
  • " . elgg_view('output/url', array( - 'href' => $bottom_url, - 'text' => elgg_echo('bottom'), - 'is_action' => true - )) . "
  • "; + $links .= "
  • " . elgg_view('output/url', array( + 'href' => $bottom_url, + 'text' => elgg_echo('bottom'), + 'is_action' => true + )) . "
  • "; + } } // activate / deactivate links @@ -181,9 +187,11 @@ if ($files) {
    + +
    diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php index f4d1ccc5a..5f4aa4392 100644 --- a/views/default/object/plugin/elements/dependencies.php +++ b/views/default/object/plugin/elements/dependencies.php @@ -20,7 +20,7 @@ foreach ($columns as $column) { echo "$column"; } -echo ''; +echo ''; $row = 'odd'; foreach ($deps as $dep) { -- cgit v1.2.3 From b2ac9d066412a94a35492eaa118461268385f762 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 19:17:43 +0000 Subject: Refs #2871 also turning off dragging when not in priority order git-svn-id: http://code.elgg.org/elgg/trunk@9155 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/object/plugin/advanced.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'views/default/object') diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 21c99f619..51fb69d17 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -29,6 +29,8 @@ $token = generate_action_token($ts); $links = ''; if ($reordering) { + $draggable = 'elgg-state-draggable'; + // top and up link only if not at top if ($priority > 1) { $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( @@ -82,8 +84,11 @@ if ($reordering) { 'is_action' => true )) . ""; } +} else { + $draggable = 'elgg-state-undraggable'; } + // activate / deactivate links // always let them deactivate @@ -184,7 +189,7 @@ if ($files) { ?> -
    +
    -- cgit v1.2.3 From c7b2f1c9b9732704ca0d4b6da9cadb2b0818de85 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 11 Jun 2011 15:13:40 +0000 Subject: Refs #3096 Moved page/components/summary to object/elements/summary. Left page/components/summary for backwards compatibility. Plugins will eventually need to be updated to use $type/elements/summary git-svn-id: http://code.elgg.org/elgg/trunk@9173 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/object/elements/summary.php | 53 +++++++++++++++++++++++++++++++ views/default/page/components/summary.php | 53 ++----------------------------- 2 files changed, 55 insertions(+), 51 deletions(-) create mode 100644 views/default/object/elements/summary.php (limited to 'views/default/object') diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php new file mode 100644 index 000000000..d3a6ea862 --- /dev/null +++ b/views/default/object/elements/summary.php @@ -0,0 +1,53 @@ +
  • Public
  • Like this
  • + *

    Title

    + *

    Posted 3 hours ago by George

    + *

    one, two

    + *
    Excerpt text
    + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +$entity = $vars['entity']; + +$title_link = elgg_extract('title', $vars, ''); +if ($title_link === '') { + if (isset($entity->title)) { + $text = $entity->title; + } else { + $text = $entity->name; + } + $params = array( + 'text' => $text, + 'href' => $entity->getURL(), + ); + $title_link = elgg_view('output/url', $params); +} + +$metadata = elgg_extract('metadata', $vars, ''); +$subtitle = elgg_extract('subtitle', $vars, ''); +$content = elgg_extract('content', $vars, ''); + +$tags = elgg_extract('tags', $vars, ''); +if ($tags !== false) { + $tags = elgg_view('output/tags', array('tags' => $entity->tags)); +} + +if ($metadata) { + echo $metadata; +} +echo "

    $title_link

    "; +echo "
    $subtitle
    "; +echo $tags; +if ($content) { + echo "
    $content
    "; +} diff --git a/views/default/page/components/summary.php b/views/default/page/components/summary.php index 578e9b9cf..ea61a6e4b 100644 --- a/views/default/page/components/summary.php +++ b/views/default/page/components/summary.php @@ -1,53 +1,4 @@
  • Public
  • Like this
  • - *

    Title

    - *

    Posted 3 hours ago by George

    - *

    one, two

    - *
    Excerpt text
    - * - * @uses $vars['entity'] ElggEntity - * @uses $vars['title'] Title link (optional) false = no title, '' = default - * @uses $vars['metadata'] HTML for entity metadata and actions (optional) - * @uses $vars['subtitle'] HTML for the subtitle (optional) - * @uses $vars['tags'] HTML for the tags (optional) - * @uses $vars['content'] HTML for the entity content (optional) - */ -$entity = $vars['entity']; - -$title_link = elgg_extract('title', $vars, ''); -if ($title_link === '') { - if (isset($entity->title)) { - $text = $entity->title; - } else { - $text = $entity->name; - } - $params = array( - 'text' => $text, - 'href' => $entity->getURL(), - ); - $title_link = elgg_view('output/url', $params); -} - -$metadata = elgg_extract('metadata', $vars, ''); -$subtitle = elgg_extract('subtitle', $vars, ''); -$content = elgg_extract('content', $vars, ''); - -$tags = elgg_extract('tags', $vars, ''); -if ($tags !== false) { - $tags = elgg_view('output/tags', array('tags' => $entity->tags)); -} - -if ($metadata) { - echo $metadata; -} -echo "

    $title_link

    "; -echo "
    $subtitle
    "; -echo $tags; -if ($content) { - echo "
    $content
    "; -} +// Deprecated in favor of type/elements/summary +echo elgg_view('object/elements/summary', $vars); -- cgit v1.2.3 From d720eac96fda5415f4becf64d6ba49716aa14f6c Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 11 Jun 2011 15:25:34 +0000 Subject: Fixes #3096 added user and group summery views an updated plugins to use the new view locations git-svn-id: http://code.elgg.org/elgg/trunk@9174 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/views/default/object/blog.php | 4 ++-- mod/bookmarks/views/default/object/bookmarks.php | 4 ++-- mod/embed/views/default/embed/item/list.php | 2 +- mod/file/views/default/object/file.php | 4 ++-- mod/groups/views/default/group/default.php | 2 +- mod/groups/views/default/object/groupforumtopic.php | 4 ++-- mod/pages/views/default/object/page_top.php | 4 ++-- mod/thewire/views/default/object/thewire.php | 2 +- views/default/group/elements/summary.php | 13 +++++++++++++ views/default/object/default.php | 2 +- views/default/user/default.php | 2 +- views/default/user/elements/summary.php | 13 +++++++++++++ 12 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 views/default/group/elements/summary.php create mode 100644 views/default/user/elements/summary.php (limited to 'views/default/object') diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 048a68a1a..8456829fe 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -74,7 +74,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); $blog_info = elgg_view_image_block($owner_icon, $list_body); @@ -94,7 +94,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $list_body); } diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index ab00e23c6..38b0a721a 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -65,7 +65,7 @@ if ($full && !elgg_in_context('gallery')) { 'subtitle' => $subtitle, 'tags' => $tags, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); $bookmark_info = elgg_view_image_block($owner_icon, $list_body); $bookmark_icon = elgg_view_icon('push-pin-alt'); @@ -119,6 +119,6 @@ HTML; 'content' => $content, ); - $body = elgg_view('page/components/summary', $params); + $body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $body); } \ No newline at end of file diff --git a/mod/embed/views/default/embed/item/list.php b/mod/embed/views/default/embed/item/list.php index 232f0558b..89a2ffb63 100644 --- a/mod/embed/views/default/embed/item/list.php +++ b/mod/embed/views/default/embed/item/list.php @@ -54,7 +54,7 @@ $params = array( 'subtitle' => $subtitle, 'tags' => FALSE, ); -$list_body = elgg_view('page/components/summary', $params); +$list_body = elgg_view('object/elements/summary', $params); // @todo JS 1.8: is this approach better than inline js? echo "
    getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '
    '; diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 0b58ca76f..93a21c8e6 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -82,7 +82,7 @@ if ($full && !elgg_in_context('gallery')) { 'subtitle' => $subtitle, 'tags' => $tags, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); $file_info = elgg_view_image_block($file_icon, $list_body); @@ -112,7 +112,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($file_icon, $list_body); } diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index 1f1035a38..2aa377813 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -31,7 +31,7 @@ if ($vars['full_view']) { 'metadata' => $metadata, 'subtitle' => $group->briefdescription, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('group/elements/summary', $params); echo elgg_view_image_block($icon, $list_body); } diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 9589d1fb8..3a4decbe4 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -67,7 +67,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); $info = elgg_view_image_block($poster_icon, $list_body); @@ -90,7 +90,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($poster_icon, $list_body); } diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php index 0ad377c7e..2ad44e38c 100644 --- a/mod/pages/views/default/object/page_top.php +++ b/mod/pages/views/default/object/page_top.php @@ -82,7 +82,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); $info = elgg_view_image_block($page_icon, $list_body); @@ -103,7 +103,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($page_icon, $list_body); } diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php index 7beb197ee..3ae347711 100644 --- a/mod/thewire/views/default/object/thewire.php +++ b/mod/thewire/views/default/object/thewire.php @@ -51,7 +51,7 @@ $params = array( 'content' => thewire_filter($post->description), 'tags' => false, ); -$list_body = elgg_view('page/components/summary', $params); +$list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $list_body); diff --git a/views/default/group/elements/summary.php b/views/default/group/elements/summary.php new file mode 100644 index 000000000..395ed5292 --- /dev/null +++ b/views/default/group/elements/summary.php @@ -0,0 +1,13 @@ + $subtitle, 'tags' => $vars['entity']->tags, ); -$body = elgg_view('page/components/summary', $params); +$body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($icon, $body); diff --git a/views/default/user/default.php b/views/default/user/default.php index 501949306..c0c18f85f 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -51,7 +51,7 @@ if (elgg_get_context() == 'gallery') { ); } - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('user/elements/summary', $params); echo elgg_view_image_block($icon, $list_body); } diff --git a/views/default/user/elements/summary.php b/views/default/user/elements/summary.php new file mode 100644 index 000000000..46d11c14c --- /dev/null +++ b/views/default/user/elements/summary.php @@ -0,0 +1,13 @@ +