show_plugin_config: use return instead of echo
This commit is contained in:
@@ -149,10 +149,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
}
|
||||
|
||||
$data['license'] = $license;
|
||||
ob_start();
|
||||
serendipity_plugin_config($plugin, $bag, $name, $desc, $config_names, true, true, true, true, 'plugin', $config_groups);
|
||||
$data['config'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$data['config'] = serendipity_plugin_config($plugin, $bag, $name, $desc, $config_names, true, true, true, true, 'plugin', $config_groups);
|
||||
|
||||
} elseif ( $serendipity['GET']['adminAction'] == 'addnew' ) {
|
||||
$data['adminAction'] = 'addnew';
|
||||
|
@@ -128,8 +128,7 @@ if (is_array($template_config)) {
|
||||
$template_options->import($template_config);
|
||||
$template_options->values =& $template_vars;
|
||||
|
||||
ob_start();
|
||||
serendipity_plugin_config(
|
||||
$data["configuration"] = serendipity_plugin_config(
|
||||
$template_options,
|
||||
$template_vars,
|
||||
$serendipity['template'],
|
||||
@@ -142,56 +141,50 @@ if (is_array($template_config)) {
|
||||
'template',
|
||||
$template_config_groups
|
||||
);
|
||||
$data["configuration"] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
serendipity_plugin_api::hook_event('backend_templates_configuration_bottom', $template_config);
|
||||
} else {
|
||||
serendipity_plugin_api::hook_event('backend_templates_configuration_none', $template_config);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$stack = array();
|
||||
serendipity_plugin_api::hook_event('backend_templates_fetchlist', $stack);
|
||||
$themes = serendipity_fetchTemplates();
|
||||
$data['templates'] = array();
|
||||
$data['templates'][$theme] = array();
|
||||
foreach($themes AS $theme) {
|
||||
$stack[$theme] = serendipity_fetchTemplateInfo($theme);
|
||||
}
|
||||
ksort($stack);
|
||||
$i = 0;
|
||||
$stack = array();
|
||||
serendipity_plugin_api::hook_event('backend_templates_fetchlist', $stack);
|
||||
$themes = serendipity_fetchTemplates();
|
||||
$data['templates'] = array();
|
||||
$data['templates'][$theme] = array();
|
||||
foreach($themes AS $theme) {
|
||||
$stack[$theme] = serendipity_fetchTemplateInfo($theme);
|
||||
}
|
||||
ksort($stack);
|
||||
|
||||
|
||||
foreach ($stack as $theme => $info) {
|
||||
$data['templates'][$theme]['info'] = $info;
|
||||
/* Sorry, but we don't display engines */
|
||||
if ( strtolower($info['engine']) == 'yes' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg')) {
|
||||
$data['templates'][$theme]['fullsize_preview'] = $serendipity['baseURL'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg';
|
||||
} elseif (!empty($info['preview_fullsizeURL'])) {
|
||||
$data['templates'][$theme]['fullsize_preview'] = $info['preview_fullsizeURL'];
|
||||
}
|
||||
|
||||
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png')) {
|
||||
$data['templates'][$theme]['preview'] = $serendipity['templatePath'] . $theme . '/preview.png';
|
||||
} elseif (!empty($info['previewURL'])) {
|
||||
$data['templates'][$theme]['preview'] = $info['previewURL'] ;
|
||||
}
|
||||
|
||||
$unmetRequirements = array();
|
||||
if ( isset($info['require serendipity']) && version_compare($info['require serendipity'], serendipity_getCoreVersion($serendipity['version']), '>') ) {
|
||||
$unmetRequirements[] = 'Serendipity '. $info['require serendipity'];
|
||||
$data['templates'][$theme]['unmetRequirements'] = sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements));
|
||||
}
|
||||
|
||||
/* TODO: Smarty versioncheck */
|
||||
foreach ($stack as $theme => $info) {
|
||||
$data['templates'][$theme]['info'] = $info;
|
||||
/* Sorry, but we don't display engines */
|
||||
if ( strtolower($info['engine']) == 'yes' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_object($serendipity['smarty'])) {
|
||||
serendipity_smarty_init();
|
||||
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg')) {
|
||||
$data['templates'][$theme]['fullsize_preview'] = $serendipity['baseURL'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg';
|
||||
} elseif (!empty($info['preview_fullsizeURL'])) {
|
||||
$data['templates'][$theme]['fullsize_preview'] = $info['preview_fullsizeURL'];
|
||||
}
|
||||
|
||||
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png')) {
|
||||
$data['templates'][$theme]['preview'] = $serendipity['templatePath'] . $theme . '/preview.png';
|
||||
} elseif (!empty($info['previewURL'])) {
|
||||
$data['templates'][$theme]['preview'] = $info['previewURL'] ;
|
||||
}
|
||||
|
||||
$unmetRequirements = array();
|
||||
if ( isset($info['require serendipity']) && version_compare($info['require serendipity'], serendipity_getCoreVersion($serendipity['version']), '>') ) {
|
||||
$unmetRequirements[] = 'Serendipity '. $info['require serendipity'];
|
||||
$data['templates'][$theme]['unmetRequirements'] = sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements));
|
||||
}
|
||||
|
||||
/* TODO: Smarty versioncheck */
|
||||
}
|
||||
|
||||
echo serendipity_smarty_show('admin/templates.inc.tpl', $data);
|
||||
|
@@ -224,7 +224,7 @@ function show_plugins($event_only = false, $sidebars = null)
|
||||
* @param boolean Spawn a plugins' configuration WYSIWYG items?
|
||||
* @param string The array index name of POSTed values ($serendipity['POST'][xxx])
|
||||
* @param array An array that groups certain config keys
|
||||
* @return boolean
|
||||
* @return string The configuration HTML
|
||||
*/
|
||||
function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_names, $showTable = true, $showSubmit = true, $showExample = true, $spawnNuggets = true, $postKey = 'plugin', $config_groups = NULL) {
|
||||
global $serendipity;
|
||||
@@ -647,7 +647,5 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
|
||||
$data['ev'] = $ev;
|
||||
}
|
||||
|
||||
echo serendipity_smarty_show('admin/plugin_config.tpl', $data);
|
||||
|
||||
return true;
|
||||
return serendipity_smarty_show('admin/plugin_config.tpl', $data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user