You are here

function feeds_tamper_ui_source_name in Feeds Tamper 6

Same name and namespace in other branches
  1. 8.2 legacy/feeds_tamper_ui/feeds_tamper_ui.module \feeds_tamper_ui_source_name()
  2. 7 feeds_tamper_ui/feeds_tamper_ui.module \feeds_tamper_ui_source_name()

Calculate display name for source.

Parameters

string|stdClass $instance: Either the plugin instance id or a plugin instance object.

Return value

string The sanitized name to display for a Feeds source.

4 calls to feeds_tamper_ui_source_name()
FeedsTamperUIWebTestCase::addTamperPlugin in feeds_tamper_ui/tests/feeds_tamper_ui.test
FeedsTamperUIWebTestCase::deleteTamperPlugin in feeds_tamper_ui/tests/feeds_tamper_ui.test
feeds_tamper_ui_add_plugin_form_submit in feeds_tamper_ui/feeds_tamper_ui.admin.inc
feeds_tamper_ui_delete_form_submit in feeds_tamper_ui/feeds_tamper_ui.admin.inc

File

feeds_tamper_ui/feeds_tamper_ui.module, line 175
Feeds Tamper UI - Defines the user interface for Feeds Tamper.

Code

function feeds_tamper_ui_source_name($instance) {
  if (!is_object($instance)) {
    $instance = feeds_tamper_get_plugin($instance);
  }
  $importer = feeds_importer($instance->importer);
  $sources = $importer->parser
    ->getMappingSources();
  return !empty($sources[$instance->source]['name']) ? check_plain($sources[$instance->source]['name']) : check_plain($instance->source);
}