]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added screenshots to plugins list.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 6 Apr 2010 22:40:40 +0000 (22:40 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 6 Apr 2010 22:40:40 +0000 (22:40 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5638 36083f99-b078-4883-b0ff-0f9b5a30f544

languages/en.php
views/default/admin/plugins.php
views/default/admin/plugins_opt/plugin.php
views/default/css.php
views/default/js/initialise_elgg.php

index 62a8a7d0981be1f9613ee067376a6177d239c69a..e0742d9097031a6650df8f0abbb19ae7cd63a259 100644 (file)
@@ -466,6 +466,7 @@ To remove a widget drag it back to the <b>Widget gallery</b>.",
        'admin:plugins:opt:description' => "Configure the tools installed on the site. ",
        'admin:plugins:label:author' => "Author",
        'admin:plugins:label:copyright' => "Copyright",
+       'admin:plugins:label:categories' => 'Categories',
        'admin:plugins:label:licence' => "Licence",
        'admin:plugins:label:website' => "URL",
        'admin:plugins:label:moreinfo' => 'more info',
index d92c837f6925a63f93bed040bc5764291a6dafdd..5a5d37f8c8a81f8adcdd200d163a14889145fb2c 100644 (file)
@@ -70,3 +70,16 @@ foreach ($installed_plugins as $plugin => $data) {
        echo elgg_view("admin/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data, 'maxorder' => $max, 'order' => array_search($plugin, $plugin_list)));
        $n++;
 }
+
+?>
+
+<script type="text/javascript">
+$(document).ready(function() {
+       $('a.plugin_settings.link').click(function() {
+               elgg_slide_toggle($(this), '.plugin_details', '.pluginsettings');
+       });
+       $('a.manifest_details.link').click(function() {
+               elgg_slide_toggle($(this), '.plugin_details', '.manifest_file');
+       });
+});
+</script>
index c03477beabc18f76c50e55dda6fda256a8222d1c..7a7b10f63b7d3264bae8a4b7aa35a6a21c9323bc 100644 (file)
@@ -27,90 +27,133 @@ if ($manifest['elgg_version']) {
 
 $ts = time();
 $token = generate_action_token($ts);
+$active_class = ($active) ? 'active' : 'not_active';
+
+$top_url = $up_url = $down_url = $bottom_url = '';
+if ($vars['order'] > 10) {
+       $top_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=1&__elgg_token=$token&__elgg_ts=$ts";
+       $top_link = '<a href="' . elgg_format_url($top_url) . '">' . elgg_echo('top') . '</a>';
+
+       $order = $vars['order'] - 11;
+
+       $up_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
+       $up_link = '<a href="' . elgg_format_url($up_url) . '">' . elgg_echo('up') . '</a>';
+}
+
+if ($vars['order'] < $vars['maxorder']) {
+       $order =  $vars['order'] + 11;
+       $down_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
+       $down_link = '<a href="' . elgg_format_url($down_url) . '">' . elgg_echo('down') . '</a>';
+
+       $order = $vars['maxorder'] + 11;
+       $bottom_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
+       $bottom_link = '<a href="' . elgg_format_url($bottom_url) . '">' . elgg_echo('bottom') . '</a>';
+}
+
+if ($active) {
+       $url = "{$vars['url']}action/admin/plugins/disable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts";
+       $enable_disable = '<a class="cancel_button" href="' . elgg_format_url($url) . '">' . elgg_echo('disable') . '</a>';
+} else {
+       $url = "{$vars['url']}action/admin/plugins/enable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts";
+       $enable_disable = '<a class="submit_button" href="' . elgg_format_url($url) . '">' . elgg_echo('enable') . '</a>';
+}
+
+
+$categories_list = '';
+if ($manifest['category']) {
+       $categories_arr = array();
+       $base_url = "{$vars['url']}pg/admin/plugins?category=";
+
+       foreach($manifest['category'] as $category) {
+               $url = $base_url . urlencode($category);
+               $categories_arr[] = "<a href=\"$url\">" . htmlspecialchars($category) . '</a>';
+       }
+
+       $categories_list = implode(', ', $categories_arr);
+}
+
+$screenshots = '';
+if ($manifest['screenshot']) {
+       $base_url = "{$vars['url']}mod/";
+
+       $limit = 4;
+       foreach ($manifest['screenshot'] as $screenshot) {
+               if ($limit <= 0) {
+                       break;
+               }
+
+               $screenshot_src = $base_url . $plugin . "/$screenshot";
+               $screenshots .= "<li class=\"plugin_screenshot\"><a href=\"$screenshot_src\"><img src=\"$screenshot_src\"></a></li>";
+
+               $limit--;
+       }
+}
+
 ?>
-<div class="plugin_details <?php if ($active) echo "active"; else echo "not_active" ?>">
+
+<div class="plugin_details <?php echo $active_class ?>">
        <div class="admin_plugin_reorder">
-<?php
-                       if ($vars['order'] > 10) {
-                               $top_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=1&__elgg_token=$token&__elgg_ts=$ts";
-                               $order = $vars['order'] - 11;
-                               $up_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
-?>
-                       <a href="<?php echo elgg_format_url($top_url); ?>"><?php echo elgg_echo("top"); ?></a>
-                       <a href="<?php echo elgg_format_url($up_url); ?>"><?php echo elgg_echo("up"); ?></a>
-<?php
-                       }
-               ?>
-               <?php
-                       if ($vars['order'] < $vars['maxorder']) {
-                               $order =  $vars['order'] + 11;
-                               $down_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
-                               $order = $vars['maxorder'] + 11;
-                               $bottom_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts";
-?>
-                       <a href="<?php echo elgg_format_url($down_url); ?>"><?php echo elgg_echo("down"); ?></a>
-                       <a href="<?php echo elgg_format_url($bottom_url); ?>"><?php echo elgg_echo("bottom"); ?></a>
-<?php
-                       }
-               ?>
-       </div><div class="clearfloat"></div>
-       <div class="admin_plugin_enable_disable">
-               <?php if ($active) {
-                       $url = "{$vars['url']}action/admin/plugins/disable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts";
-               ?>
-                       <a class="cancel_button" href="<?php echo elgg_format_url($url); ?>"><?php echo elgg_echo("disable"); ?></a>
-               <?php } else { 
-                       $url = "{$vars['url']}action/admin/plugins/enable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts";
-               ?>
-                       <a class="submit_button" href="<?php echo elgg_format_url($url); ?>"><?php echo elgg_echo("enable"); ?></a>
-               <?php } ?>
+       <?php echo "$top_link $up_link $down_link $bottom_link"; ?>
        </div>
 
-       <h3><?php echo $plugin_pretty_name; ?><?php if (elgg_view("settings/{$plugin}/edit")) { ?> <a class="plugin_settings small link" onclick="elgg_slide_toggle(this,'.plugin_details','.pluginsettings');">[<?php echo elgg_echo('settings'); ?>]</a><?php } ?></h3>
+       <h3><?php echo "$plugin_pretty_name $settings_link"; ?></h3>
 
-       <?php if (elgg_view("settings/{$plugin}/edit")) { ?>
-       <div class="pluginsettings hidden">
-                       <div id="<?php echo $plugin; ?>_settings">
-                               <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin))) ?>
-                       </div>
-       </div>
-       <?php } ?>
+       <div class="clearfloat"></div>
+       <div class="admin_plugin_enable_disable"><?php echo $enable_disable; ?></div>
 
        <?php
-
-               if ($manifest) {
-
-       ?>
+       if (elgg_view_exists("settings/{$plugin}/edit")) {
+               ?>
+               <a class="plugin_settings small link">['<?php echo elgg_echo('settings'); ?>']</a>';
+               <div class="pluginsettings hidden">
+                       <div id="$plugin_settings">
+                               <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin))); ?>
+                       </div>
+               </div>
+               <?php
+       }
+       if ($manifest) {
+               ?>
                <div class="plugin_description"><?php echo elgg_view('output/longtext',array('value' => $manifest['description'])); ?></div>
-       <?php
+               <div><span class="plugin_label"><?php echo elgg_echo('admin:plugins:label:author') . "</span>: ". htmlspecialchars($manifest['author']) ?></div>
+               <div><span class="plugin_label"><?php echo elgg_echo('admin:plugins:label:version') . "</span>: ". htmlspecialchars($manifest['version']) ?></div>
 
-               }
-
-       ?>
+               <p><a class="manifest_details small link"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></p>
 
-       <p><a class="manifest_details small link" onclick="elgg_slide_toggle(this,'.plugin_details','.manifest_file');"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></p>
+               <div class="manifest_file hidden">
 
-       <div class="manifest_file hidden">
+               <?php
+               if ((!$version_check_valid) || (!isset($manifest['elgg_version']))) {
+                       ?>
+                       <div id="version_check">
+                               <?php
+                                       if (!isset($manifest['elgg_version'])) {
+                                               echo elgg_echo('admin:plugins:warning:elggversionunknown');
+                                       } else {
+                                               echo elgg_echo('admin:plugins:warning:elggtoolow');
+                                       }
+                               ?>
+                       </div>
+                       <?php
+               }
 
-       <?php if ($manifest) { ?>
-               <?php if ((!$version_check_valid) || (!isset($manifest['elgg_version']))) { ?>
-               <div id="version_check">
+               ?>
+               <div><?php echo elgg_echo('admin:plugins:label:directory') . ": ". htmlspecialchars($plugin) ?></div>
+               <?php
+               if ($categories_list) {
+                       ?>
+                       <div><?php echo elgg_echo('admin:plugins:label:categories') . ": ". $categories_list ?></div>
                        <?php
-                               if (!isset($manifest['elgg_version']))
-                                       echo elgg_echo('admin:plugins:warning:elggversionunknown');
-                               else
-                                       echo elgg_echo('admin:plugins:warning:elggtoolow');
+               }
+               if ($screenshots) {
                        ?>
-               </div>
-               <?php } ?>
-               <div><?php echo elgg_echo('admin:plugins:label:directory') . ": ". htmlspecialchars($plugin) ?></div>
-               <div><?php echo elgg_echo('admin:plugins:label:version') . ": ". htmlspecialchars($manifest['version']) ?></div>
-               <div><?php echo elgg_echo('admin:plugins:label:author') . ": ". htmlspecialchars($manifest['author']) ?></div>
+                       <div><ul><?php echo $screenshots; ?></ul></div>
+                       <?php
+               }
+               ?>
                <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": ". htmlspecialchars($manifest['copyright']) ?></div>
                <div><?php echo elgg_echo('admin:plugins:label:licence') . ": ". htmlspecialchars($manifest['licence'] . $manifest['license']) ?></div>
                <div><?php echo elgg_echo('admin:plugins:label:website') . ": "; ?><a href="<?php echo $manifest['website']; ?>"><?php echo $manifest['website']; ?></a></div>
        <?php } ?>
-
        </div>
-
 </div>
\ No newline at end of file
index b9e3bf809902631de4ee7a81acabf0885abfd002..cc3c82d4b380c268813aea441c8b9ed61dacb2c3 100644 (file)
@@ -1614,4 +1614,16 @@ a.action_button:focus {
 .admin_settings.menuitems li.custom_menuitem {
        margin-bottom:20px;
 }
-
+.plugin_info_label {
+       font-weight: bold;
+}
+.plugin_description {
+       font-style: italic;
+}
+.plugin_screenshot {
+       display: inline;
+       margin: 3px;
+}
+.plugin_screenshot img {
+       width: 100px;
+}
\ No newline at end of file
index 66fc31cbfee136cef2cab4db44ce3d85bc8da890..19b2224d945cc5a69832dbe91168e3a3b132cfcb 100644 (file)
@@ -93,7 +93,7 @@ function elgg_system_message() {
 }
 
 // reusable slide in/out toggle function
-function elgg_slide_toggle(activateLink,parentElement,toggleElement) {
+function elgg_slide_toggle(activateLink, parentElement, toggleElement) {
        $(activateLink).closest(parentElement).find(toggleElement).animate({"height": "toggle"}, { duration: 400 });
        return false;
 }