diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-08-04 14:25:18 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-08-04 14:25:18 +0000 |
commit | a1081ade5d21fc9598b94e40b60c35cf9d95f855 (patch) | |
tree | e1e82458065b0b232d43d5c5f4364c731b2d7c95 /h-source/Application | |
parent | 3fca26af6610062a27517ece1f07ad8d551980fa (diff) |
added tabs on the description entry - updated jquery ui library
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Include/languages.php | 10 | ||||
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 42 | ||||
-rw-r--r-- | h-source/Application/Include/vendors.php | 1 | ||||
-rw-r--r-- | h-source/Application/Views/Help/index_it.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/header.php | 14 |
5 files changed, 64 insertions, 5 deletions
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 5dd3858..b9ed55a 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -33,6 +33,16 @@ class Lang 'de' => 'de.png,Deutsch', ); + public static function getLabel($langCode) + { + if (array_key_exists($langCode,self::$complete)) + { + $all = explode(',',self::$complete[$langCode]); + return $all[1]; + } + return $langCode; + } + public static $i18n = array( 'it' => array ( 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', '<div class="div_h3">${2}</div>',$string); + $string = preg_replace_callback('/(\[tab )(lang=)([^\s]+)(\s*\])(.*?)(\[\/tab\])/s', 'createTabs',$string); + $string = preg_replace('/(\[lang\])(.*?)(\[\/lang\])/s', '<div class="div_lang">${2}</div>',$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[] = "<li><a href='#".$label."'>".$label."</a></li>\n"; + Tabs::$htmlList[] = "<div id='".$label."'>".$match[5]."</div>\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 .= "<div id='description_tabs'>\n"; + $html .= "<ul>\n"; + foreach (self::$tabList as $label) + { + $html .= $label; + } + $html .= "</ul>\n"; + foreach (self::$htmlList as $content) + { + $html .= $content; + } + $html .= "</div>"; + } + return $html; + } + } function checkUrl($url) diff --git a/h-source/Application/Include/vendors.php b/h-source/Application/Include/vendors.php index e33e701..93f8f46 100644 --- a/h-source/Application/Include/vendors.php +++ b/h-source/Application/Include/vendors.php @@ -302,6 +302,7 @@ class Vendors '10e8' => 'Applied-Micro-Circuits-Corp.', '10e9' => 'Alps-Electric-Co.-Ltd.', '10ea' => 'Integraphics', + '10ec' => 'Realtek', '10eb' => 'Artists-Graphics', '10ed' => 'Ascii-Corporation', '10ee' => 'Xilinx-Corporation', diff --git a/h-source/Application/Views/Help/index_it.php b/h-source/Application/Views/Help/index_it.php index e3cd0b2..fa644b6 100644 --- a/h-source/Application/Views/Help/index_it.php +++ b/h-source/Application/Views/Help/index_it.php @@ -278,7 +278,7 @@ <dd><pre class="terminal">lsusb -v > FILENAME # l'output del comandi un file digitando</pre> </dd> <!-- dd>dove "filename" รจ il nome del file</dd --> - <dd>Otterrai la lista di tutti i dispositivi USB, simile a quella sxcritta sotto</dd> + <dd>Otterrai la lista di tutti i dispositivi USB, simile a quella scritta sotto</dd> <dd><pre class="terminal"> Bus 001 Device 002: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B] Device Descriptor: diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php index a785023..d8cbcbb 100644 --- a/h-source/Application/Views/header.php +++ b/h-source/Application/Views/header.php @@ -52,15 +52,23 @@ $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index'; <!-- markItUp! toolbar skin --> <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Js/markitup/sets/bbcode/style.css" /> - <!-- jQuery ui dialog --> - <link rel="stylesheet" href="<?php echo $this->baseUrl;?>/Public/Js/jquery/dialog/css/excite-bike/jquery-ui-1.8.4.custom.css" rel="stylesheet" /> - <script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/jquery/dialog/js/jquery-ui-1.8.4.custom.min.js"></script> + <!-- jQuery ui --> + <link rel="stylesheet" href="<?php echo $this->baseUrl;?>/Public/Js/jquery/ui/css/excite-bike/jquery-ui-1.8.14.custom.css" rel="stylesheet" /> + <script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/jquery/ui/js/jquery-ui-1.8.14.custom.min.js"></script> <script type="text/javascript"> var base_url = "<?php echo $this->baseUrl;?>"; var curr_lang = "<?php echo $lang;?>"; var csrf_token = "<?php echo $token;?>"; + + $(document).ready(function() { + +// $(function() { + $( "#description_tabs" ).tabs(); +// }); + + }); </script> |