Skip to content

Commit

Permalink
Better plugin list
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrp committed Jul 8, 2011
1 parent a445d94 commit 26483cc
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 60 deletions.
13 changes: 13 additions & 0 deletions js/server_plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Functions used in server plugins pages
*/

$(function() {
// Add tabs
$('#pluginsTabs').tabs({
// Tab persistence
cookie: { name: 'pma_serverStatusTabs', expires: 1 },
// Fixes line break in the menu bar when the page overflows and scrollbar appears
show: function() { menuResize(); }
});
});
193 changes: 135 additions & 58 deletions server_plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
*/
require_once './libraries/common.inc.php';

/**
* JS includes
*/
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'jquery/jquery.cookie.js';
$GLOBALS['js_include'][] = 'server_plugins.js';

/**
* Does the common work
*/
Expand All @@ -29,7 +36,6 @@
*/
require './libraries/server_links.inc.php';


/**
* Displays the sub-page heading
*/
Expand All @@ -40,7 +46,6 @@
. "\n" . __('Plugins') . "\n"
. '</h2>' . "\n";


/**
* Prepare plugin list
*/
Expand All @@ -50,74 +55,146 @@
JOIN data_dictionary.modules m USING (module_name)
ORDER BY m.module_name, p.plugin_type, p.plugin_name";
$res = PMA_DBI_query($sql);
$plugins = array();
$modules = array();
while ($row = PMA_DBI_fetch_assoc($res)) {
$plugins[$row['plugin_type']][] = $row;
$modules[$row['module_name']]['info'] = $row;
$modules[$row['module_name']]['plugins'][$row['plugin_type']][] = $row;
}
PMA_DBI_free_result($res);

// sort plugin list (modules are already sorted)
ksort($plugins);

/**
* Displays the page
*/
?>
<table class="data">
<thead>
<tr>
<th><?php echo __('Module'); ?></th>
<th><?php echo __('Description'); ?></th>
<th><?php echo __('Library'); ?></th>
<th><?php echo __('Version'); ?></th>
<th><?php echo __('Author'); ?></th>
<th><?php echo __('License'); ?></th>
</tr>
</thead>
<tbody>
<?php
$odd_row = false;
foreach ($modules as $module_name => $module) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
<td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
</tr>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<td colspan="5">
<table>
<tbody>
<?php
foreach ($module['plugins'] as $plugin_type => $plugin_list) {
?>
<tr class="noclick">
<td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
<td>
<?php
for ($i = 0; $i < count($plugin_list); $i++) {
echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
if (!$plugin_list[$i]['is_active']) {
echo ' <small class="attention">' . __('disabled') . '</small>';
<div id="pluginsTabs">
<ul>
<li><a href="#plugins_plugins"><?php echo __('Plugins'); ?></a></li>
<li><a href="#plugins_modules"><?php echo __('Modules'); ?></a></li>
</ul>

<div id="plugins_plugins">
<div id="sectionlinks">
<?php
foreach ($plugins as $plugin_type => $plugin_list) {
$key = preg_replace('/[^a-z]/i', '', $plugin_type);
echo '<a href="#' . $key . '">' . htmlspecialchars($plugin_type) . '</a>' . "\n";
}
?>
</div>
<br />
<?php
foreach ($plugins as $plugin_type => $plugin_list) {
$key = preg_replace('/[^a-z]/i', '', $plugin_type);
sort($plugin_list);
?>
<table class="data_full_width">
<caption class="tblHeaders">
<a class="top" href="#serverinfo"><?php
echo __('Begin');
echo $GLOBALS['cfg']['MainPageIconic']
? '<img src="' . $GLOBALS['pmaThemeImage'] .
's_asc.png" width="11" height="9" align="middle" alt="" />'
: ''; ?></a>
<?php echo htmlspecialchars($plugin_type); ?>
</caption>
<thead>
<tr>
<th><?php echo __('Plugin'); ?></th>
<th><?php echo __('Module'); ?></th>
<th><?php echo __('Library'); ?></th>
<th><?php echo __('Version'); ?></th>
<th><?php echo __('Author'); ?></th>
<th><?php echo __('License'); ?></th>
</tr>
</thead>
<tbody>
<?php
$odd_row = false;
foreach ($plugin_list as $plugin) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<th><?php echo htmlspecialchars($plugin['plugin_name']); ?></th>
<td><?php echo htmlspecialchars($plugin['module_name']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_library']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_version']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_author']); ?></td>
<td><?php echo htmlspecialchars($plugin['module_license']); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
<div id="plugins_modules">
<table class="data_full_width">
<thead>
<tr>
<th><?php echo __('Module'); ?></th>
<th><?php echo __('Description'); ?></th>
<th><?php echo __('Library'); ?></th>
<th><?php echo __('Version'); ?></th>
<th><?php echo __('Author'); ?></th>
<th><?php echo __('License'); ?></th>
</tr>
</thead>
<tbody>
<?php
$odd_row = false;
foreach ($modules as $module_name => $module) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<th rowspan="2"><?php echo htmlspecialchars($module_name); ?></th>
<td><?php echo htmlspecialchars($module['info']['module_description']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_library']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_version']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_author']); ?></td>
<td><?php echo htmlspecialchars($module['info']['module_license']); ?></td>
</tr>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<td colspan="5">
<table>
<tbody>
<?php
foreach ($module['plugins'] as $plugin_type => $plugin_list) {
?>
<tr class="noclick">
<td><b class="plugin-type"><?php echo htmlspecialchars($plugin_type); ?></b></td>
<td>
<?php
for ($i = 0; $i < count($plugin_list); $i++) {
echo ($i != 0 ? '<br />' : '') . htmlspecialchars($plugin_list[$i]['plugin_name']);
if (!$plugin_list[$i]['is_active']) {
echo ' <small class="attention">' . __('disabled') . '</small>';
}
}
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
/**
* Sends the footer
Expand Down
7 changes: 6 additions & 1 deletion themes/original/css/theme_right.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -2132,10 +2132,15 @@ function PMA_ieFilter($start_color, $end_color)
border-radius: 0.3em;
}

.data {
.data,
.data_full_width {
position: relative;
}

.data_full_width {
width: 100%;
}

.cHide {
background: #D3DCE3 url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>col_hide.png);
color: #CCC;
Expand Down
7 changes: 6 additions & 1 deletion themes/pmahomme/css/theme_right.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ function PMA_ieFilter($start_color, $end_color)
h2 a img{display:inline;}


.data{
.data,
.data_full_width {
margin: 0 0 12px 0;
position: relative;
}

.data_full_width {
width: 100%;
}

h3 {
font-weight: bold;
}
Expand Down

0 comments on commit 26483cc

Please sign in to comment.