Skip to content

Commit

Permalink
Fixed for Languages 1.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed Nov 27, 2013
1 parent 87c94d2 commit caad6cb
Show file tree
Hide file tree
Showing 9 changed files with 809 additions and 926 deletions.
4 changes: 0 additions & 4 deletions assets/frontend_localisation.multilingual_tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
margin-bottom: 0;
}



/*--------------------------------------------*/
/* !Tabs */
/*--------------------------------------------*/
Expand Down Expand Up @@ -87,8 +85,6 @@
margin-right: 5px;
}



/*--------------------------------------------*/
/* !Span */
/*--------------------------------------------*/
Expand Down
6 changes: 3 additions & 3 deletions assets/frontend_localisation.multilingual_tabs_init.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function($, undefined){
(function ($, undefined) {

$(document).ready(function(){
$(document).ready(function () {

// wherever this is called
$(this).find('.field-multilingual').symphonyMultilingualTabs();

// for duplicator. Useful for fields that use Multilingual Tabs on /blueprints/sections/edit
$(this).on('constructshow.duplicator', function(){
$(this).on('constructshow.duplicator', function () {
$(this).find('.field-multilingual').symphonyMultilingualTabs();
});

Expand Down
4 changes: 2 additions & 2 deletions assets/frontend_localisation.preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
var langs_val = $('select[name="' + langs_name + '"]').val();

$form.append($('<input/>').attr({
'name' : langs_name,
'type' : 'hidden',
'name': langs_name,
'type': 'hidden',
'value': langs_val.join(',')
}));
});
Expand Down
36 changes: 16 additions & 20 deletions data-sources/data.fl_languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@



require_once(TOOLKIT.'/class.datasource.php');
require_once(EXTENSIONS.'/frontend_localisation/lib/class.FLang.php');
require_once(TOOLKIT . '/class.datasource.php');
require_once(EXTENSIONS . '/frontend_localisation/lib/class.FLang.php');

Class datasourcefl_languages extends Datasource {


Class datasourcefl_languages extends Datasource
{

public function about(){
public function about() {
return array(
'name' => 'FL: Languages',
'author' => array(
Expand All @@ -24,11 +21,11 @@ public function about(){
);
}

public function allowEditorToParse(){
public function allowEditorToParse() {
return false;
}

public function grab(&$param_pool = null){
public function grab(&$param_pool = null) {
$result = new XMLElement('fl-languages');

$main_lang = FLang::getMainLang();
Expand All @@ -37,27 +34,26 @@ public function grab(&$param_pool = null){
$langs = FLang::getLangs();

$current_language_xml = new XMLElement('current-language', $lang_names[$crt_lc] ? $lang_names[$crt_lc]['name'] : $crt_lc);
$current_language_xml->setAttribute( 'handle', $crt_lc );
$current_language_xml->setAttribute( 'language', FLang::getLang() );
$current_language_xml->setAttribute( 'region', FLang::getReg() );
$result->appendChild( $current_language_xml );
$current_language_xml->setAttribute('handle', $crt_lc);
$current_language_xml->setAttribute('language', FLang::getLang());
$current_language_xml->setAttribute('region', FLang::getReg());
$result->appendChild($current_language_xml);

$supported_languages_xml = new XMLElement('supported-languages');

foreach($langs as $lc){
foreach ($langs as $lc) {
$lang_xml = new XMLElement('item', $lang_names[$lc] ? $lang_names[$lc]['name'] : $lc);
$lang_xml->setAttribute( 'handle', $lc );
$lang_xml->setAttribute('handle', $lc);

if( $lc === $main_lang ){
$lang_xml->setAttribute( 'main', 'yes' );
if ($lc === $main_lang) {
$lang_xml->setAttribute('main', 'yes');
}

$supported_languages_xml->appendChild( $lang_xml );
$supported_languages_xml->appendChild($lang_xml);
}

$result->appendChild( $supported_languages_xml );
$result->appendChild($supported_languages_xml);

return $result;
}

}
Loading

0 comments on commit caad6cb

Please sign in to comment.