Ejemplo 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);
 }
Ejemplo n.º 2
0
 /**
  * returns the shorted url
  *
  * @return string
  * @author Christian Weyand
  */
 public function getShortedUrl()
 {
     return sfConfig::get('app_settings_short_url') . "/" . ShortUrlTable::charize($this->getId());
 }