You are here

function _sbp_paths_update_translation in Search by Page 6

Same name and namespace in other branches
  1. 7 sbp_paths.module \_sbp_paths_update_translation()

Updates the strings to be translated for one path record.

Parameters

$vals: Associative array of information from sbpp_path table.

2 calls to _sbp_paths_update_translation()
sbp_paths_edit_form_submit in ./sbp_paths.module
Submit callback for sbp_paths_edit_form().
_sbp_paths_refresh_translations in ./sbp_paths.module
Refreshes string translations for i18nstrings module.

File

./sbp_paths.module, line 540
Module file for Search by Page Paths, a sub-module for Search by Page.

Code

function _sbp_paths_update_translation($vals) {
  if (module_exists('i18nstrings') && $vals['pid']) {
    $code = 'sbp_paths:path:' . $vals['pid'] . ':';
    i18nstrings_update($code . 'title', $vals['title']);
    i18nstrings_update($code . 'type', $vals['type']);
    $snip = drupal_strtolower($vals['snippet']);
    if ($snip != 'yes' && $snip != 'no') {
      i18nstrings_update($code . 'snippet', $vals['snippet']);
    }
  }
}