Esempio n. 1
0
 /**
  * generate Wildcard.. truncate if necessary, $pUrl is optional
  *
  * @param YiidActivity $pActivity
  * @return string
  */
 public function generateMessage($pActivity)
 {
     sfProjectConfiguration::getActive()->loadHelpers('Text');
     $lUrl = ShortUrlTable::shortenUrl($pActivity->generateUrlWithClickbackParam($this->onlineIdentity));
     $lMaxChars = 135;
     $lText = $lUrl;
     $lLengthOfText = strlen($lText);
     if ($pActivity->getComment()) {
         $lChars = $lMaxChars - $lLengthOfText;
         $lText = truncate_text($pActivity->getComment(), $lChars, '...') . " " . $lText;
     } elseif ($pActivity->getTitle()) {
         $lChars = $lMaxChars - $lLengthOfText;
         $lText = truncate_text($pActivity->getTitle(), $lChars, '...') . " " . $lText;
     }
     return array("status" => $lText);
 }