本文整理汇总了PHP中print_cell函数的典型用法代码示例。如果您正苦于以下问题:PHP print_cell函数的具体用法?PHP print_cell怎么用?PHP print_cell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_cell函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displaydir
//.........这里部分代码省略.........
if ($is_morsle_dept = $DB->get_record('morsle_active', array('shortname' => $deptaccount)) && has_capability('moodle/course:update', $coursecontext)) {
$dirdetails[$deptstr] = new stdClass();
$dirdetails[$deptstr]->updated = date('Y-m-d');
}
}
// Create a 2D array of files and sort
$filedetails = array();
$filetitles = array();
foreach ($filelist as $name => $file) {
$filedetails[$name] = new stdClass();
$filedetails[$name]->updated = docdate($file);
$filedetails[$name]->link = $file->alternateLink;
// $row = array($filename, $filedate);
// array_push($filedetails, $row);
// usort($filedetails, create_function('$a,$b', $sortcmp));
}
// TODO: fix this hack so we're back to being able to sort
// ksort($filedetails); // sets the locked in sorting to name
// need this in order to look up the link for the file based on doc title (key)
/*
if (sizeof($filelist) > 0) {
$filevalues = array_values($filelist);
$filelist = array_combine($filetitles, $filevalues);
}
*/
// $count = 0;
// $countdir = 0;
$edittext = $padchoose . $padedit . $padunzip . $padlist . $padrestore;
if ($wdir !== '') {
$pathparts = explode('/', $wdir);
array_pop($pathparts);
$wdir = implode('/', $pathparts);
echo "<tr class=\"folder\">";
print_cell();
print_cell('left', '<a href="morslefiles.php?courseid=' . $courseid . '&wdir=' . $wdir . '&choose=' . $choose . '&name=' . $name . '"><img src="' . $OUTPUT->pix_url('f/folder') . '" class="icon" alt="" /> ' . get_string('parentfolder') . '</a>', 'name');
// print_cell('left', '<a style="padding-left:0px" href="morslefiles.php?courseid='.$courseid.'&wdir='.$wdir.'/&choose='.$choose.'"> '.get_string('parentfolder').'</a>', 'parent');
echo "</tr>";
}
if (!empty($dirdetails)) {
foreach ($dirdetails as $name => $dir) {
echo html_writer::start_tag('tr', array('class' => 'folder'));
$filedate = $dir->updated;
$filesafe = rawurlencode($name);
$filename = $name;
$fileurl = $dir->link;
// $countdir++;
// TODO: fix the parent directory
if ($name == '..') {
// $fileurl = rawurlencode(dirname($wdir));
print_cell();
// alt attribute intentionally empty to prevent repetition in screen reader
//CLAMP #289 change padding-left from 10 to 0px
//Kevin Wiliarty 2011-03-08
print_cell('left', '<a style="padding-left:0px" href="morslefiles.php?courseid=' . $courseid . '&wdir=' . $wdir . '/' . $fileurl . '&choose=' . $choose . '"><img src="' . $OUTPUT->pix_url('f/parent.gif') . '" class="icon" alt="" /> ' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
/*
} else if ($name === $userstr) { // if departmental account or user collection
// TODO: need to determine what $wdir is if we're coming in from one of the course subcollections
// don't know where this fits in
$branchdir = strpos($wdir,'read') !== false || strpos($wdir,'write') !== false || $wdir === '' ? $filesafe : "$wdir/$filesafe";
print_cell();
// alt attribute intentionally empty to prevent repetition in screen reader
//CLAMP #289 change padding-left from 10 to 0px
//Kevin Wiliarty 2011-03-08
示例2: displaydir
function displaydir($wdir)
{
// $wdir == / or /a or /a/b/c/d etc
global $basedir;
global $usecheckboxes;
global $id;
global $USER, $CFG;
$fullpath = $basedir . $wdir;
$directory = opendir($fullpath);
// Find all files
while (false !== ($file = readdir($directory))) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir($fullpath . "/" . $file)) {
$dirlist[] = $file;
} else {
$filelist[] = $file;
}
}
closedir($directory);
$strfile = get_string("file");
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$straction = get_string("action");
$strmakeafolder = get_string("makeafolder");
$struploadafile = get_string("uploadafile");
$strwithchosenfiles = get_string("withchosenfiles");
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strchoose = get_string("choose");
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"dirform\">\n";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
if ($wdir == "/") {
$wdir = "";
} else {
$bdir = str_replace("/" . basename($wdir), "", $wdir);
if ($bdir == "/") {
$bdir = "";
}
print "<tr>\n<td colspan=\"5\">";
print "<a href=\"coursefiles.php?id={$id}&wdir={$bdir}&usecheckboxes={$usecheckboxes}\" onclick=\"return reset_value();\">";
print "<img src=\"{$CFG->wwwroot}/lib/editor/htmlarea/images/folderup.gif\" height=\"14\" width=\"24\" border=\"0\" alt=\"" . get_string('parentfolder') . "\" />";
print "</a></td>\n</tr>\n";
}
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
$count++;
$filename = $fullpath . "/" . $dir;
$fileurl = $wdir . "/" . $dir;
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
echo "<tr>";
if ($usecheckboxes) {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" onclick=\"return set_rename('{$dir}');\" />");
}
print_cell("left", "<a href=\"coursefiles.php?id={$id}&wdir={$fileurl}\" onclick=\"return reset_value();\"><img src=\"{$CFG->pixpath}/f/folder.gif\" class=\"icon\" alt=\"" . get_string('folder') . "\" /></a> <a href=\"coursefiles.php?id={$id}&wdir={$fileurl}&usecheckboxes={$usecheckboxes}\" onclick=\"return reset_value();\">" . htmlspecialchars($dir) . "</a>");
print_cell("right", " ");
print_cell("right", $filedate);
echo "</tr>";
}
}
if (!empty($filelist)) {
asort($filelist);
foreach ($filelist as $file) {
$icon = mimeinfo("icon", $file);
$imgtype = mimeinfo("type", $file);
$count++;
$filename = $fullpath . "/" . $file;
$fileurl = "{$wdir}/{$file}";
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
$dimensions = get_image_size($filename);
if ($dimensions) {
$imgwidth = $dimensions[0];
$imgheight = $dimensions[1];
} else {
$imgwidth = "Unknown";
$imgheight = "Unknown";
}
unset($dimensions);
echo "<tr>\n";
if ($usecheckboxes) {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" onclick=\";return set_rename('{$file}');\" />");
}
echo "<td align=\"left\" nowrap=\"nowrap\">";
$ffurl = get_file_url($id . $fileurl);
link_to_popup_window($ffurl, "display", "<img src=\"{$CFG->pixpath}/f/{$icon}\" class=\"icon\" alt=\"{$strfile}\" />", 480, 640);
$file_size = filesize($filename);
echo "<a onclick=\"return set_value(info = {url: '" . $ffurl . "',";
echo " isize: '" . $file_size . "', itype: '" . $imgtype . "', iwidth: '" . $imgwidth . "',";
echo " iheight: '" . $imgheight . "', imodified: '" . $filedate . "' })\" href=\"#\">{$file}</a>";
echo "</td>\n";
//.........这里部分代码省略.........
示例3: fm_unzip_show_status
function fm_unzip_show_status($list, $removepath)
{
//This function shows the results of the unzip execution
//depending of the value of the $CFG->zip, results will be
//text or an array of files.
global $CFG;
if (empty($CFG->unzip)) {
// Use built-in php-based zip function
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$strstatus = get_string("status");
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=\"640\">";
echo "<tr><th class=\"header\" align=\"left\">{$strname}</th>";
echo "<th class=\"header\" align=\"right\">{$strsize}</th>";
echo "<th class=\"header\" align=\"right\">{$strmodified}</th>";
echo "<th class=\"header\" align=\"right\">{$strstatus}</th></tr>";
foreach ($list as $item) {
echo "<tr>";
$item['filename'] = str_replace(cleardoubleslashes($removepath) . '/', "", $item['filename']);
print_cell("left", $item['filename']);
if (!$item['folder']) {
print_cell("right", display_size($item['size']));
} else {
echo "<td> </td>";
}
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
print_cell("right", $filedate);
print_cell("right", $item['status']);
echo "</tr>";
}
echo "</table>";
} else {
// Use external zip program
print_simple_box_start("center");
echo "<pre>";
foreach ($list as $item) {
echo str_replace(cleardoubleslashes($removepath . '/'), '', $item) . '<br />';
}
echo "</pre>";
print_simple_box_end();
}
}
示例4: displaydir
function displaydir($wdir)
{
// $wdir == / or /a or /a/b/c/d etc
global $basedir;
global $id;
global $USER, $CFG;
global $choose;
$fullpath = $basedir . $wdir;
$dirlist = array();
$directory = opendir($fullpath);
// Find all files
while (false !== ($file = readdir($directory))) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir($fullpath . "/" . $file)) {
$dirlist[] = $file;
} else {
$filelist[] = $file;
}
}
closedir($directory);
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$straction = get_string("action");
$strmakeafolder = get_string("makeafolder");
$struploadafile = get_string("uploadafile");
$strselectall = get_string("selectall");
$strselectnone = get_string("deselectall");
$strwithchosenfiles = get_string("withchosenfiles");
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strrestore = get_string("restore");
$strchoose = get_string("choose");
$strfolder = get_string("folder");
$strfile = get_string("file");
echo "<form action=\"index.php\" method=\"post\" id=\"dirform\">";
echo "<div>";
echo '<input type="hidden" name="choose" value="' . $choose . '" />';
// echo "<hr align=\"center\" noshade=\"noshade\" size=\"1\" />";
echo "<hr/>";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\" class=\"files\">";
echo "<tr>";
echo "<th class=\"header\" scope=\"col\"></th>";
echo "<th class=\"header name\" scope=\"col\">{$strname}</th>";
echo "<th class=\"header size\" scope=\"col\">{$strsize}</th>";
echo "<th class=\"header date\" scope=\"col\">{$strmodified}</th>";
echo "<th class=\"header commands\" scope=\"col\">{$straction}</th>";
echo "</tr>\n";
if ($wdir != "/") {
$dirlist[] = '..';
}
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
echo "<tr class=\"folder\">";
if ($dir == '..') {
$fileurl = rawurlencode(dirname($wdir));
print_cell();
// alt attribute intentionally empty to prevent repetition in screen reader
print_cell('left', '<a href="index.php?id=' . $id . '&wdir=' . $fileurl . '&choose=' . $choose . '"><img src="' . $CFG->pixpath . '/f/parent.gif" class="icon" alt="" /> ' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
} else {
$count++;
$filename = $fullpath . "/" . $dir;
$fileurl = rawurlencode($wdir . "/" . $dir);
$filesafe = rawurlencode($dir);
$filesize = display_size(get_directory_size("{$fullpath}/{$dir}"));
$filedate = userdate(filemtime($filename), get_string("strftimedatetime"));
if ($wdir . $dir === '/moddata') {
print_cell();
} else {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" />", 'checkbox');
}
print_cell("left", "<a href=\"index.php?id={$id}&wdir={$fileurl}&choose={$choose}\"><img src=\"{$CFG->pixpath}/f/folder.gif\" class=\"icon\" alt=\"{$strfolder}\" /> " . htmlspecialchars($dir) . "</a>", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($wdir . $dir === '/moddata') {
print_cell();
} else {
print_cell("right", "<a href=\"index.php?id={$id}&wdir={$wdir}&file={$filesafe}&action=rename&choose={$choose}\">{$strrename}</a>", 'commands');
}
}
echo "</tr>";
}
}
if (!empty($filelist)) {
asort($filelist);
foreach ($filelist as $file) {
$icon = mimeinfo("icon", $file);
//.........这里部分代码省略.........
示例5: print_cell
if ($verbose) {
print_cell("<pre>\n" . urldecode($row['comments']) . "\n\t</pre>");
print_cell(gather_enum_multi_print("sdram", 4, $row));
print_cell(gather_enum_multi_print("flash", 4, $row));
print_cell(gather_enum_multi_print("zbt", 16, $row));
print_cell(gather_enum_multi_print("xlxtyp", 4, $row));
print_cell(gather_enum_multi_print("xlxspd", 4, $row));
print_cell(gather_enum_multi_print("xlxtmp", 4, $row));
print_cell(gather_enum_multi_print("xlxgrd", 4, $row));
print_cell($row['cputyp']);
print_cell($row['cpuspd']);
print_cell($row['cpmspd']);
print_cell($row['busspd']);
print_cell($row['hstype']);
print_cell($row['hschin']);
print_cell($row['hschout']);
}
echo "</tr>\n";
}
?>
</table>
<p></p>
<table width="100%">
<tr>
<td align=center><?php
printf("<a href=\"%s?submit=Browse&offset=%d&verbose=%d%s\">%s Listing</a>\n", $PHP_SELF, $offset, $verbose ? 0 : 1, $serno != '' ? "&serno={$serno}" : '', $verbose ? "Terse" : "Verbose");
?>
</td>
<td align=center><a href="index.php">Back to Start</a></td>
</tr>
</table>
示例6: displaydir
function displaydir($wdir)
{
// $wdir == / or /a or /a/b/c/d etc
global $basedir;
global $usecheckboxes;
global $id;
global $USER, $CFG, $isteacher, $isstudent;
$fullpath = $basedir . $wdir;
$directory = opendir($fullpath);
// Find all files
while ($file = readdir($directory)) {
if ($file == "." || $file == ".." || $file == "tmp") {
continue;
}
if (is_dir($fullpath . "/" . $file)) {
$dirlist[] = $file;
}
}
$test = str_replace("/", "", $wdir);
if (empty($test)) {
$wdir = "";
}
$images = netpublish_get_images($id, $wdir);
/*print "<pre>";
print_r($images);
print "</pre>";
exit;*/
$filelist = array();
if (!empty($images)) {
$i = 0;
foreach ($images as $img) {
$filelist[$i]['id'] = $img->id;
$filelist[$i]['course'] = $img->course;
$filelist[$i]['name'] = $img->name;
$filelist[$i]['mime'] = $img->mimetype;
$filelist[$i]['size'] = $img->size;
$filelist[$i]['dir'] = $img->dir;
$filelist[$i]['filedate'] = userdate($img->timemodified, "%d %b %Y, %I:%M %p");
$filelist[$i]['width'] = $img->width;
$filelist[$i]['height'] = $img->height;
$filelist[$i]['owner'] = $img->owner;
$i++;
}
}
//closedir($directory);
$strfile = get_string("file");
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$straction = get_string("action");
$strmakeafolder = get_string("makeafolder");
$struploadafile = get_string("uploadafile");
$strwithchosenfiles = get_string("withchosenfiles");
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strchoose = get_string("choose");
echo "<form action=\"imagebank.php\" method=\"post\" name=\"dirform\">\n";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\" width=\"100%\">\n";
if (empty($wdir)) {
$wdir = "";
} else {
$bdir = str_replace("/" . basename($wdir), "", $wdir);
if ($bdir == "/") {
$bdir = "";
}
print "<tr>\n<td colspan=\"5\">";
print "<a href=\"imagebank.php?id={$id}&wdir={$bdir}&usecheckboxes={$usecheckboxes}\" onclick=\"return reset_value();\">";
print "<img src=\"{$CFG->wwwroot}/lib/editor/images/folderup.gif\" height=\"14\" width=\"24\" border=\"0\" alt=\"Move up\" />";
print "</a></td>\n</tr>\n";
}
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
$count++;
$filename = $fullpath . "/" . $dir;
$fileurl = rawurlencode($wdir . "/" . $dir);
$filesafe = rawurlencode($dir);
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
echo "<tr>";
if ($usecheckboxes && $isteacher) {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" onclick=\"return set_rename('{$filesafe}');\" />");
} else {
print_cell("left");
}
print_cell("left", "<a href=\"imagebank.php?id={$id}&wdir={$fileurl}\" onclick=\"return reset_value();\"><img src=\"{$CFG->pixpath}/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"folder\" /></a> <a href=\"imagebank.php?id={$id}&wdir={$fileurl}&usecheckboxes={$usecheckboxes}\" onclick=\"return reset_value();\">" . htmlspecialchars($dir) . "</a>");
print_cell("right", " ");
print_cell("right", $filedate);
echo "</tr>";
}
}
if (!empty($filelist)) {
foreach ($filelist as $file) {
$icon = mimeinfo("icon", $file['name']);
//.........这里部分代码省略.........
示例7: displaydir
function displaydir($file_info)
{
global $CFG;
$children = $file_info->get_children();
$parent_info = $file_info->get_parent();
$strname = get_string('name');
$strsize = get_string('size');
$strmodified = get_string('modified');
$strfolder = get_string('folder');
$strfile = get_string('file');
$strdownload = get_string('download');
$strdelete = get_string('delete');
$straction = get_string('action');
$path = array();
$params = $file_info->get_params_rawencoded();
$params = implode('&', $params);
$path[] = $file_info->get_visible_name();
$level = $parent_info;
while ($level) {
$params = $level->get_params_rawencoded();
$params = implode('&', $params);
$path[] = '<a href="index.php?' . $params . '">' . $level->get_visible_name() . '</a>';
$level = $level->get_parent();
}
$path = array_reverse($path);
$path = implode(' / ', $path);
echo $path . ' /';
echo "<div>";
echo "<hr/>";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"740\" class=\"files\">";
echo "<tr>";
echo "<th class=\"header\" scope=\"col\"></th>";
echo "<th class=\"header name\" scope=\"col\">{$strname}</th>";
echo "<th class=\"header size\" scope=\"col\">{$strsize}</th>";
echo "<th class=\"header date\" scope=\"col\">{$strmodified}</th>";
echo "<th class=\"header commands\" scope=\"col\">{$straction}</th>";
echo "</tr>\n";
$parentwritable = $file_info->is_writable();
if ($parent_info) {
$params = $parent_info->get_params_rawencoded();
$params = implode('&', $params);
echo "<tr class=\"folder\">";
print_cell();
print_cell('left', '<a href="index.php?' . $params . '"><img src="' . $CFG->pixpath . '/f/parent.gif" class="icon" alt="" /> ' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
echo "</tr>";
}
if ($children) {
foreach ($children as $child_info) {
$filename = $child_info->get_visible_name();
$filesize = $child_info->get_filesize();
$filesize = $filesize ? display_size($filesize) : '';
$filedate = $child_info->get_timemodified();
$filedate = $filedate ? userdate($filedate) : '';
$mimetype = $child_info->get_mimetype();
$params = $child_info->get_params_rawencoded();
$params = implode('&', $params);
if ($child_info->is_directory()) {
echo "<tr class=\"folder\">";
print_cell();
print_cell("left", "<a href=\"index.php?{$params}\"><img src=\"{$CFG->pixpath}/f/folder.gif\" class=\"icon\" alt=\"{$strfolder}\" /> " . s($filename) . "</a>", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($parentwritable) {
print_cell("right", "<a href=\"index.php?{$params}&sesskey=" . sesskey() . "&delete=1\"><img src=\"{$CFG->pixpath}/t/delete.gif\" class=\"iconsmall\" alt=\"{$strdelete}\" /></a>", 'command');
} else {
print_cell();
}
echo "</tr>";
} else {
$icon = mimeinfo_from_type("icon", $mimetype);
if ($downloadurl = $child_info->get_url(true)) {
$downloadurl = " <a href=\"{$downloadurl}\" title=\"" . get_string('downloadfile') . "\"><img src=\"{$CFG->pixpath}/t/down.gif\" class=\"iconsmall\" alt=\"{$strdownload}\" /></a>";
} else {
$downloadurl = '';
}
if ($viewurl = $child_info->get_url()) {
$viewurl = " " . link_to_popup_window($viewurl, "display", "<img src=\"{$CFG->pixpath}/t/preview.gif\" class=\"iconsmall\" alt=\"{$strfile}\" /> ", 480, 640, get_string('viewfileinpopup'), null, true);
} else {
$viewurl = '';
}
echo "<tr class=\"file\">";
print_cell();
print_cell("left", "<img src=\"{$CFG->pixpath}/f/{$icon}\" class=\"icon\" alt=\"{$strfile}\" /> " . s($filename) . $downloadurl . $viewurl, 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($parentwritable) {
print_cell("right", "<a href=\"index.php?{$params}&sesskey=" . sesskey() . "&delete=1\"><img src=\"{$CFG->pixpath}/t/delete.gif\" class=\"iconsmall\" alt=\"{$strdelete}\" /></a>", 'command');
} else {
print_cell();
}
echo "</tr>";
}
}
}
echo "</table>";
echo "</div>";
echo "<hr/>";
//.........这里部分代码省略.........
示例8: displaydir
//.........这里部分代码省略.........
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strchoose = get_string("choose");
$strbrowserepo = get_string('browserepository', 'repository');
$strdownloadlocal = get_string('downloadlocally', 'repository');
echo "<form action=\"{$CFG->wwwroot}/file/repository/alfresco/coursefiles.php\" method=\"post\" name=\"dirform\">\n";
echo '<input type="hidden" name="oid" value="' . $oid . '" />' . "\n";
echo '<input type="hidden" name="shared" value="' . $shared . '" />' . "\n";
echo '<input type="hidden" name="userid" value="' . $userid . '" />' . "\n";
echo '<input type="hidden" name="uuid" value="' . $uuid . '" />' . "\n";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
if (!empty($parentdir->uuid)) {
print "<tr>\n<td colspan=\"5\">";
print '<a href=' . $CFG->wwwroot . '/file/repository/alfresco/coursefiles.php?id=' . $id . '&uuid=' . $parentdir->uuid . '&shared=' . $shared . '&oid=' . $oid . '&userid=' . $userid . '&wdir=/&usecheckboxes=' . $usecheckboxes . '" ' . 'onclick="return reset_value();">';
print "<img src=\"{$CFG->wwwroot}/lib/editor/htmlarea/images/folderup.gif\" height=\"14\" width=\"24\" border=\"0\" alt=\"" . get_string('parentfolder') . "\" />";
print "</a></td>\n</tr>\n";
}
$count = 0;
if (!empty($dirlist)) {
foreach ($dirlist as $dir) {
if (empty($dir->uuid)) {
continue;
}
$count++;
if ($dir->title == '..' || $dir->title == $strbrowserepo) {
if (!empty($dir->url)) {
if ($usecheckboxes) {
print_cell();
}
if (!empty($search)) {
print_cell('left', '<a href="' . $dir->url . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . $strbrowserepo . '" /></a> <a href="' . $dir->url . '">' . $strbrowserepo . '</a>', 'name');
} else {
print_cell('left', '<a href="' . $dir->url . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . get_string('parentfolder') . '" /></a> <a href="' . $dir->url . '">' . get_string('parentfolder') . '</a>', 'name');
}
print_cell();
print_cell();
}
} else {
$pdir = urlencode($dir->title);
$fileurl = $dir->uuid;
//$filename = $fullpath."/".$dir;
//$fileurl = $wdir."/".$dir;
$filedate = userdate($dir->modified, "%d %b %Y, %I:%M %p");
echo "<tr>";
if ($usecheckboxes) {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" onclick=\"return set_rename('{$dir->title}');\" />");
}
$astr = $CFG->wwwroot . '/file/repository/alfresco/coursefiles.php?id=' . $id . '&oid=' . $oid . '&uuid=' . $fileurl . '&shared=' . $shared . '&userid=' . $userid . '&wdir=/&usecheckboxes=' . $usecheckboxes . '" ' . 'onclick=" return reset_value();"';
print_cell('left', '<a href="' . $astr . '><img src="' . $CFG->pixpath . '/f/folder.gif" class="icon" ' . 'alt=""' . get_string('folder') . '" /></a> <a href="' . $astr . '>' . htmlspecialchars($dir->title) . '</a>');
print_cell("right", " ");
print_cell("right", $filedate);
}
echo "</tr>";
}
}
if (!empty($filelist)) {
foreach ($filelist as $file) {
$icon = mimeinfo('icon', $file->title);
$imgtype = mimeinfo('type', $file->title);
$count++;
示例9: mimeinfo
} else {
$icon = mimeinfo("icon", $file);
echo "<img src=\"{$CFG->pixpath}/f/{$icon}\" height=\"16\" width=\"16\" alt=\"\" /> {$file}<br />";
}
}
}
function print_cell($alignment = 'center', $text = ' ', $class = '')
{
if ($class) {
$class = ' class="' . $class . '"';
}
echo '<td align="' . $alignment . '" nowrap="nowrap"' . $class . '>' . $text . '</td>';
}
function displaydir($wdir)
{
// $wdir == / or /a or /a/b/c/d etc
global $basedir;
global $podcast;
global $id;
global $USER, $CFG;
global $choose;
$fullpath = $basedir . $wdir;
$dirlist = array();
$directory = opendir($fullpath);
// Find all files
while (false !== ($file = readdir($directory))) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir($fullpath . "/" . $file)) {
$dirlist[] = $file;
} else {
$filelist[] = $file;
}
}
closedir($directory);
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$straction = get_string("action");
$strmakeafolder = get_string("makeafolder");
$struploadafile = get_string("uploadafile");
$strselectall = get_string("selectall");
$strselectnone = get_string("deselectall");
$strwithchosenfiles = get_string("withchosenfiles");
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strrestore = get_string("restore");
$strchoose = get_string("choose");
echo "<form action=\"index.php\" method=\"post\" name=\"dirform\">";
echo '<input type="hidden" name="choose" value="' . $choose . '" />';
echo "<hr width=\"640\" align=\"center\" noshade=\"noshade\" size=\"1\" />";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\" class=\"files\">";
echo "<tr>";
echo "<th width=\"5\"></th>";
echo "<th align=\"left\" class=\"header name\">{$strname}</th>";
echo "<th align=\"right\" class=\"header size\">{$strsize}</th>";
echo "<th align=\"right\" class=\"header date\">{$strmodified}</th>";
echo "<th align=\"right\" class=\"header commands\">{$straction}</th>";
echo "</tr>\n";
if ($wdir != "/") {
$dirlist[] = '..';
}
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
echo "<tr class=\"folder\">";
if ($dir == '..') {
$fileurl = rawurlencode(dirname($wdir));
print_cell();
print_cell('left', '<a href="index.php?id=' . $id . '&pod=' . $podcast . '&wdir=' . $fileurl . '&choose=' . $choose . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . get_string('parentfolder') . '" /></a> <a href="index.php?id=' . $id . '&pod=' . $podcast . '&wdir=' . $fileurl . '&choose=' . $choose . '">' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
} else {
$count++;
$filename = $fullpath . "/" . $dir;
$fileurl = rawurlencode($wdir . "/" . $dir);
$filesafe = rawurlencode($dir);
$filesize = display_size(get_directory_size("{$fullpath}/{$dir}"));
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" />", 'checkbox');
print_cell("left", "<a href=\"index.php?id={$id}&pod={$podcast}&wdir={$fileurl}&choose={$choose}\"><img src=\"{$CFG->pixpath}/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id={$id}&pod={$podcast}&wdir={$fileurl}&choose={$choose}\">" . htmlspecialchars($dir) . "</a>", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
print_cell("right", "<a href=\"index.php?id={$id}&pod={$podcast}&wdir={$wdir}&file={$filesafe}&action=rename&choose={$choose}\">{$strrename}</a>", 'commands');
}
echo "</tr>";
}
}
if (!empty($filelist)) {
asort($filelist);
foreach ($filelist as $file) {
//.........这里部分代码省略.........
示例10: mysql_query
?>
<table width="100%" border=1 cellpadding=10>
<tr valign=top>
<th>logno / edit</th>
<th>date</th>
<th>who</th>
<th width="70%">details</th>
</tr>
<?php
$r = mysql_query("select * from log where serno={$serno} order by logno limit {$offset},{$limit}");
while ($row = mysql_fetch_array($r)) {
echo "<tr>\n";
print_cell("<a href=\"edlog.php?serno={$row['serno']}&logno={$row['logno']}\">{$row['logno']}</a>");
print_cell($row['date']);
print_cell($row['who']);
print_cell("<pre>" . urldecode($row['details']) . "</pre>");
echo "</tr>\n";
}
mysql_free_result($r);
?>
</table>
<hr></hr>
<p></p>
<table width="100%">
<tr>
<td align=center>
<a href="newlog.php?serno=<?php
echo "{$serno}";
?>
">Add to Log</a>
</td>
示例11: print_header
print_header("Heutige Aktivität");
print_cell("Brennerlaufzeit", $changes[SensorBetriebszeit]);
print_cell("Brennerstarts", $changes[SensorBrennerstarts]);
print_cell("Heizungs-Brennerlaufzeit", $changes[SensorHeizZeit]);
print_cell("Warmwasserbereitungszeit", $changes[SensorWarmwasserbereitungsZeit]);
print_cell("Warmwasserbereitungen", $changes[SensorWarmwasserBereitungen]);
?>
</table>
</td>
<td width=20></td>
<td width=390>
<?php
print_header("Betriebsstatus");
print_cell("Brennerlaufzeit", $sensors[SensorBetriebszeit]);
print_cell("Brennerstarts", $sensors[SensorBrennerstarts]);
print_cell("Systemdruck", $sensors[SensorSystemdruck]);
print_cell("Servicecode", $sensors[SensorServiceCode]);
print_cell("Fehlercode", $sensors[SensorFehlerCode]);
# TODO: Fehler
?>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>
示例12: displaydir
function displaydir($file_info)
{
global $CFG, $OUTPUT;
$children = $file_info->get_children();
$parent_info = $file_info->get_parent();
$strname = get_string('name');
$strsize = get_string('size');
$strmodified = get_string('modified');
$strfolder = get_string('folder');
$strfile = get_string('file');
$strdownload = get_string('download');
$strdelete = get_string('delete');
$straction = get_string('action');
$path = array();
$params = $file_info->get_params_rawencoded();
$params = implode('&', $params);
$path[] = $file_info->get_visible_name();
$level = $parent_info;
while ($level) {
$params = $level->get_params_rawencoded();
$params = implode('&', $params);
$path[] = '<a href="index.php?' . $params . '">' . $level->get_visible_name() . '</a>';
$level = $level->get_parent();
}
$path = array_reverse($path);
$path = implode(' / ', $path);
echo $path . ' /';
echo "<div>";
echo "<hr/>";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"740\" class=\"files\">";
echo "<tr>";
echo "<th class=\"header\" scope=\"col\"></th>";
echo "<th class=\"header name\" scope=\"col\">{$strname}</th>";
echo "<th class=\"header size\" scope=\"col\">{$strsize}</th>";
echo "<th class=\"header date\" scope=\"col\">{$strmodified}</th>";
echo "<th class=\"header commands\" scope=\"col\">{$straction}</th>";
echo "</tr>\n";
$parentwritable = $file_info->is_writable();
if ($parent_info) {
$params = $parent_info->get_params_rawencoded();
$params = implode('&', $params);
echo "<tr class=\"folder\">";
print_cell();
print_cell('left', '<a href="index.php?' . $params . '"><img src="' . $OUTPUT->old_icon_url('f/parent') . '" class="icon" alt="" /> ' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
echo "</tr>";
}
if ($children) {
foreach ($children as $child_info) {
$filename = $child_info->get_visible_name();
$filesize = $child_info->get_filesize();
$filesize = $filesize ? display_size($filesize) : '';
$filedate = $child_info->get_timemodified();
$filedate = $filedate ? userdate($filedate) : '';
$mimetype = $child_info->get_mimetype();
$params = $child_info->get_params_rawencoded();
$params = implode('&', $params);
if ($child_info->is_directory()) {
echo "<tr class=\"folder\">";
print_cell();
print_cell("left", "<a href=\"index.php?{$params}\"><img src=\"" . $OUTPUT->old_icon_url('f/folder') . "\" class=\"icon\" alt=\"{$strfolder}\" /> " . s($filename) . "</a>", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($parentwritable) {
print_cell("right", "<a href=\"index.php?{$params}&sesskey=" . sesskey() . "&delete=1\"><img src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"{$strdelete}\" /></a>", 'command');
} else {
print_cell();
}
echo "</tr>";
} else {
if ($downloadurl = $child_info->get_url(true)) {
$downloadurl = " <a href=\"{$downloadurl}\" title=\"" . get_string('downloadfile') . "\"><img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" class=\"iconsmall\" alt=\"{$strdownload}\" /></a>";
} else {
$downloadurl = '';
}
if ($viewurl = $child_info->get_url()) {
$link = html_link::make($viewurl, "display", "<img src=\"" . $OUTPUT->old_icon_url('t/preview') . "\" class=\"iconsmall\" alt=\"{$strfile}\" /> ");
$link->add_action(new popup_action('click', $link->url, 'display', array('height' => 480, 'width' => 640)));
$viewurl = " " . $OUTPUT->link($link);
} else {
$viewurl = '';
}
echo "<tr class=\"file\">";
print_cell();
print_cell("left", "<img src=\"" . $OUTPUT->old_icon_url(file_mimetype_icon($mimetype)) . "\" class=\"icon\" alt=\"{$strfile}\" /> " . s($filename) . $downloadurl . $viewurl, 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($parentwritable) {
print_cell("right", "<a href=\"index.php?{$params}&sesskey=" . sesskey() . "&delete=1\"><img src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"{$strdelete}\" /></a>", 'command');
} else {
print_cell();
}
echo "</tr>";
}
}
}
echo "</table>";
echo "</div>";
//.........这里部分代码省略.........
示例13: displaydir
//.........这里部分代码省略.........
//looks for search.html file and gets text alfrescosearch from repository_alfresco lang file which I guess we use too...
// now hmmm, so where does search.html go? or in our case, categoryfilter.html, I guess repository/alfresco
print_heading(helpbutton('categoryfilter', get_string('alfrescocategoryfilter', 'block_repository'), 'block_repository', true, false, null, true) . get_string('categoryfilter', 'block_repository') . ':', 'center', '3');
$treemenu->printMenu();
echo '<br />';
print_simple_box_end();
}
echo '</form>';
echo '<center>';
print_single_button('index.php', array('id' => $id, 'shared' => $shared, 'oid' => $oid, 'userid' => $userid, 'uuid' => $uuid), get_string('showall'), 'get');
echo '</center>';
if ($canedit) {
echo "<form action=\"index.php\" method=\"post\" name=\"dirform\" id=\"dirform\">";
echo '<input type="hidden" name="choose" value="' . $choose . '" />';
}
echo "<hr width=\"640\" align=\"center\" noshade=\"noshade\" size=\"1\" />";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\" class=\"files\">";
echo "<tr>";
echo "<th width=\"5\"></th>";
echo "<th align=\"left\" class=\"header name\">{$strname}</th>";
echo "<th align=\"right\" class=\"header size\">{$strsize}</th>";
echo "<th align=\"right\" class=\"header date\">{$strmodified}</th>";
echo "<th align=\"right\" class=\"header commands\">{$straction}</th>";
echo "</tr>\n";
$count = 0;
if (!empty($dirlist)) {
foreach ($dirlist as $dir) {
if (empty($dir->title)) {
continue;
}
echo "<tr class=\"folder\">";
if ($dir->title == '..' || $dir->title == $strbrowserepo) {
if (!empty($dir->url)) {
print_cell();
if (!empty($search)) {
print_cell('left', '<a href="' . $dir->url . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . $strbrowserepo . '" /></a> <a href="' . $dir->url . '">' . $strbrowserepo . '</a>', 'name');
} else {
print_cell('left', '<a href="' . $dir->url . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . get_string('parentfolder') . '" /></a> <a href="' . $dir->url . '">' . get_string('parentfolder') . '</a>', 'name');
}
print_cell();
print_cell();
print_cell();
} else {
$pdir = urlencode($dir->title);
$fileurl = $dir->uuid;
print_cell();
print_cell('left', '<a href="index.php?id=' . $id . '&shared=' . $shared . '&oid=' . $oid . '&userid=' . $userid . '&wdir=' . $pdir . '&uuid=' . $fileurl . '&choose=' . $choose . '"><img src="' . $CFG->pixpath . '/f/parent.gif" height="16" width="16" alt="' . get_string('parentfolder') . '" /></a> <a href="index.php?id=' . $id . '&shared=' . $shared . '&oid=' . $oid . '&userid=' . $userid . '&wdir=' . $pdir . '&uuid=' . $fileurl . '&choose=' . $choose . '">' . get_string('parentfolder') . '</a>', 'name');
print_cell();
print_cell();
print_cell();
}
} else {
$count++;
$filename = $dir->title;
$pdir = urlencode($filename);
$fileurl = $dir->uuid;
$filesafe = rawurlencode($dir->title);
$filesize = '-';
$filedate = !empty($dir->modified) ? userdate($dir->modified, "%d %b %Y, %I:%M %p") : '-';
if ($canedit) {
print_cell("center", "<input type=\"checkbox\" name=\"file{$count}\" value=\"{$fileurl}\" />", 'checkbox');
} else {
print_cell();
}
print_cell("left", "<a href=\"index.php?id={$id}&shared={$shared}&oid={$oid}&userid={$userid}&wdir={$pdir}&uuid={$fileurl}&choose={$choose}\"><img src=\"{$CFG->pixpath}/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id={$id}&shared={$shared}&oid={$oid}&userid={$userid}&wdir={$pdir}&uuid={$fileurl}&choose={$choose}\">" . htmlspecialchars($dir->title) . "</a>", 'name');
print_cell("right", $filesize, 'size');