本文整理汇总了PHP中DocumentManager::get_system_folders方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::get_system_folders方法的具体用法?PHP DocumentManager::get_system_folders怎么用?PHP DocumentManager::get_system_folders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::get_system_folders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_edit_icons
/**
* Creates the row of edit icons for a file/folder
*
* @param string $curdirpath current path (cfr open folder)
* @param string $type (file/folder)
* @param string $path dbase path of file/folder
* @param int $visibility (1/0)
* @param int $id dbase id of the document
* @return string html img tags with hyperlinks
*/
public static function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0, $visibility)
{
$web_odf_extension_list = DocumentManager::get_web_odf_extension_list();
$document_id = $document_data['id'];
$type = $document_data['filetype'];
$is_read_only = $document_data['readonly'];
$path = $document_data['path'];
$parent_id = DocumentManager::get_document_id(api_get_course_info(), dirname($path));
$curdirpath = dirname($document_data['path']);
$is_certificate_mode = DocumentManager::is_certificate_mode($path);
$curdirpath = urlencode($curdirpath);
$extension = pathinfo($path, PATHINFO_EXTENSION);
//@todo Implement remote support for converter
$usePpt2lp = api_get_setting('ppt_to_lp.active') == 'true' && api_get_setting('ppt_to_lp.host') == 'localhost';
$formatTypeList = DocumentManager::getFormatTypeListConvertor('from', $extension);
$formatType = current($formatTypeList);
// Build URL-parameters for table-sorting
$sort_params = array();
if (isset($_GET['column'])) {
$sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
}
if (isset($_GET['page_nr'])) {
$sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
}
if (isset($_GET['per_page'])) {
$sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
}
if (isset($_GET['direction'])) {
$sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
}
$sort_params = implode('&', $sort_params);
$visibility_icon = $visibility == 0 ? 'invisible' : 'visible';
$visibility_command = $visibility == 0 ? 'set_visible' : 'set_invisible';
$modify_icons = '';
// If document is read only *or* we're in a session and the document
// is from a non-session context, hide the edition capabilities
if ($is_read_only) {
if (api_is_course_admin() || api_is_platform_admin()) {
if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('editor.enabled_support_svg') == 'true') {
$modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
$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>';
}
} else {
$modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
}
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
if (api_is_allowed_to_edit() || api_is_platform_admin()) {
$modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
}
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
} else {
//Edit button
if (in_array($path, DocumentManager::get_system_folders())) {
$modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
} elseif ($is_certificate_mode) {
// gradebook category doesn't seem to be taken into account
$modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('editor.enabled_support_svg') == 'true') {
$modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
$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>';
}
} 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('editor.enabled_support_svg') == 'true') {
$modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
$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.
//.........这里部分代码省略.........
示例2: build_edit_icons
/**
* Creates the row of edit icons for a file/folder
*
* @param string $curdirpath current path (cfr open folder)
* @param string $type (file/folder)
* @param string $path dbase path of file/folder
* @param int $visibility (1/0)
* @param int $id dbase id of the document
* @return string html img tags with hyperlinks
*/
function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0, $visibility)
{
if (isset($_SESSION['_gid'])) {
$req_gid = '&gidReq=' . $_SESSION['_gid'];
} else {
$req_gid = '';
}
$document_id = $document_data['id'];
$type = $document_data['filetype'];
$is_read_only = $document_data['readonly'];
$path = $document_data['path'];
$parent_id = DocumentManager::get_document_id(api_get_course_info(), dirname($path));
$curdirpath = dirname($document_data['path']);
$is_certificate_mode = DocumentManager::is_certificate_mode($path);
$curdirpath = urlencode($curdirpath);
$extension = pathinfo($path, PATHINFO_EXTENSION);
// Build URL-parameters for table-sorting
$sort_params = array();
if (isset($_GET['column'])) {
$sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
}
if (isset($_GET['page_nr'])) {
$sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
}
if (isset($_GET['per_page'])) {
$sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
}
if (isset($_GET['direction'])) {
$sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
}
$sort_params = implode('&', $sort_params);
$visibility_icon = $visibility == 0 ? 'invisible' : 'visible';
$visibility_command = $visibility == 0 ? 'set_visible' : 'set_invisible';
$modify_icons = '';
// If document is read only *or* we're in a session and the document
// is from a non-session context, hide the edition capabilities
if ($is_read_only) {
if (api_is_course_admin() || api_is_platform_admin()) {
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>';
}
} else {
$modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
}
$modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
if (api_is_allowed_to_edit() || api_is_platform_admin()) {
$modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
}
$modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
} else {
//Edit button
if (in_array($path, DocumentManager::get_system_folders())) {
$modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
} elseif ($is_certificate_mode) {
// gradebook category doesn't seem to be taken into account
$modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . $req_gid . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
} else {
if (api_get_session_id()) {
if ($document_data['session_id'] == api_get_session_id()) {
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>';
}
} 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>';
//.........这里部分代码省略.........