/** * Saves new language edits * * @return @e void */ public function languageEditWordPackValues() { //----------------------------------------- // Init //----------------------------------------- $id = intval($this->request['id']); $langCheck = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id)); if ($langCheck['lang_protected'] and !IN_DEV) { $this->registry->output->showError($this->lang->words['lang_pack_protected']); } /* Got anything? */ if (!count(array_keys($_POST['lang']))) { $this->registry->output->redirect($this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited']); } //----------------------------------------- // Get the words //----------------------------------------- $lang = $this->DB->buildAndFetchAll(array('select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$id} AND word_id IN(" . implode(',', array_map('intval', array_keys($_POST['lang']))) . ')'), 'word_id'); //----------------------------------------- // Loop through language bits submitted //----------------------------------------- if (is_array($_POST['lang']) && count($_POST['lang'])) { foreach ($_POST['lang'] as $k => $v) { if ($v != "") { $v = IPSText::safeSlashes($v); $v = str_replace('\', '\\', $v); if ($lang[$k]['word_pack'] == 'admin_js' or $lang[$k]['word_pack'] == 'public_js') { $v = str_replace(array("\r\n", "\r"), "", $v); } $this->DB->update('core_sys_lang_words', "word_custom='" . $this->DB->addSlashes($v) . "', word_custom_version=word_default_version", "word_id=" . intval($k), false, true); } elseif (isset($lang[$k]) and $lang[$k]['word_custom']) { $this->DB->update('core_sys_lang_words', array('word_custom' => ''), "word_id=" . intval($k)); } } } //----------------------------------------- // Recache and redirect //----------------------------------------- $this->cacheToDisk($id); $this->registry->output->redirect($this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited']); }
/** * Saves new language edits * * @access public * @return void */ public function languageEditWordPackValues() { //----------------------------------------- // Init //----------------------------------------- $id = intval($this->request['id']); //----------------------------------------- // Loop through language bits submitted //----------------------------------------- if (is_array($_POST['lang']) && count($_POST['lang'])) { foreach ($_POST['lang'] as $k => $v) { if ($v) { $v = IPSText::safeSlashes($v); $v = str_replace('\', '\\', $v); $this->DB->update('core_sys_lang_words', "word_custom='" . $this->DB->addSlashes($v) . "', word_custom_version=word_default_version", "word_id=" . intval($k), false, true); } } } //----------------------------------------- // Recache and redirect //----------------------------------------- $this->cacheToDisk($id); $this->registry->output->redirect("{$this->settings['base_url']}&module=languages§ion=manage_languages&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited']); }