* Update the given field with the given value by language_code and charset
* @access public
* @param $langCode
- * $charset
* $fieldName
* $fieldValue
* @return true / false
* @author Cindy Qi Li
*/
- function UpdateField($langCode, $charset, $fieldName, $fieldValue)
+ function UpdateField($langCode, $fieldName, $fieldValue)
{
global $addslashes;
$sql = "UPDATE ".TABLE_PREFIX."languages
SET ".$fieldName."='".$addslashes($fieldValue)."'
- WHERE language_code = '".$langCode."'
- AND charset = '".$charset."'";
+ WHERE language_code = '".$langCode."'";
return $this->execute($sql);
}
}
$sql_dump = substr($sql_dump, 0, -3) . ";";
- $readme = 'This is an AContent language pack. Use the administrator Language section to import this language pack or manually import the contents of the SQL file into your [table_prefix]language_text table, where `table_prefix` should be replaced with your correct AContent table prefix as defined in ./include/config.inc.php .';
+ $readme = 'This is an AContent language pack. Use the administrator Language section to import this language pack or manually import the contents of the SQL file into your [table_prefix]language_text table, where `table_prefix` should be replaced with your correct AContent table prefix as defined in ./include/config.inc.php .';
require(TR_INCLUDE_PATH . 'classes/zipfile.class.php');
$zipfile = new zipfile();
} else {
$version = str_replace('.','_',VERSION);
- $zipfile->send_file('AContent _' . $version . '_' . $this->code);
+ $zipfile->send_file('AContent_' . $version . '_' . $this->code);
}
}
function import($filename) {
require_once(TR_INCLUDE_PATH . 'lib/pclzip.lib.php');
require_once(TR_INCLUDE_PATH . 'classes/Language/LanguageParser.class.php');
-
+ require_once(TR_INCLUDE_PATH . 'classes/DAO/LanguagesDAO.class.php');
+
global $languageManager, $msg;
$import_path = TR_CONTENT_DIR . 'import/';
$languageParser->parse($language_xml);
$languageEditor =& $languageParser->getLanguageEditor(0);
- if ($languageManager->exists($languageEditor->getCode())) {
+ $lang_code = $languageEditor->getCode();
+ if ($languageManager->exists($lang_code)) {
$msg->addError('LANG_EXISTS');
}
if (!$msg->containsErrors()) {
$languageEditor->import($import_path . 'language_text.sql');
+ $languagesDAO = new LanguagesDAO();
+ $languagesDAO->UpdateField($lang_code, "status", TR_STATUS_ENABLED);
$msg->addFeedback('IMPORT_LANG_SUCCESS');
$version_in_pack = $languageEditor->getTransformableVersion();
\r
// Format of $_POST['field']: [fieldName]|[language_code]|[charset]\r
$pieces = explode(':', $_POST['field']);\r
- $languagesDAO->UpdateField($pieces[1], $pieces[2], $pieces[0], $_POST['value']);\r
+ $languagesDAO->UpdateField($pieces[1], $pieces[0], $_POST['value']);\r
$rtn['status'] = 'success';\r
$rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
}\r