function content_menu_handle_replacement_pattern

6.x content.module content_menu_handle_replacement_pattern($str)
4.x content.module content_menu_handle_replacement_pattern($str)
5.x content.module content_menu_handle_replacement_pattern($str)

This is an implementation of hook_menu_handle_replacement_pattern. It will search for and replace replacement patterns which we are aware of it in $str.

File

modules/content/content.module, line 740

Code

function content_menu_handle_replacement_pattern($str) {

  $cid = @$_REQUEST ["cid"];
  if ($cid) {
    $content = content_load($cid);
    if (is_array($content)) {
      if (strpos($str, "%CONTENT_CID%") !== 0) {
        // It contains this replacement pattern!
        $str = str_replace("%CONTENT_CID%", $cid, $str);
      }

      if (strpos($str, "%CONTENT_TYPE%") !== 0) {
        // It contains this replacement pattern!
        $str = str_replace("%CONTENT_TYPE%", $content ["type"], $str);
      }
    }
  }

  return $str;
}