本文整理汇总了PHP中DocumentManager::get_default_certificate_id方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::get_default_certificate_id方法的具体用法?PHP DocumentManager::get_default_certificate_id怎么用?PHP DocumentManager::get_default_certificate_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::get_default_certificate_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_edit_icons
//.........这里部分代码省略.........
$modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('editor.enabled_support_pixlr') == 'true') {
$modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
}
}
}
// Move button.
if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . '">' . Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . '">' . Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
//Visibility button
if ($is_certificate_mode) {
$modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_is_allowed_to_edit() || api_is_platform_admin()) {
if ($visibility_icon == 'invisible') {
$tip_visibility = get_lang('Show');
} else {
$tip_visibility = get_lang('Hide');
}
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&' . $visibility_command . '=' . $id . '&' . $sort_params . '">' . Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
}
}
// Delete button
if (in_array($path, DocumentManager::get_system_folders())) {
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
} else {
$titleToShow = addslashes(basename($document_data['title']));
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' && DocumentManager::get_default_certificate_id(api_get_course_id()) == $id) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id=' . $parent_id . '&deleteid=' . $document_id . '&' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if ($is_certificate_mode) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id=' . $parent_id . '&deleteid=' . $document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id=' . $parent_id . '&deleteid=' . $document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id=' . $parent_id . '&deleteid=' . $document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
}
}
// Add action to covert to PDF, will create a new document whit same filename but .pdf extension
// @TODO: add prompt to select a format target
if (in_array($path, DocumentManager::get_system_folders())) {
// nothing to do
} else {
if ($usePpt2lp && $formatType) {
$modify_icons .= ' <a class="convertAction" href="#" ' . 'data-documentId = ' . $document_id . ' data-formatType = ' . $formatType . '>' . Display::return_icon('convert.png', get_lang('Convert'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
}
if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
if ($is_template == 0) {
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates' || !isset($_GET['curdirpath'])) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&add_as_template=' . $id . '&' . $sort_params . '">' . Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
}
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {
//allow attach certificate to course
$visibility_icon_certificate = 'nocertificate';
if (DocumentManager::get_default_certificate_id(api_get_course_id()) == $id) {
$visibility_icon_certificate = 'certificate';
$certificate = get_lang('DefaultCertificate');
$preview = get_lang('PreviewCertificate');
$is_preview = true;
} else {
$is_preview = false;
$certificate = get_lang('NoDefaultCertificate');
}
if (isset($_GET['selectcat'])) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&set_certificate=' . $id . '&' . $sort_params . '">
<img src="../img/' . $visibility_icon_certificate . '.png" border="0" title="' . $certificate . '" alt="" /></a>';
if ($is_preview) {
$modify_icons .= ' <a target="_blank" href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&set_preview=' . $id . '&' . $sort_params . '" >' . Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
}
}
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&remove_as_template=' . $id . '&' . $sort_params . '">' . Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
}
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' . Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
}
return $modify_icons;
}
示例2: substr
if ($new_comment) {
$ct .= ", comment='{$new_comment}'";
}
if ($new_title) {
$ct .= ", title='{$new_title}'";
}
Database::query("UPDATE {$doc_table} SET" . substr($ct, 1) . " WHERE c_id = {$course_id} AND id = '{$document_id}'");
}
$dir = substr($dir, 0, -1);
$selectcat = '';
if (isset($_REQUEST['selectcat'])) {
$selectcat = "&selectcat=" . Security::remove_XSS($_REQUEST['selectcat']);
}
$certificate_condition = '';
if ($is_certificate_mode) {
$df = DocumentManager::get_default_certificate_id($_course['code']);
if (!isset($df)) {
DocumentManager::attach_gradebook_certificate($_course['code'], $document_id);
}
$certificate_condition = '&certificate=true';
}
header('Location: document.php?' . api_get_cidreq() . '&id=' . $folder_id . $selectcat . $certificate_condition);
exit;
} else {
Display::display_header($nameTools, 'Doc');
Display::display_error_message(get_lang('Impossible'));
Display::display_footer();
}
} else {
Display::display_header($nameTools, 'Doc');
Display::display_error_message(get_lang('Impossible'));
示例3: build_edit_icons
//.........这里部分代码省略.........
$modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
}
} else {
$modify_icons .= ' ' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
}
} else {
if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
$modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
$modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
}
}
}
//Move button
if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . $req_gid . '">' . Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . $req_gid . '">' . Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
//Visibility button
if ($is_certificate_mode) {
$modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_is_allowed_to_edit() || api_is_platform_admin()) {
if ($visibility_icon == 'invisible') {
$tip_visibility = get_lang('Show');
} else {
$tip_visibility = get_lang('Hide');
}
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&' . $visibility_command . '=' . $id . $req_gid . '&' . $sort_params . '">' . Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
}
}
//Delete button
if (in_array($path, DocumentManager::get_system_folders())) {
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
} else {
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' && DocumentManager::get_default_certificate_id(api_get_course_id()) == $id) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&delete=' . urlencode($path) . $req_gid . '&' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if ($is_certificate_mode) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&delete=' . urlencode($path) . $req_gid . '&' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&delete=' . urlencode($path) . $req_gid . '&' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&delete=' . urlencode($path) . $req_gid . '&' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
}
}
}
if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
if ($is_template == 0) {
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates' || !isset($_GET['curdirpath'])) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&add_as_template=' . $id . $req_gid . '&' . $sort_params . '">' . Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
}
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {
//allow attach certificate to course
$visibility_icon_certificate = 'nocertificate';
if (DocumentManager::get_default_certificate_id(api_get_course_id()) == $id) {
$visibility_icon_certificate = 'certificate';
$certificate = get_lang('DefaultCertificate');
$preview = get_lang('PreviewCertificate');
$is_preview = true;
} else {
$is_preview = false;
$certificate = get_lang('NoDefaultCertificate');
}
if (isset($_GET['selectcat'])) {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&set_certificate=' . $id . $req_gid . '&' . $sort_params . '">
' . Display::return_icon($visibility_icon_certificate . '.png', $certificate) . '
</a>';
if ($is_preview) {
$modify_icons .= ' <a target="_blank" href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&set_preview=' . $id . $req_gid . '&' . $sort_params . '" >' . Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
}
}
}
} else {
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&remove_as_template=' . $id . $req_gid . '&' . $sort_params . '">' . Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
}
$modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' . Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
}
return $modify_icons;
}