You are here

function coder_upgrade_convert_schema_callback in Coder 7

Same name in this branch
  1. 7 coder_upgrade/conversions/other.inc \coder_upgrade_convert_schema_callback()
  2. 7 coder_upgrade/conversions/function.inc \coder_upgrade_convert_schema_callback()
Same name and namespace in other branches
  1. 7.2 coder_upgrade/conversions/other.inc \coder_upgrade_convert_schema_callback()
  2. 7.2 coder_upgrade/conversions/function.inc \coder_upgrade_convert_schema_callback()
2 string references to 'coder_upgrade_convert_schema_callback'
coder_upgrade_convert_schema in coder_upgrade/conversions/other.inc
Updates hook_schema().
coder_upgrade_convert_schema in coder_upgrade/conversions/function.inc
Updates hook_schema().

File

coder_upgrade/conversions/other.inc, line 1296
Other conversion routine file for the coder_upgrade module.

Code

function coder_upgrade_convert_schema_callback(&$item) {
  cdp("inside " . __FUNCTION__);

  //  cdp($item->print_r());
  if (get_class($item) != 'PGPFunctionCall') {
    return;
  }

  // Fetch the first parameter of the t() call.
  $parameter = $item
    ->getParameter();
  $operand = $parameter
    ->getElement();
  if (is_array($operand)) {

    // schema_html: schema descriptions are now plain text instead of HTML.
    $operand['value'] = html_entity_decode($operand['value']);
  }

  //  cdp("operand");
  //  cdp(print_r($operand, 1));
  // Parent should be the value expression in an array (key, value) pair.
  $parent =& $item->parentExpression;

  // Set the value to the first parameter of the t() call.
  if ($parent
    ->count() == 1) {

    // This is an example of changing a function call reference.
    $parent
      ->setElement(0, $operand);
  }
}