public function replace_tag($tagdata = '', $params = '') { if ($tagdata == '') { return $tagdata; } $raw_content = parent::replace_tag($tagdata, $params); $content_obj = json_decode($raw_content); if (isset($content_obj->title_text)) { $tagdata = str_replace('{title_text}', $content_obj->title_text, $tagdata); } if (isset($content_obj->assets_file_id)) { ee()->load->add_package_path(PATH_THIRD . 'assets/'); require_once PATH_THIRD . 'assets/sources/ee/file.ee.php'; require_once PATH_THIRD . 'assets/helper.php'; ee()->load->library('Assets_lib'); $assets_file = ee()->assets_lib->get_file_by_id($content_obj->assets_file_id); $assets_helper = new Assets_helper(); $tagdata = $assets_helper->parse_file_tag(array($assets_file), $tagdata); } else { if (isset($content_obj->file_id)) { require_once APPPATH . 'fieldtypes/file/ft.file.php'; $ee_file = new File_ft(); $file_info = ee()->file_field->parse_field($content_obj->file_id); if ($file_info) { $tagdata = $ee_file->replace_tag($file_info, $params, $tagdata); } } } return $tagdata; }
public function replace_tag($file_info, $params = array(), $tagdata = FALSE) { if ($tagdata == '') { $tagdata = FALSE; } if ($file_info) { if ( ! is_array($file_info)) { $file_info = parent::pre_process($file_info); } return parent::replace_tag($file_info, $params, $tagdata); } return ''; }