/** * Export wiki content in a ODF * @param int $id * @param string int * @return bool */ public function exportTo($id, $format = 'doc') { $data = self::get_wiki_data($id); if (isset($data['content']) && !empty($data['content'])) { Export::htmlToOdt($data['content'], $data['reflink'], $format); } return false; }
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'group/group.php?' . api_get_cidreq(), 'name' => get_lang('Groups')); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' . api_get_cidreq(), 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']); } $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'name' => get_lang('StudentPublications')); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId, 'name' => $my_folder_data['title']); $error_message = null; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $itemId = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null; $message = null; switch ($action) { case 'export_to_doc': if ($is_allowed_to_edit) { if (!empty($itemId)) { $work = get_work_data_by_id($itemId); if (!empty($work)) { Export::htmlToOdt($work['description'], $work['title']); } } } break; case 'delete': /* Delete document */ if ($itemId) { $fileDeleted = deleteWorkItem($itemId, $courseInfo); if (!$fileDeleted) { $message = Display::return_message(get_lang('YouAreNotAllowedToDeleteThisDocument'), 'error'); } else { $message = Display::return_message(get_lang('TheDocumentHasBeenDeleted'), 'confirmation'); } } break;