[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    www/media/includes/classes
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2011-05-11 19:59:02
Message-ID: 20110511195902.4E377AC879 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1231431 by aacid:

allow to set the anchor name when creating the question, this is a "hack" for \
i18n'able websites so the anchor does not change between languages acked by Ingo


 M  +11 -2     class_faq.inc  


--- trunk/www/media/includes/classes/class_faq.inc #1231430:1231431
@@ -70,22 +70,31 @@
 {
 	var $question;
 	var $answer;
+	var $anchor;
 
 	function Question($question, $answer)
 	{
 		$this->question = $question;
 		$this->answer = $answer;
+		$this->anchor = ereg_replace("[^a-zA-Z]", "", $this->question);
 	}
 
+	function Question($question, $answer, $anchor)
+	{
+		$this->question = $question;
+		$this->answer = $answer;
+		$this->anchor = $anchor;
+	}
+
 	function showQuestion()
 	{
-		print "<li><a href=\"#" . ereg_replace("[^a-zA-Z]", "", $this->question) . \
"\">$this->question</a></li>\n"; +		print "<li><a \
href=\"#$this->anchor\">$this->question</a></li>\n";  }
 
 	function showAnswer()
 	{
 		global $site_locale;
-		print "<h4><a name=\"" . ereg_replace("[^a-zA-Z]", "", $this->question) . \
"\">$this->question</a></h4>\n"; +		print "<h4><a \
name=\"$this->anchor\">$this->question</a></h4>\n";  print "<p>$this->answer</p>\n";
 		print "<p><a href=\"#questions\">". i18n_var("[Up to Questions]") . "</a></p>\n";
 	}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic