/wp-content/plugins/transposh-translation-filter-for-wordpress/widgets/flagslist/tpw_list_with_flags_css.php
PHP | 51 lines | 16 code | 7 blank | 28 comment | 0 complexity | 9e8cb6d6c514fbe988e2b9a9efa9764b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
- <?php
- /*
- Plugin Name: List with flags (CSS)
- Plugin URI: http://transposh.org/
- Description: Widget with flags links (using css sprites) followed by language name
- Author: Team Transposh
- Version: 1.0.1
- Author URI: http://transposh.org/
- License: GPL (http://www.gnu.org/licenses/gpl.txt)
- */
- /*
- * Transposh v0.8.3
- * http://transposh.org/
- *
- * Copyright 2012, Team Transposh
- * Licensed under the GPL Version 2 or higher.
- * http://transposh.org/license
- *
- * Date: Mon, 28 May 2012 14:38:35 +0300
- */
- class tpw_list_with_flags_css extends transposh_base_widget {
- /**
- * Instructs usage of a different .css file
- * @global transposh_plugin $my_transposh_plugin
- */
- static function tp_widget_css($file, $dir, $url) {
- wp_enqueue_style("flags/tpw_flags_css", "$url/widgets/flags/tpw_flags_css.css", array(), TRANSPOSH_PLUGIN_VER);
- }
- /**
- * Creates the list of flags (using css sprites) - followed by a language name link
- * @global transposh_plugin $my_transposh_plugin
- * @param array $args - http://trac.transposh.org/wiki/WidgetWritingGuide#functiontp_widgets_doargs
- */
- static function tp_widget_do($args) {
- echo "<div class=\"" . NO_TRANSLATE_CLASS . " transposh_flags\" >";
- foreach ($args as $langrecord) {
- echo "<a href=\"{$langrecord['url']}\"" . ($langrecord['active'] ? ' class="tr_active"' : '' ) . '>' .
- transposh_utils::display_flag('', $langrecord['flag'], $langrecord['langorig'], true) . '</a>';
- echo "<a href=\"{$langrecord['url']}\"" . ($langrecord['active'] ? ' class="tr_active"' : '' ) . '>' . "{$langrecord['langorig']}</a><br/>";
- }
- echo "</div>";
- }
- }
- ?>