当前位置: 首页>>代码示例>>PHP>>正文


PHP DocumentManager::build_document_icon_tag方法代码示例

本文整理汇总了PHP中DocumentManager::build_document_icon_tag方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::build_document_icon_tag方法的具体用法?PHP DocumentManager::build_document_icon_tag怎么用?PHP DocumentManager::build_document_icon_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocumentManager的用法示例。


在下文中一共展示了DocumentManager::build_document_icon_tag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

                $dropbox_file_data[] = $file_size;
                $action_icons = '';
                $dropbox_data_sent[] = $dropbox_file_data;
            }
        }
        $moveList = array();
        // The content of the sortable table = the categories (if we are not in the root)
        if ($view_dropbox_category_sent == 0) {
            foreach ($dropbox_categories as $category) {
                $dropbox_category_data = array();
                if ($category['sent'] == '1') {
                    $moveList[$category['cat_id']] = $category['cat_name'];
                    $dropbox_category_data[] = $category['cat_id'];
                    // This is where the checkbox icon for the files appear.
                    $link_open = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $category['cat_id'] . '&view=' . $view . '">';
                    $dropbox_category_data[] = $link_open . DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])) . '</a>';
                    $dropbox_category_data[] = '<a href="' . api_get_path(WEB_CODE_PATH) . 'dropbox/dropbox_download.php?' . api_get_cidreq() . '&cat_id=' . $category['cat_id'] . '&action=downloadcategory&sent_received=sent">' . Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL) . '</a>' . $link_open . Security::remove_XSS($category['cat_name']) . '</a>';
                    //$dropbox_category_data[] = '';
                    $dropbox_category_data[] = '';
                    //$dropbox_category_data[] = '';
                    $dropbox_category_data[] = '';
                    $dropbox_category_data[] = '';
                    $dropbox_category_data[] = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $viewSentCategory . '&view=' . $view . '&action=editcategory&id=' . $category['cat_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>
									<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $viewSentCategory . '&view=' . $view . '&action=deletesentcategory&id=' . $category['cat_id'] . '" onclick="javascript: return confirmation(\'' . Security::remove_XSS($category['cat_name']) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
                }
                if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
                    $dropbox_data_sent[] = $dropbox_category_data;
                }
            }
        }
        // Displaying the table
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:index.php

示例2: create_document_link


//.........这里部分代码省略.........
     $copy_to_myfiles = $open_in_new_window_link = null;
     $curdirpath = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
     $send_to = null;
     $checkExtension = $path;
     if (!$show_as_icon) {
         if ($filetype == 'folder') {
             if (api_is_allowed_to_edit() || api_is_platform_admin() || api_get_setting('students_download_folders') == 'true') {
                 //filter when I am into shared folder, I can show for donwload only my shared folder
                 if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
                     if (preg_match('/shared_folder\\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) || preg_match('/shared_folder_session_' . $current_session_id . '\\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) || api_is_allowed_to_edit() || api_is_platform_admin()) {
                         $force_download_html = $size == 0 ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
                     }
                 } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) || api_is_allowed_to_edit() || api_is_platform_admin()) {
                     $force_download_html = $size == 0 ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
                 }
             }
         } else {
             $force_download_html = $size == 0 ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
         }
         // Copy files to users myfiles
         if (api_get_setting('social.allow_social_tool') == 'true' && api_get_setting('document.users_copy_files') == 'true' && !api_is_anonymous()) {
             $copy_myfiles_link = $filetype == 'file' ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
             if ($filetype == 'file') {
                 $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' . Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
             }
             if ($filetype == 'file') {
                 $send_to = Portfolio::share('document', $document_data['id'], array('style' => 'float:right;'));
             }
         }
         $pdf_icon = '';
         $extension = pathinfo($path, PATHINFO_EXTENSION);
         if (!api_is_allowed_to_edit() && api_get_setting('students_export2pdf') == 'true' && $filetype == 'file' && in_array($extension, array('html', 'htm'))) {
             $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' . Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
         }
         if ($is_browser_viewable_file) {
             $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' . Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
         }
         if ($filetype == 'file') {
             // Sound preview with jplayer
             if (preg_match('/mp3$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && !preg_match('/_chnano_.wav$/i', urldecode($url)) || preg_match('/ogg$/i', urldecode($checkExtension))) {
                 return '<span style="float:left" ' . $visibility_class . '>' . $title . '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
             } elseif (preg_match('/swf$/i', urldecode($checkExtension)) || preg_match('/png$/i', urldecode($checkExtension)) || preg_match('/gif$/i', urldecode($checkExtension)) || preg_match('/jpg$/i', urldecode($checkExtension)) || preg_match('/jpeg$/i', urldecode($checkExtension)) || preg_match('/bmp$/i', urldecode($checkExtension)) || preg_match('/svg$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && preg_match('/_chnano_.wav$/i', urldecode($checkExtension)) && api_get_setting('document.enable_nanogong') == 'true') {
                 // Simpler version of showinframesmin.php with no headers
                 $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
                 $class = 'ajax';
                 if ($visibility == false) {
                     $class = "ajax invisible";
                 }
                 return Display::url($title, $url, ['class' => $class, 'title' => $tooltip_title_alt, 'data-title' => $title, 'style' => 'float: left;']) . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
             } else {
                 // For PDF Download the file.
                 $pdfPreview = null;
                 if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
                     $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
                 } else {
                     $pdfPreview = Display::url(Display::return_icon('preview.gif', get_lang('Preview')), api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'], array('style' => 'float:right'));
                 }
                 // No plugin just the old and good showinframes.php page
                 return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' . $pdfPreview . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
             }
         } else {
             return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
         }
         // end copy files to users myfiles
     } else {
         // Icon column
         if (preg_match('/shared_folder/', urldecode($checkExtension)) && preg_match('/shared_folder$/', urldecode($checkExtension)) == false && preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false) {
             if ($filetype == 'file') {
                 //Sound preview with jplayer
                 if (preg_match('/mp3$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && !preg_match('/_chnano_.wav$/i', urldecode($url)) || preg_match('/ogg$/i', urldecode($checkExtension))) {
                     $sound_preview = DocumentManager::generate_media_preview($counter);
                     return $sound_preview;
                 } elseif (preg_match('/swf$/i', urldecode($checkExtension)) || preg_match('/png$/i', urldecode($checkExtension)) || preg_match('/gif$/i', urldecode($checkExtension)) || preg_match('/jpg$/i', urldecode($checkExtension)) || preg_match('/jpeg$/i', urldecode($checkExtension)) || preg_match('/bmp$/i', urldecode($checkExtension)) || preg_match('/svg$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && preg_match('/_chnano_.wav$/i', urldecode($checkExtension)) && api_get_setting('document.enable_nanogong') == 'true') {
                     $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
                     return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
                 } else {
                     return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
                 }
             } else {
                 return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
             }
         } else {
             if ($filetype == 'file') {
                 // Sound preview with jplayer
                 if (preg_match('/mp3$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && !preg_match('/_chnano_.wav$/i', urldecode($url)) || preg_match('/ogg$/i', urldecode($checkExtension))) {
                     $sound_preview = DocumentManager::generate_media_preview($counter);
                     return $sound_preview;
                 } elseif (preg_match('/html$/i', urldecode($checkExtension)) || preg_match('/htm$/i', urldecode($checkExtension)) || preg_match('/swf$/i', urldecode($checkExtension)) || preg_match('/png$/i', urldecode($checkExtension)) || preg_match('/gif$/i', urldecode($checkExtension)) || preg_match('/jpg$/i', urldecode($checkExtension)) || preg_match('/jpeg$/i', urldecode($checkExtension)) || preg_match('/bmp$/i', urldecode($checkExtension)) || preg_match('/svg$/i', urldecode($checkExtension)) || preg_match('/wav$/i', urldecode($checkExtension)) && preg_match('/_chnano_.wav$/i', urldecode($checkExtension)) && api_get_setting('document.enable_nanogong') == 'true') {
                     $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
                     //without preview
                     return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
                 } else {
                     return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
                 }
             } else {
                 return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' . DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
             }
         }
     }
 }
开发者ID:daffef,项目名称:chamilo-lms,代码行数:101,代码来源:document.lib.php

示例3: get_work_user_list


//.........这里部分代码省略.........
                    $qualification_string = Display::label('-');
                } else {
                    $label = 'info';
                    $relativeScore = $work['qualification'] / $work_data['qualification'];
                    if ($relativeScore < 0.5) {
                        $label = 'important';
                    } elseif ($relativeScore < 0.75) {
                        $label = 'warning';
                    }
                    $qualification_string = Display::label($work['qualification'] . ' / ' . $work_data['qualification'], $label);
                }
            }
            $work['qualification_score'] = $work['qualification'];
            $add_string = '';
            $time_expires = '';
            if (!empty($work_assignment['expires_on'])) {
                $time_expires = api_strtotime($work_assignment['expires_on'], 'UTC');
            }
            if (!empty($work_assignment['expires_on']) && !empty($time_expires) && $time_expires < api_strtotime($work['sent_date'], 'UTC')) {
                $add_string = Display::label(get_lang('Expired'), 'important');
            }
            if ($can_read && $work['accepted'] == '1' || $is_author && in_array($work['accepted'], array('1', '0')) || ($is_allowed_to_edit || api_is_drh())) {
                // Firstname, lastname, username
                $work['firstname'] = Display::div($work['firstname'], array('class' => $class));
                $work['lastname'] = Display::div($work['lastname'], array('class' => $class));
                $work['title_clean'] = $work['title'];
                if (strlen($work['title']) > 30) {
                    $short_title = substr($work['title'], 0, 27) . '...';
                    $work['title'] = Display::span($short_title, array('class' => $class, 'title' => $work['title']));
                } else {
                    $work['title'] = Display::div($work['title'], array('class' => $class));
                }
                // Type.
                $work['type'] = DocumentManager::build_document_icon_tag('file', $work['url']);
                // File name.
                $link_to_download = null;
                // If URL is present then there's a file to download keep BC.
                if ($work['contains_file'] || !empty($work['url'])) {
                    $link_to_download = '<a href="' . $url . 'download.php?id=' . $item_id . '&' . api_get_cidreq() . '">' . Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL) . '</a> ';
                }
                $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
                $feedback = null;
                $count = getWorkCommentCount($item_id, $course_info);
                if (!is_null($count) && !empty($count)) {
                    if ($qualification_exists) {
                        $feedback .= "<br />";
                    }
                    $feedback .= '<a href="' . $url . 'view.php?' . api_get_cidreq() . '&id=' . $item_id . '" title="' . get_lang('View') . '">' . Display::label($count . ' ' . get_lang('Feedback'), 'info') . '</a> ';
                }
                $work['qualification'] = $qualification_string . $feedback;
                $work['qualification_only'] = $qualification_string;
                // Date.
                $work_date = api_convert_and_format_date($work['sent_date']);
                $work['sent_date_from_db'] = $work['sent_date'];
                $work['sent_date'] = '<div class="date-time">' . date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . ' ' . $work_date . '</div>';
                // Actions.
                $correction = '';
                $action = '';
                if (api_is_allowed_to_edit()) {
                    if (!empty($work['url_correction'])) {
                        $action .= Display::url(Display::return_icon('check-circle.png', get_lang('Correction'), null, ICON_SIZE_SMALL), api_get_path(WEB_CODE_PATH) . 'work/download.php?id=' . $item_id . '&' . api_get_cidreq() . '&correction=1');
                    }
                    $action .= '<a href="' . $url . 'view.php?' . api_get_cidreq() . '&id=' . $item_id . '" title="' . get_lang('View') . '">' . Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL) . '</a> ';
                    if ($unoconv && empty($work['contains_file'])) {
                        $action .= '<a href="' . $url . 'work_list_all.php?' . api_get_cidreq() . '&id=' . $work_id . '&action=export_to_doc&item_id=' . $item_id . '" title="' . get_lang('ExportToDoc') . '" >' . Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_SMALL) . '</a> ';
                    }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:67,代码来源:work.lib.php


注:本文中的DocumentManager::build_document_icon_tag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。