diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/admin/plugins.php | 8 | ||||
-rw-r--r-- | views/default/css/admin.php | 9 | ||||
-rw-r--r-- | views/default/forms/login.php | 2 | ||||
-rw-r--r-- | views/default/forms/register.php | 4 | ||||
-rw-r--r-- | views/default/icon/default.php | 5 | ||||
-rw-r--r-- | views/default/object/plugin.php | 4 | ||||
-rw-r--r-- | views/default/object/plugin/full.php | 35 |
7 files changed, 39 insertions, 28 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index b793175e0..42f153d0f 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -64,13 +64,7 @@ foreach ($installed_plugins as $id => $plugin) { if (isset($plugin_categories)) { foreach ($plugin_categories as $category) { if (!array_key_exists($category, $categories)) { - // 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; + $categories[$category] = ElggPluginManifest::getFriendlyCategory($category); } } } diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 6deceb14e..e3205ca4e 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -109,6 +109,8 @@ pre, code { background-color: #EEE; border: 1px solid #DDD; color: #444; + font-family: Monaco, "Courier New", Courier, monospace; + font-size: 13px; overflow: auto; margin: 15px 0; padding: 5px; @@ -1260,6 +1262,13 @@ a.elgg-widget-collapsed:before { padding: 5px 10px; margin: 4px 0; } +ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { + display: inline; +} +.elgg-plugin-category-bundled { + border-width: 2px; + border-color: #DAA520; +} /**************************************** MARKDOWN diff --git a/views/default/forms/login.php b/views/default/forms/login.php index 6f6cc9906..d2c6e6221 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -20,7 +20,7 @@ <?php echo elgg_view('input/password', array('name' => 'password')); ?> </div> -<?php echo elgg_view('login/extend'); ?> +<?php echo elgg_view('login/extend', $vars); ?> <div class="elgg-foot"> <label class="mtm float-alt"> diff --git a/views/default/forms/register.php b/views/default/forms/register.php index 411152205..75ecd3450 100644 --- a/views/default/forms/register.php +++ b/views/default/forms/register.php @@ -66,10 +66,10 @@ if (elgg_is_sticky_form('register')) { <?php // view to extend to add more fields to the registration form -echo elgg_view('register/extend'); +echo elgg_view('register/extend', $vars); // Add captcha hook -echo elgg_view('input/captcha'); +echo elgg_view('input/captcha', $vars); echo '<div class="elgg-foot">'; echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid'])); diff --git a/views/default/icon/default.php b/views/default/icon/default.php index 22c20b3a7..087c7eae9 100644 --- a/views/default/icon/default.php +++ b/views/default/icon/default.php @@ -34,10 +34,15 @@ if (isset($vars['href'])) { $url = $vars['href']; } +$icon_sizes = elgg_get_config('icon_sizes'); +$size = $vars['size']; + $img = elgg_view('output/img', array( 'src' => $entity->getIconURL($vars['size']), 'alt' => $title, 'class' => $class, + 'width' => $size != 'master' ? $icon_sizes[$size]['w'] : NULL, + 'height' => $size != 'master' ? $icon_sizes[$size]['h'] : NULL, )); if ($url) { diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php index 2f64cfcc9..5c7138e96 100644 --- a/views/default/object/plugin.php +++ b/views/default/object/plugin.php @@ -7,6 +7,10 @@ * */ +if (!elgg_in_context('admin')) { + forward('/', 403); +} + $plugin = $vars['entity']; if (!$plugin->isValid()) { 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) { )) . "</li>"; } } 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[] = "<a href=\"$url\">" . htmlspecialchars($category) . '</a>'; + $friendly_category = htmlspecialchars(ElggPluginManifest::getFriendlyCategory($category)); + $categories_html .= "<li class=\"elgg-plugin-category prm\"><a href=\"$url\">$friendly_category</a></li>"; } - - $categories_html = implode(', ', $categories_arr); } $screenshots_html = ''; @@ -197,7 +196,7 @@ if ($files) { ?> -<div class="<?php echo $draggable; ?> elgg-plugin <?php echo $active_class ?>" id="<?php echo $css_id; ?>"> +<div class="<?php echo implode(' ', $classes); ?>" id="<?php echo $css_id; ?>"> <div class="elgg-image-block"> <div class="elgg-image-alt"> <?php if ($links) : ?> @@ -219,7 +218,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) } ?> <div class="elgg-head"> - <h3><?php echo $plugin->getManifest()->getName(). " $version $settings_link"; ?></h3> + <h3><?php echo $plugin->getManifest()->getName() . " $version $settings_link"; ?></h3> </div> <?php if ($plugin->getManifest()->getApiVersion() < 1.8) { @@ -267,7 +266,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) if ($categories_html) { ?> - <div><?php echo elgg_echo('admin:plugins:label:categories') . ": " . $categories_html; ?></div> + <div><?php echo elgg_echo('admin:plugins:label:categories') . ": <ul class=\"elgg-plugin-categories\">$categories_html</ul>"; ?></div> <?php } |