function smarty_function_extract($params, Smarty_Internal_Template $template) { if (isset($params['page']) && isset($params['var']) && isset($params['path'])) { $page_id = trim($params['page']); } else { return; } if (isset($params['language'])) { $language_id = trim($params['language']); } else { $language_id = null; } $page_content = new PageContent(); if ($page_content->load($page_id)) { $page_data = $page_content->getArray($language_id); $data = $page_content->extract($params['path'], $page_data); $template->assign($params['var'], $data); } }