From 217e79eaeb51587943376f0a1bfc68c3586af46e Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sat, 25 Feb 2012 13:45:15 -0800 Subject: Fixes #3312, #3632. Added class elgg-plugin-category- to the plugin div. Exposed plugin categories under more. Changed border color and size for bundled categories. --- views/default/object/plugin/full.php | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'views/default/object/plugin') diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index 74bd31d1c..db0a52416 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -17,20 +17,17 @@ $reordering = elgg_extract('display_reordering', $vars, false); $priority = $plugin->getPriority(); $active = $plugin->isActive(); -$name = $plugin->getManifest()->getName(); $can_activate = $plugin->canActivate(); $max_priority = elgg_get_max_plugin_priority(); $actions_base = '/action/admin/plugins/'; $css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); -$ts = time(); -$token = generate_action_token($ts); - // build reordering links $links = ''; +$classes = array('elgg-plugin'); if ($reordering) { - $draggable = 'elgg-state-draggable'; + $classes[] = 'elgg-state-draggable'; // top and up link only if not at top if ($priority > 1) { @@ -90,7 +87,7 @@ if ($reordering) { )) . ""; } } else { - $draggable = 'elgg-state-undraggable'; + $classes[] = 'elgg-state-undraggable'; } @@ -102,22 +99,22 @@ $options = array( 'is_trusted' => true, ); if ($active) { - $active_class = 'elgg-state-active'; + $classes[] = 'elgg-state-active'; $action = 'deactivate'; $options['text'] = elgg_echo('admin:plugins:deactivate'); $options['class'] = "elgg-button elgg-button-cancel"; if (!$can_activate) { - $active_class = 'elgg-state-active'; + $classes[] = 'elgg-state-active'; $options['class'] = 'elgg-button elgg-state-warning'; } } else if ($can_activate) { - $active_class = 'elgg-state-inactive'; + $classes[] = 'elgg-state-inactive'; $action = 'activate'; $options['text'] = elgg_echo('admin:plugins:activate'); $options['class'] = "elgg-button elgg-button-submit"; } else { - $active_class = 'elgg-state-inactive'; + $classes[] = 'elgg-state-inactive'; $action = ''; $options['text'] = elgg_echo('admin:plugins:cannot_activate'); $options['class'] = "elgg-button elgg-button-disabled"; @@ -133,18 +130,20 @@ if ($action) { } $action_button = elgg_view('output/url', $options); -// Display categories +// Display categories and make category classes +$categories = $plugin->getManifest()->getCategories(); $categories_html = ''; if ($categories) { - $categories_arr = array(); $base_url = elgg_get_site_url() . "admin/plugins?category="; foreach ($categories as $category) { + $css_class = preg_replace('/[^a-z0-9-]/i', '-', $category); + $classes[] = "elgg-plugin-category-$css_class"; + $url = $base_url . urlencode($category); - $categories_arr[] = "" . htmlspecialchars($category) . ''; + $friendly_category = htmlspecialchars(ElggPluginManifest::getFriendlyCategory($category)); + $categories_html .= "
  • $friendly_category
  • "; } - - $categories_html = implode(', ', $categories_arr); } $screenshots_html = ''; @@ -197,7 +196,7 @@ if ($files) { ?> -
    +
    @@ -219,7 +218,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) } ?>
    -

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

    +

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

    getManifest()->getApiVersion() < 1.8) { @@ -267,7 +266,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) if ($categories_html) { ?> -
    +
    $categories_html"; ?>