Exemple #1
0
/**
 * m�todo _t()
 * fachada para o m�todo Translate da classe Translation
 * @param $word = Palavra a ser traduzida
 */
function _t($word)
{
    return Translation::Translate($word);
}
Exemple #2
0
 /**
  * Diese Funktion schneidet eine Zeichenreihe nach einer bestimmten Länge $stringcount ab
  * Dabei wird das letzte Lehrzeichen innerhalb dieses Rahmens gesucht und dort abgeschnitten
  * Damit werden keine Wörter mittendrin abgeschnitten
  */
 public function cutStringbyCount($text, $stringcount, $additional = true, $deleteCuttedWord = true, $link = "")
 {
     if ($additional == "" or $additional == "true") {
         $additional = true;
     }
     if ($deleteCuttedWord == "" or $deleteCuttedWord == "true") {
         $deleteCuttedWord = true;
     }
     $lengh = strlen($text);
     if (is_numeric($stringcount) && $stringcount > 0 && $lengh > $stringcount) {
         $text = substr($text, 0, $stringcount);
         if ($deleteCuttedWord === true) {
             $worter = explode(" ", $text);
             array_pop($worter);
             $text = implode(" ", $worter);
         }
         if ($additional === true) {
             if ($link != "") {
                 $text .= "<a href='" . $link . "' title='" . Translation::Translate("read_more") . "'>";
             }
             $text .= "<b>" . Translation::Translate("read_more") . "</b>";
             if ($link != "") {
                 $text .= "</a>";
             }
         }
     }
     return $text;
 }