function setMeta($content) { $data = DataSet::get_param('library_meta_setmeta'); $title = isset($data['title']) ? $data['title'] : 'CLEAR Indonesia'; $description = isset($data['description']) ? $data['description'] : ''; $keyword = isset($data['keyword']) ? $data['keyword'] : ''; $url = isset($data['url']) ? $data['url'] : ''; $image = isset($data['image']) ? $data['image'] : ''; if (!$description) { $description = $title; } if (!$keyword) { $keyword = $this->_generateKeyword($description); } $this->c->add_data_set('template_meta_title', $title); $this->c->add_data_set('template_meta_description', $description); $this->c->add_data_set('template_meta_keywords', $keyword); $this->c->add_data_set('template_meta_url', $url); $meta_common = $this->c->view('templates/meta_common', true); if (!$image) { $image = Config::get('base_url') . 'assets/img/logo.jpg'; } $this->c->add_data_set('template_meta_image', $image); $meta_image = $this->c->view('templates/meta_image', true); $content = str_replace(array('{TEMPLATE_METACOMMON}', '{TEMPLATE_METAIMAGE}'), array($meta_common, $meta_image), $content); return $content; }