From: Nigel M. <ora...@us...> - 2006-01-29 00:00:29
|
Update of /cvsroot/geshi/geshi-src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19852 Modified Files: class.geshi.php Log Message: Bug 43: Added optional parameter to themesSupportedBy. If true, returns the human-readable theme name also for each theme. Index: class.geshi.php =================================================================== RCS file: /cvsroot/geshi/geshi-src/class.geshi.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** class.geshi.php 28 Jan 2006 06:50:02 -0000 1.39 --- class.geshi.php 29 Jan 2006 00:00:20 -0000 1.40 *************** *** 543,547 **** * {@link GeSHi::getHumanThemeName()} on each name returned. * ! * @param string $language The language to get supported themes for * @return array A list of themes supported by the language. Note that * they are _not_ in preferred order --- 543,550 ---- * {@link GeSHi::getHumanThemeName()} on each name returned. * ! * @param string $language The language to get supported themes for ! * @param boolean $return_human If <kbd>true</kbd>, returns an array of ! * theme name => human-readable name. Otherwise, ! * just return an array of theme names. * @return array A list of themes supported by the language. Note that * they are _not_ in preferred order *************** *** 550,554 **** * @static */ ! function themesSupportedBy ($language) { $themes = array(); --- 553,557 ---- * @static */ ! function themesSupportedBy ($language, $return_human = false) { $themes = array(); *************** *** 562,566 **** if (is_readable(GESHI_THEMES_ROOT . $theme_folder . GESHI_DIR_SEP . $language . '.php')) { ! $themes[] = $theme_folder; // Check for subthemes --- 565,573 ---- if (is_readable(GESHI_THEMES_ROOT . $theme_folder . GESHI_DIR_SEP . $language . '.php')) { ! if ($return_human) { ! $themes[$theme_folder] = GeSHi::getHumanThemeName($theme_folder); ! } else { ! $themes[] = $theme_folder; ! } // Check for subthemes *************** *** 571,575 **** if (is_readable(GESHI_THEMES_ROOT . $theme_folder . GESHI_DIR_SEP . $subtheme_folder . GESHI_DIR_SEP . $language . '.php')) { ! $themes[] = "$theme_folder/$subtheme_folder"; } } --- 578,587 ---- if (is_readable(GESHI_THEMES_ROOT . $theme_folder . GESHI_DIR_SEP . $subtheme_folder . GESHI_DIR_SEP . $language . '.php')) { ! $subtheme_name = "$theme_folder/$subtheme_folder"; ! if ($return_human) { ! $themes[$subtheme_name] = GeSHi::getHumanThemeName($subtheme_name); ! } else { ! $themes[] = $subtheme_name; ! } } } |