/** * _saveEnclosure * * @param string $name Params * @param string $type Params * @param string $src Params * * @return void */ public function _saveEnclosure($name, $type, $src) { if ($type == 'images') { $savepath = $this->_params->get('save_enc_image_as_img', 1) ? $this->_params->get('img_savepath') : $this->_params->get('savepath') . $type . '/'; if (!JFolder::exists($savepath)) { JFolder::create($savepath); } $file_path = $savepath . $name; } else { $savepath = $this->_params->get('savepath') . $type . '/'; if (!JFolder::exists($savepath)) { JFolder::create($savepath); } $file_path = $savepath . $name; } if (!file_exists($file_path)) { if (!($contents = TextUtil::getUrl(TextUtil::encode_url($src), $this->_params->get('scrape_type'), $type, $file_path))) { // Enclosure Not Saved'); return false; } else { // Enclosure Saved'); } } else { // Enclosure Already Saved'); } return true; }