static function Shorten($str, $length = 32, $respectWords = false, $noEllipsis = false, $forceEllipsis = false, $entityDecode = false)
    {
        if ($entityDecode)
            $str = html_entity_decode($str, ENT_COMPAT, 'utf-8');

        $str = Str::Trim(strip_tags($str));
        
        if (strlen ($str) <= $length)
	{
	  if ($forceEllipsis)
	    return self::CorrectSpaces($str) . "...";
	  
          else
	    return self::CorrectSpaces($str);
	}

        $str = mb_substr($str, 0, $length - 3, 'utf-8');
        if ($respectWords)
	{
            $pos = mb_strrpos($str, " ", -1, 'utf-8');
            if ($pos > $length / 2)
                $str = mb_substr($str, 0, $pos, 'utf-8');
        }
        $str = self::CorrectSpaces($str);
        
        if (!$noEllipsis)
            $str = $str . "...";
        
        return $str;
    }