/** * Format a Movie's . If format is HTML, will return a * HTML formatted string; will return the value without change * if raw is asked. * * @since 2.0 * * @param string $data detail value * @param string $format data format, raw or HTML * * @return string Formatted output */ public static function format_movie_subtitles($data, $format = 'html') { $format = 'raw' == $format ? 'raw' : 'html'; if ('' == $data) { return $data; } if (wpmoly_o('details-icons') && 'html' == $format) { $view = 'shortcodes/detail-icon-title.php'; } else { if ('html' == $format) { $view = 'shortcodes/detail.php'; } } $title = array(); $lang = WPMOLY_Settings::get_available_movie_language(); if (!is_array($data)) { $data = array($data); } foreach ($data as $d) { if ('none' == $d) { $title = array(__('None', 'wpmovielibrary')); break; } elseif (isset($lang[$d])) { $title[] = __($lang[$d], 'wpmovielibrary'); } } $data = WPMovieLibrary::render_template($view, array('detail' => 'subtitle', 'data' => 'subtitles', 'title' => implode(', ', $title)), $require = 'always'); return $data; }