Example #1
0
		echo "<td align='left' class='filemantext'>";
		echo "<a href='".$urlpath."?action=delete&workpath=".$dirpath."&file=".$dirpath."/".$dirlist[$i]."'>$deleteimg</a>";        
		echo "<a href='".$urlpath."?action=rename&workpath=".$dirpath."&file=".$dirpath."/".$dirlist[$i]."'>$renameimg</a> ";
		//echo "<a href='".$urlpath."?rootpath=".$dirpath."/".$dirlist[$i]."'>ChDr</a> ";
		echo "</td></tr>";
	}
//Get file info and details
	for ($i=0;$i<Count($filelist);$i++) {
		echo "<tr>";
		$file = $dirpath."/".$filelist[$i];
		$icon = get_icon($dirpath."/".$filelist[$i]);
		echo "<td width='4%' align='center'><img src=$pathtoimages$icon></td>";
		echo "<td class='filemantext' style='white-space:nowrap' onmouseover='this.style.cursor=\"hand\";'><a href='".$rootURL."/$filelist[$i]'>".$filelist[$i]."</a></td>";
		echo "<td align='left' class='filemantext'>".myfilesize($file)."</td>";
		echo "<td align='left' class='filemantext'>".$mimetype->getType($file)."</td>";
		echo "<td align='left' class='filemantext'>".lastaccess($file, "E1")."</td>";
	    echo "<td align='center' class='filemantext' >".get_perms($file)."</td>";
		echo "<td align='left' class='filemantext' >";
		if (is_viewable_file($file)) 
			echo "<a href='".$rootURL."/".$filelist[$i]."' target='_blank' >$viewimg</a> ";
		if (is_editable_file($dirpath."/".$filelist[$i])) 
			echo "<a href='".$urlpath."?action=edit&workpath=".$dirpath."&file=".$filelist[$i]."'>$editimg</a> ";
        	echo "<a href='".$urlpath."?action=delete&workpath=".$dirpath."&file=".$dirpath."/".$filelist[$i]."'>$deleteimg</a> ";
   			echo "<a href='".$urlpath."?action=rename&workpath=".$dirpath."&file=".$dirpath."/".$filelist[$i]."'>$renameimg</a> ";
			echo "<a href='".$urlpath."?action=download&file=".$dirpath."/".$filelist[$i]."'>$downimg</a> ";
			echo "</tr>";
	}
			echo "<tr>";
			$diskfree = freespace($dirpath);
            echo "<td class='barbottom' align='left' colspan =3>".$dircount = sizeof($dirlist)." Directories /".$filecount =sizeof($filelist)." files</td>";
			echo "<td class='barbottom' align='left' colspan =4>"._AM_FREEDISKSPACE."</b> ".format_size($diskfree)."</td>";
Example #2
0
 function editform()
 {
     global $xoopsModule, $wfsConfig, $xoopsConfig;
     include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $mimetype = new mimetype();
     xoops_cp_header();
     $article = new WfsArticle($this->articleid);
     $atitle = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $this->articleid . "'>" . $article->title . "</a>";
     $stform = new XoopsThemeForm(_AM_FILESTATS, "op", xoops_getenv('PHP_SELF'));
     echo "<div><h3>" . _AM_FILEATTACHED . "</h3></div>";
     $stform->addElement(new XoopsFormLabel(_AM_FILESTAT, $atitle));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEID, "No: " . $this->fileid));
     $workdir = XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'];
     if (file_exists(realpath($workdir . "/" . $this->filerealname))) {
         $error = 'File <b>' . $this->filerealname . '</b> exists on server.';
     } else {
         $error = 'ERROR, File <b>' . $this->filerealname . '</b> please check!';
     }
     $stform->addElement(new XoopsFormLabel(_WFS_ERRORCHECK, $error));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEREALNAME, $this->getFileRealName("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADNAME, $this->getDownloadname("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_MINETYPE, $this->getMinetype("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_EXT, "." . $this->getExt("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEPERMISSION, get_perms(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $this->getFileRealName("F"))));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADED, $this->getCounter("F") . " times"));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADSIZE, PrettySize(filesize(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $this->getFileRealName("F")))));
     $stform->addElement(new XoopsFormLabel(_WFS_LASTACCESS, lastaccess($workdir . "/" . $this->filerealname, 'E1')));
     $stform->addElement(new XoopsFormLabel(_WFS_LASTUPDATED, formatTimestamp($this->date, $wfsConfig['timestamp'])));
     //$stform->addElement(new XoopsFormLabel(_WFS_FILEREALNAME, $this->getFileRealName("F")));
     $stform->display();
     clearstatcache();
     $sform = new XoopsThemeForm(_AM_MODIFYFILE, "op", xoops_getenv('PHP_SELF'));
     echo "<div><h3>" . _AM_EDITFILE . "</h3></div>";
     //global $xoopsConfig, $xoopsDB, $HTTP_POST_VARS, $myts, $wfsConfig, $myts;
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $sform = new XoopsThemeForm(_AM_MENUS, "op", xoops_getenv('PHP_SELF'));
     $sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'groupid', true, getGroupIda($this->groupid), 5, true));
     $sform->addElement(new XoopsFormLabel(_WFS_FILEID, "No: " . $this->fileid));
     $sform->addElement(new XoopsFormText(_WFS_ARTICLEID, 'articleid', 5, 5, $this->articleid));
     $sform->addElement(new XoopsFormText(_WFS_FILEREALNAME, 'filerealname', 40, 40, $this->getFileRealName("F")));
     $sform->addElement(new XoopsFormText(_WFS_DOWNLOADNAME, 'downloadname', 40, 40, $this->getDownloadname("F")));
     $sform->addElement(new XoopsFormText(_WFS_FILESHOWNAME, 'fileshowname', 40, 80, $this->getFileShowName("F")));
     $sform->addElement(new XoopsFormDhtmlTextArea(_WFS_FILEDESCRIPT, 'filedescript', $this->getFiledescript("F"), 10, 60));
     $sform->addElement(new XoopsFormTextArea(_WFS_FILETEXT, 'filetext', $this->getFileText("F")));
     $sform->addElement(new XoopsFormText(_WFS_EXT, 'ext', 30, 80, $this->getExt("F")));
     $sform->addElement(new XoopsFormText(_WFS_MINETYPE, 'minetype', 40, 80, $this->getMinetype("F")));
     $sform->addElement(new XoopsFormLabel(_WFS_UPDATEDATE, formatTimestamp($this->date, $wfsConfig['timestamp'])));
     $sform->addElement(new XoopsFormHidden('fileid', $this->fileid));
     //echo $this->fileid;
     //echo "<input type='hidden' name='fileid' value='$this->fileid' />\n";
     ///$sform->addElement(new XoopsFormHidden('fileid', ".$this->fileid."));
     $button_tray = new XoopsFormElementTray('', '');
     //$hidden = new XoopsFormHidden('fileid', $this->fileid);
     $hidden = new XoopsFormHidden('op', 'filesave');
     $button_tray->addElement($hidden);
     $button_tray->addElement(new XoopsFormButton('', 'post', _AM_SAVECHANGE, 'submit'));
     $sform->addElement($button_tray);
     $sform->display();
     unset($hidden);
 }