public function parse($name, $args = array()) { if (trim($name) == '') { return false; } // set up some preliminary stuff $this->lang = array_key_exists('lang', $args) ? $args['lang'] : WHP_LANG; $cache = new wowhead_cache(); $this->language->loadLanguage($this->lang); if (!($result = $cache->getEnchant($name, $this->lang))) { $result = is_numeric($name) ? $this->getEnchantByID($name) : $this->getEnchantByName($name); if (!$result || sizeof($this->reagents) == 0) { $cache->close(); return $this->_notFound($this->language->words['enchant'], $name); } else { $cache->saveEnchant($result, $this->reagents); $cache->close(); return $this->toHTML($result); } } else { $this->reagents = $cache->getEnchantReagents($result['id'], $this->lang); $cache->close(); return $this->toHTML($result); } }