From: <li...@us...> - 2015-11-22 19:39:37
|
Revision: 56752 http://sourceforge.net/p/tikiwiki/code/56752 Author: lindonb Date: 2015-11-22 19:39:35 +0000 (Sun, 22 Nov 2015) Log Message: ----------- [ENH] pluginmanager: add ability to not show preference and Tiki version info Modified Paths: -------------- trunk/lib/wiki-plugins/wikiplugin_pluginmanager.php Modified: trunk/lib/wiki-plugins/wikiplugin_pluginmanager.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_pluginmanager.php 2015-11-22 19:10:34 UTC (rev 56751) +++ trunk/lib/wiki-plugins/wikiplugin_pluginmanager.php 2015-11-22 19:39:35 UTC (rev 56752) @@ -22,6 +22,7 @@ 'limit' => '', 'paramtype' => '', 'showparamtype' => 'n', + 'showtopinfo' => 'y' ); } function getName() @@ -242,6 +243,7 @@ || ((empty($paraminfo['doctype']) && !empty($params['paramtype']) && $params['paramtype'] === 'none') || (!empty($paraminfo['doctype']) && $params['paramtype'] == $paraminfo['doctype'])) ) { + $filteredparams[] = $paraminfo; $rows .= "\n\t" . '<tr>' . $cellbegin; //Parameters column if (isset($paraminfo['required']) && $paraminfo['required'] == true) { @@ -337,16 +339,14 @@ $rows .= "\n\t" . '<tr>' . $cellbegin . '<em>' . tra('no parameters') . '</em></td>'; } $header .= "\n\t" . '</tr>'; - if (!empty($infoPlugin['prefs'])) { - $pluginprefs = '<em>' . tra('Preferences required:') . '</em> ' . implode(', ', $infoPlugin['prefs']). '<br/>'; - } else { - $pluginprefs = ''; - } - if (isset($infoPlugin['introduced'])) { - $title .= '<em>' . tr('Introduced in %0', 'Tiki' . $infoPlugin['introduced']) . '.</em>'; - } - $sOutput = $title . '<em> ' . tr('Required parameters are in%0 %1bold%2', '</em>', '<strong><code>', - '</code></strong>') . '.<br>' . $pluginprefs . '<div class="table-responsive">' . + $pluginprefs = !empty($infoPlugin['prefs']) && $params['showtopinfo'] !== 'n' ? '<em>' + . tra('Preferences required:') . '</em> ' . implode(', ', $infoPlugin['prefs']). '<br/>' : ''; + $title .= isset($infoPlugin['introduced']) && $params['showtopinfo'] !== 'n' ? '<em>' . + tr('Introduced in %0', 'Tiki' . $infoPlugin['introduced']) . '.</em>' : ''; + $required = !empty($filteredparams) ? array_column($filteredparams, 'required') : false; + $bold = in_array(true, $required) > 0 ? '<em> ' . tr('Required parameters are in%0 %1bold%2', '</em>', + '<strong><code>', '</code></strong>.') : ''; + $sOutput = $title . $bold . '<br>' . $pluginprefs . '<div class="table-responsive">' . '<table class="table table-striped table-hover">' . $header . $rows . '</table></div>' . "\n"; return $sOutput; } @@ -469,6 +469,21 @@ array('text' => tra('No'), 'value' => 'n') ) ), + 'showtopinfo' => array( + 'required' => false, + 'name' => tra('Show Top Info'), + 'description' => tr('Show information above the table regarding preferences required and the first + version when the plugin became available. Shown by default.'), + 'since' => '15.0', + 'filter' => 'alpha', + 'default' => '', + 'advanced' => true, + 'options' => array( + array('text' => '', 'value' => ''), + array('text' => tra('Yes'), 'value' => 'y'), + array('text' => tra('No'), 'value' => 'n') + ) + ), ), ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |