+/**
+ * converts plugin's array to string and adds version numbers
+ * @return string preformated text with installed plugin's information
+ * @access private
+ */
+function br_show_plugins() {
+ global $plugins;
+ $str = '';
+ if (is_array($plugins) && $plugins!=array()) {
+ foreach ($plugins as $key => $value) {
+ if ($key != 0 || $value != '') {
+ $str .= " * $key = $value";
+ // add plugin version
+ $version_found = FALSE;
+ if (function_exists($value . '_info')) {
+ $info = call_user_func($value . '_info');
+ if (!empty($info['version'])) {
+ $str .= ' ' . $info['version'];
+ $version_found = TRUE;
+ }
+ }
+ if (!$version_found && function_exists($value . '_version')) {
+ $str.= ' ' . call_user_func($value . '_version');
+ }
+ $str.="\n";
+ }
+ }
+ // compatibility plugin can be used without need to enable it in sm config
+ if (file_exists(SM_PATH . 'plugins/compatibility/setup.php')
+ && ! in_array('compatibility',$plugins)) {
+ $str.= ' * compatibility';
+ include_once(SM_PATH . 'plugins/compatibility/setup.php');
+ $version_found = FALSE;
+ if (function_exists('compatibility_info')) {
+ $info = compatibility_info();
+ if (!empty($info['version'])) {
+ $str .= ' ' . $info['version'];
+ $version_found = TRUE;
+ }
+ }
+ if (!$version_found && function_exists('compatibility_version')) {
+ $str.= ' ' . compatibility_version();
+ }
+ $str.="\n";
+ }
+ }
+ if ($str == '') {
+ return " * Nothing listed\n";
+ }
+ return $str;
+}
+