<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Fields_View_Helper_FieldTextareaLinked extends Fields_View_Helper_FieldAbstract
{
  public function fieldTextareaLinked($subject, $field, $value)
  {
    $vals = preg_split('/\s*[,]+\s*/', $value->value);

    $first = true;
    $content = '';
    foreach( $vals as $sVal ) {
      if( !$first ) $content .= ', ';
      $first = false;
      
      $content .= $this->encloseInLink($subject, $field, '%' . $sVal . '%', $sVal);
    }
    return $content;
  }
}
