You are here

function _sms_sendtophone_filter_inline in SMS Framework 6.2

Same name and namespace in other branches
  1. 5 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline()
  2. 6 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline()
  3. 7 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline()
1 call to _sms_sendtophone_filter_inline()
sms_sendtophone_filter in modules/sms_sendtophone/sms_sendtophone.module
Implementation of hook_filter().

File

modules/sms_sendtophone/sms_sendtophone.module, line 150

Code

function _sms_sendtophone_filter_inline($text, $format) {
  preg_match_all('/\\[sms\\](.*?)\\[\\/sms\\]/i', $text, $matches, PREG_SET_ORDER);
  $display = 'text';
  if (variable_get("sms_sendtophone_filter_inline_display_{$format}", 'icon') == 'icon') {
    $display = 'icon';
  }
  foreach ($matches as $match) {
    $text = str_replace($match[0], theme('sms_sendtophone_filter_inline_' . $display, $match[1], $format), $text);
  }
  return $text;
}