You are here

function ctools_context_term_convert in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 plugins/contexts/term.inc \ctools_context_term_convert()

Convert a context into a string.

1 string reference to 'ctools_context_term_convert'
term.inc in plugins/contexts/term.inc
Plugin to provide a term context.

File

plugins/contexts/term.inc, line 152
Plugin to provide a term context.

Code

function ctools_context_term_convert($context, $type) {
  switch ($type) {
    case 'tid':
      return $context->data->tid;
    case 'name':
      return $context->data->name;
    case 'name_dashed':
      return drupal_strtolower(str_replace(' ', '-', $context->data->name));
    case 'vid':
      return $context->data->vid;
    case 'description':
      return $context->data->description;
  }
}