private function setMdLangs($md_langs) { $this->md_langs = getMdLangs($md_langs); $this->md_langs_count = count($this->md_langs); if ($this->md_langs_count == 0) { setMickaLog("Not found MdLangs! lang={$md_langs}!", 'ERROR', 'EditForm.setMdLangs'); } }
/** * Určení jazyka, který se použije pro výběr dat. * Priorita: 1. MICKA_LANG, 2. ENG, 3. první v pořadí * * @param string $langs seznam jazyků z tabulky MD.langs * @return string */ private function getLangValue($langs) { if (substr_count($langs, MICKA_LANG) > 0) { return MICKA_LANG; } if (getCountLang($langs) == 1) { return $langs; } else { $md_langs = getMdLangs($langs); if (array_search('eng', $md_langs) === FALSE) { return $md_langs[0]; } else { return 'eng'; } } }
public function deleteMdIdFromMdValues($recno, $langs, $md_id_array) { $sql = array(); if ($langs == '') { return FALSE; } $langs_array = getMdLangs($langs); $langs_array[] = 'xxx'; if (is_array($md_id_array) && count($md_id_array) > 0) { array_push($sql, "DELETE FROM {$this->table_md_values} WHERE recno=%i", $recno); array_push($sql, "AND lang IN %in", $langs_array); array_push($sql, "AND md_id IN %in", $md_id_array); return _executeSql('delete', $sql, array('all')); } else { return FALSE; } }
function getMdOtherLangs($langs, $main_lang, $format = 'xml') { //setMickaLog("LANGS=$langs, main_lang=$main_lang, format=$format", 'DEBUG', 'micka_lib.getMdOtherLangs.start'); $rs = ''; $langs = getMdLangs($langs); if (count($langs) > 1 && $format == 'xml') { foreach ($langs as $value) { if ($value != $main_lang) { $rs .= "<lang>{$value}</lang>"; } } if ($rs != '') { $rs = '<langs>' . $rs . '</langs>'; } } //setMickaLog($rs, 'DEBUG', 'micka_lib.getMdOtherLangs.return'); return $rs; }