From a1081ade5d21fc9598b94e40b60c35cf9d95f855 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 4 Aug 2011 14:25:18 +0000 Subject: added tabs on the description entry - updated jquery ui library --- h-source/Application/Include/myFunctions.php | 42 +++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'h-source/Application/Include/myFunctions.php') diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 2ed9942..5603c97 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -267,9 +267,49 @@ function decodeWikiText($string) $string = preg_replace('/(\[h3\])(.*?)(\[\/h3\])/s', '
${2}
',$string); + $string = preg_replace_callback('/(\[tab )(lang=)([^\s]+)(\s*\])(.*?)(\[\/tab\])/s', 'createTabs',$string); + $string = preg_replace('/(\[lang\])(.*?)(\[\/lang\])/s', '
${2}
',$string); - return $string; + return Tabs::render()."\n\n".$string; +} + +//create the list of the tabs in the description entry +function createTabs($match) +{ + $label = Lang::getLabel($match[3]); + Tabs::$tabList[] = "
  • ".$label."
  • \n"; + Tabs::$htmlList[] = "
    ".$match[5]."
    \n"; + return null; +} + +//create the HTMLof the tats in the description entry +class Tabs +{ + public static $tabList = array(); + public static $htmlList = array(); + + public static function render() + { + $html = null; + if (count(self::$tabList) > 0) + { + $html .= "
    \n"; + $html .= "\n"; + foreach (self::$htmlList as $content) + { + $html .= $content; + } + $html .= "
    "; + } + return $html; + } + } function checkUrl($url) -- cgit v1.2.3