Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

EE2 port

reconfigured download
  • Loading branch information...
commit 3c22e5a36a49b17594aa8cd4f3efbb0f82a66ee5 1 parent fed588c
Aaron Gustafson aarongustafson authored
0  .../easy_language_select/ft.easy_language_select.php → .../easy_language_select/ft.easy_language_select.php
View
File renamed without changes
0  ...em/language/english/lang.easy_language_select.php → ...em/language/english/lang.easy_language_select.php
View
File renamed without changes
212 2.x/system/expressionengine/third_party/easy_language_select/ft.easy_language_select.php
View
@@ -0,0 +1,212 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+
+/**
+ * Easy Language Select FieldFrame Class
+ *
+ * @package Easy Language Select
+ * @author Aaron Gustafson <aaron@easy-designs.net>
+ * @copyright Copyright (c) 2010 Aaron Gustafson
+ * @license MIT
+ */
+class Easy_language_select_ft extends EE_Fieldtype {
+
+ /**
+ * Fieldtype Info
+ * @var array
+ */
+ var $info = array(
+ 'name' => 'Easy Language Select',
+ 'version' => '1.1',
+ );
+
+ var $addon_name = 'easy_language_select';
+
+ /**
+ * Constructor
+ */
+ function Easy_language_select_ft()
+ {
+ parent::EE_Fieldtype();
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Display Field on Publish
+ *
+ * @access public
+ * @param existing data
+ * @return field html
+ *
+ */
+ function display_field($data)
+ {
+ # get the language file
+ $this->EE->lang->loadfile($this->addon_name);
+
+ if ( empty($data) ) $data = $this->EE->config->item('xml_lang');
+
+ $file = APPPATH.'config/languages'.EXT;
+ if ( ! file_exists($file) ) return FALSE;
+ include($file);
+
+ # text direction
+ $dir = ( $this->settings['field_text_direction'] == 'rtl' ) ? 'rtl' : 'ltr';
+
+ # options
+ $options = array();
+ foreach ( $languages as $key => $val )
+ {
+ $localized = $this->EE->lang->line($key);
+ if ( $this->settings['localize'] == 'y' &&
+ $this->EE->config->item('xml_lang') != $val &&
+ ! empty( $localized ) ) $key = "{$localized} ({$key})";
+ $options[$val] = $key;
+ }
+
+ # return the field
+ return form_dropdown($this->field_name, $options, $data, 'dir="'.$dir.'" id="'.$this->field_name.'"');
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Display Settings Screen
+ *
+ * @access public
+ * @return Displays the field settings form
+ *
+ */
+ function display_settings($data)
+ {
+ # get the language file
+ $this->EE->lang->loadfile($this->addon_name);
+
+ # settings
+ $localize = isset($data['localize']) ? $data['localize'] : $this->settings['localize'];
+
+ # create the field
+ $this->EE->table->add_row(
+ form_label($this->EE->lang->line('translate_languages'),'localize'),
+ '<label>'.form_radio('localize', 'y', $localize).NBS.'Yes</label>' .
+ NBS.NBS.NBS.NBS.NBS .
+ '<label>'.form_radio('localize', 'n', $localize).NBS.'No</label>'
+ );
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Save Settings
+ *
+ * @access public
+ * @return field settings
+ *
+ */
+ function save_settings($data)
+ {
+ return array(
+ 'localize' => $this->EE->input->post('localize')
+ );
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Display Global Settings
+ *
+ * @access public
+ * @return form contents
+ *
+ */
+ function display_global_settings()
+ {
+ $settings = array_merge($this->settings, $_POST);
+
+ $this->EE->lang->loadfile($this->addon_name);
+
+ # create the field
+ return form_label($this->EE->lang->line('translate_languages'),'localize') . ' ' .
+ form_dropdown('localize', array('n' => 'no', 'y' => 'yes'), $settings['localize']);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Save Global Settings
+ *
+ * @access public
+ * @return global settings
+ *
+ */
+ function save_global_settings()
+ {
+ return array_merge($this->settings, $_POST);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Replace tag
+ *
+ * @access public
+ * @param field contents
+ * @return replacement text
+ *
+ */
+ function replace_tag($data, $params=array(), $tagdata=FALSE)
+ {
+ if ( ! empty( $params['code'] ) &&
+ $params['code'] == 'yes' )
+ {
+ return $data;
+ }
+ else
+ {
+ $this->EE->lang->loadfile($this->addon_name);
+
+ $file = APPPATH.'config/languages'.EXT;
+ if ( ! file_exists($file) ) return FALSE;
+ include($file);
+
+ $languages = array_flip( $languages );
+ $language = $languages[$data];
+
+ $localized = $this->EE->lang->line($language);
+
+ return ! empty( $localized ) ? $localized : $language;
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Install Fieldtype
+ *
+ * @access public
+ * @return default global settings
+ *
+ */
+ function install()
+ {
+ return array(
+ 'localize' => 'y',
+ );
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Uninstall Fieldtype
+ *
+ */
+ function uninstall()
+ {
+ return TRUE;
+ }
+
+}
+
+/* End of file ft.easy_language_select.php */
+/* Location: ./system/expressionengine/third_party/easy_language_select/ft.easy_language_select.php */
137 2.x/system/expressionengine/third_party/easy_language_select/language/english/lang.easy_language_select.php
View
@@ -0,0 +1,137 @@
+<?php
+
+$lang = array(
+
+'translate_languages' => 'Translate languages?',
+'no' => 'No',
+'yes' => 'Yes',
+
+/* =Languages */
+'Albanian' => 'Shqiptar',
+'Arabic' => 'العربية',
+'Abkhazian' => 'Аҧсуа бызшәа',
+'Amharic' => 'አማርኛ',
+'Afar' => 'Qafár af',
+'Armenian' => 'Հայաստան',
+'Assamese' => 'অসমীয়া',
+'Byelorussian' => 'Беларускі',
+'Azerbaijani' => 'آذربایجان دیلی',
+'Bashkir' => 'башҡорт теле',
+'Bulgarian' => 'Български',
+'Bhutani' => 'بلوچی',
+'Breton' => 'Brezhoneg',
+'Bengali/Bangla' => 'বাংলা',
+'Croatian' => 'Hrvatski',
+'Corsican' => 'Corsu',
+'Catalan' => 'Català',
+'Czech' => 'Český',
+'Danish' => 'Danske',
+'Dutch' => 'Nederlands',
+'Cambodian' => 'ភាសាខ្មែរ',
+'Burmese' => 'မြန်မာဘာသာ',
+'Estonian' => 'Eesti',
+'Farsi' => 'فارسی',
+'Finnish' => 'Suomi',
+'Basque' => 'Euskara',
+'Fiji' => 'Na vosa vaka-Viti',
+'French' => 'Français',
+'German' => 'Deutsch',
+'Galician' => 'Galego',
+'Frisian' => 'Frysk',
+'Greek' => 'Ελληνικά',
+'Faroese' => 'føroyskt',
+'Guarani' => 'Guaraní',
+'Greenlandic' => 'Kalaallisut',
+'Gujarati' => 'ગુજરાતી',
+'Hindi' => 'हिन्दी',
+'Hungarian' => 'Magyar',
+'Hausa' => 'هَوْسَ',
+'Hebrew' => 'עברית',
+'Irish' => 'Gaeilge',
+'Indonesian' => 'Indonesia',
+'Icelandic' => 'Íslenska',
+'Italian' => 'Italiano',
+'Japanese' => '日本語',
+'Inupiak' => 'Iñupiaq',
+'Korean' => '한국의',
+'Inuktitut' => 'ᐃᓄᒃᑎᑐᑦ',
+'Javanese' => 'Basa Jawa',
+'Kazakh' => 'Қазақ тілі',
+'Kannada' => 'ಕನ್ನಡ',
+'Kashmiri' => 'कॉशुर',
+'Kurdish' => 'كوردی',
+'Kirghiz' => 'Кыргыз тили',
+'Latin' => 'Lingua Latīna',
+'Lithuanian' => 'Lietuvos',
+'Latvian;Lettish' => 'Latvijas; Latviešu',
+'Laothian' => 'ພາສາລາວ',
+'Macedonian' => 'Македонски',
+'Maori' => 'Māori',
+'Moldavian' => 'Moldovenesc',
+'Mongolian' => 'Монгол',
+'Malay' => 'Melayu',
+'Marathi' => 'मराठी',
+'Maltese' => 'Malti',
+'Malayalam' => 'മലയാളം',
+'Norwegian' => 'Norsk',
+'Nepali' => 'नेपाली',
+'Nauru' => 'Ekaiairũ Naoero',
+'Occitan' => 'Lenga d\'òc',
+'Afan (Oromo)' => 'Oromiffa',
+'Lingala' => 'Ngala',
+'Polish' => 'Polski',
+'Portuguese' => 'Português',
+'Oriya' => 'ଓଡିଆ',
+'Pashto/Pushto' => 'پښتو',
+'Punjabi' => 'ਪੰਜਾਬੀ',
+'Russian' => 'Русский',
+'Romanian' => 'Română',
+'Quechua' => 'Qhichwa Simi',
+'Rhaeto-Romance' => 'Romansch',
+'Sangho' => 'yângâ tî sängö',
+'Sanskrit' => 'संस्कृतभाषा',
+'Sindhi' => 'سنڌي',
+'Slovak' => 'Slovenský',
+'Serbo-Croatian' => 'Cрпскохрватски',
+'Singhalese' => 'siṁhala',
+'Slovenian' => 'Slovenski',
+'Serbian' => 'Српски',
+'Shona' => 'chiShona',
+'Samoan' => 'Gagana Sāmoa',
+'Spanish' => 'Español',
+'Sundanese' => 'Basa Sunda',
+'Swedish' => 'Svenska',
+'Thai' => 'ภาษาไทย',
+'Tamil' => 'தமிழ்',
+'Telugu' => 'తెలుగు',
+'Tajik' => 'тоҷикӣ',
+'Tigrinya' => 'ትግርኛ',
+'Setswana' => 'Tswana',
+'Turkmen' => 'түркменче',
+'Turkish' => 'Türk',
+'Tonga' => 'lea faka-Tonga',
+'Somali' => 'Afsoomaali',
+'Tibetan' => 'བོད་སྐད་',
+'Tsonga' => 'Xitsonga',
+'Ukrainian' => 'Український',
+'Uigur' => 'ئۇيغۇر‎',
+'Tatar' => 'Татарча',
+'Urdu' => 'اردو',
+'Welsh' => 'Cymru',
+'Volapuk' => 'Volapük',
+'Vietnamese' => 'Việt',
+'Xhosa' => 'isiXhosa',
+'Uzbek' => 'O‘zbek',
+'Zhuang' => 'Vahcuengh',
+'Yiddish' => 'ייִדיש',
+'Yoruba' => 'èdèe Yorùbá',
+'Chinese' => '中文',
+'Zulu' => 'isiZulu',
+
+# IGNORE
+''=>''
+
+);
+
+/* End of file easy_language_select_ft_lang.php */
+/* Location: ./system/expressionengine/third_party/easy_language_select/language/english/easy_language_select_ft_lang.php */
4 CHANGELOG
View
@@ -1,3 +1,7 @@
+*v1.1* (2010-12-20)
+
+* EE2 port
+
*v1.0* (2010-07-06)
* Initial script
7 README
View
@@ -1,6 +1,6 @@
== ft.easy_language_select.php
-Language dropdown for ExpressionEngine using FieldFrame.
+Language selection dropdown for ExpressionEngine.
== Usage
@@ -12,11 +12,12 @@ To display the language code: {fieldname code="yes"}
== Current Version
-1.0 (6 July 2010)
+1.1 (20 December 2010)
== Requirements
-FieldFrame
+2.x - none
+1.x - FieldFrame
== License
Please sign in to comment.
Something went wrong with that request. Please try again.