From 18c8b497e6d562b1c932c2ee158c34e9a16a5d3c Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 30 Jul 2012 00:00:33 -0500 Subject: [PATCH] Minor - code documetation update --- main/admin/sub_language.php | 16 +++++-- main/admin/sub_language_ajax.inc.php | 72 ++++++++++++++++------------ 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/main/admin/sub_language.php b/main/admin/sub_language.php index a3d1a091d2..35bb957fee 100644 --- a/main/admin/sub_language.php +++ b/main/admin/sub_language.php @@ -1,6 +1,12 @@ }); }); '; -/* MAIN CODE */ +/** + * Main code + */ // setting the name of the tool $tool_name = get_lang('CreateSubLanguage'); // setting breadcrumbs @@ -265,7 +273,9 @@ function search_language_term($term, $search_in_variable = true , $search_in_eng $list_info = array_unique_dimensional($list_info); return $list_info; } - +/** + * Output + */ //allow see data in sortetable if (isset($_REQUEST['txt_search_word'])) { //@todo fix to accept a char with 1 char diff --git a/main/admin/sub_language_ajax.inc.php b/main/admin/sub_language_ajax.inc.php index 995f2af199..9fc9082baf 100644 --- a/main/admin/sub_language_ajax.inc.php +++ b/main/admin/sub_language_ajax.inc.php @@ -1,5 +1,12 @@ $value_info) { - $result_array[$key_value] = SubLanguageManager::write_data_in_file($path_folder, $value_info, $key_value); - } - $variables_with_problems = ''; - if (!empty($result_array)) { + + foreach ($all_file_of_directory as $key_value=>$value_info) { + $result_array[$key_value] = SubLanguageManager::write_data_in_file($path_folder, $value_info, $key_value); + } + $variables_with_problems = ''; + if (!empty($result_array)) { foreach($result_array as $key =>$result) { if ($result == false) { - $variables_with_problems .=$key.'
'; - } - } - } - if (!empty($variables_with_problems)) { - echo $path_folder.' '.get_lang('IsNotWritable').'
'.api_ucwords(get_lang('ErrorsFound')).':
'.$variables_with_problems; - } else { - echo 1; - } + $variables_with_problems .=$key.'
'; + } + } + } + if (!empty($variables_with_problems)) { + echo $path_folder.' '.get_lang('IsNotWritable').'
'.api_ucwords(get_lang('ErrorsFound')).':
'.$variables_with_problems; + } else { + echo get_lang('Saved'); + } } +