mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-31 05:11:27 +00:00 
			
		
		
		
	file in drop folder can be shown in menu as item
This commit is contained in:
		
							parent
							
								
									a7c24043d4
								
							
						
					
					
						commit
						05671428e1
					
				|  | @ -180,6 +180,8 @@ class Settings { /* {{{ */ | |||
| 	var $_enableClipboard = true; | ||||
| 	// enable/disable list of tasks in main menu
 | ||||
| 	var $_enableMenuTasks = true; | ||||
| 	// enable/disable list of files in drop folder
 | ||||
| 	var $_enableDropFolderList = false; | ||||
| 	// enable/disable display of the session list
 | ||||
| 	var $_enableSessionList = false; | ||||
| 	// enable/disable display of the drop zone for file upload
 | ||||
|  | @ -419,6 +421,7 @@ class Settings { /* {{{ */ | |||
| 		$this->_enableSessionList = Settings::boolVal($tab["enableSessionList"]); | ||||
| 		$this->_enableClipboard = Settings::boolVal($tab["enableClipboard"]); | ||||
| 		$this->_enableMenuTasks = Settings::boolVal($tab["enableMenuTasks"]); | ||||
| 		$this->_enableDropFolderList = Settings::boolVal($tab["enableDropFolderList"]); | ||||
| 		$this->_enableDropUpload = Settings::boolVal($tab["enableDropUpload"]); | ||||
| 		$this->_enableMultiUpload = Settings::boolVal($tab["enableMultiUpload"]); | ||||
| 		$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]); | ||||
|  | @ -731,6 +734,7 @@ class Settings { /* {{{ */ | |||
| 		$this->setXMLAttributValue($node, "enableSessionList", $this->_enableSessionList); | ||||
| 		$this->setXMLAttributValue($node, "enableClipboard", $this->_enableClipboard); | ||||
| 		$this->setXMLAttributValue($node, "enableMenuTasks", $this->_enableMenuTasks); | ||||
| 		$this->setXMLAttributValue($node, "enableDropFolderList", $this->_enableDropFolderList); | ||||
| 		$this->setXMLAttributValue($node, "enableDropUpload", $this->_enableDropUpload); | ||||
| 		$this->setXMLAttributValue($node, "enableMultiUpload", $this->_enableMultiUpload); | ||||
|     $this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree); | ||||
|  |  | |||
|  | @ -105,6 +105,8 @@ class UI extends UI_Default { | |||
| 			$view->setParam('enablelanguageselector', $settings->_enableLanguageSelector); | ||||
| 			$view->setParam('enableclipboard', $settings->_enableClipboard); | ||||
| 			$view->setParam('enablemenutasks', $settings->_enableMenuTasks); | ||||
| 			$view->setParam('enabledropfolderlist', $settings->_enableDropFolderList); | ||||
| 			$view->setParam('dropfolderdir', $settings->_dropFolderDir); | ||||
| 			$view->setParam('enablesessionlist', $settings->_enableSessionList); | ||||
| 			$view->setParam('workflowmode', $settings->_workflowMode); | ||||
| 			$view->setParam('partitionsize', (int) $settings->_partitionSize); | ||||
|  |  | |||
|  | @ -84,6 +84,7 @@ if ($action == "saveSettings") | |||
|   $settings->_enableSessionList = getBoolValue("enableSessionList"); | ||||
|   $settings->_enableClipboard = getBoolValue("enableClipboard"); | ||||
|   $settings->_enableMenuTasks = getBoolValue("enableMenuTasks"); | ||||
|   $settings->_enableDropFolderList = getBoolValue("enableDropFolderList"); | ||||
|   $settings->_enableDropUpload = getBoolValue("enableDropUpload"); | ||||
|   $settings->_enableMultiUpload = getBoolValue("enableMultiUpload"); | ||||
|   $settings->_enableFolderTree = getBoolValue("enableFolderTree"); | ||||
|  |  | |||
|  | @ -327,6 +327,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);; | |||
| 				//$this->addFooterJS('checkTasks();');
 | ||||
| 			} | ||||
| 
 | ||||
| 			if($this->params['dropfolderdir'] && $this->params['enabledropfolderlist']) { | ||||
| 				echo "   <div id=\"menu-dropfolder\">"; | ||||
| 				echo "     <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"DropFolderChooser\" data-action=\"menuList\"></div>"; | ||||
| 				echo "   </div>"; | ||||
| 			} | ||||
| 			if($this->params['enablesessionlist']) { | ||||
| 				echo "   <div id=\"menu-session\">"; | ||||
| 				echo "     <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Session\" data-action=\"menuSessions\"></div>"; | ||||
|  |  | |||
|  | @ -50,6 +50,53 @@ $('.folderselect').click(function(ev) { | |||
| <?php | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	public function menuList() { /* {{{ */ | ||||
| 		$dms = $this->params['dms']; | ||||
| 		$user = $this->params['user']; | ||||
| 		$dropfolderdir = $this->params['dropfolderdir']; | ||||
| 		$cachedir = $this->params['cachedir']; | ||||
| 		$timeout = $this->params['timeout']; | ||||
| 
 | ||||
| 		$previewwidth = 40; | ||||
| 		$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout); | ||||
| 
 | ||||
| 		$content = ''; | ||||
| 		$content .= "   <ul id=\"main-menu-dropfolderlist\" class=\"nav pull-right\">\n"; | ||||
| 		$content .= "    <li class=\"dropdown add-dropfolderlist-area\">\n"; | ||||
| 		$content .= "     <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" class=\"add-dropfolderlist-area\">".getMLText('dropfolder')." <i class=\"icon-caret-down\"></i></a>\n"; | ||||
| 		$content .= "     <ul class=\"dropdown-menu\" role=\"menu\">\n"; | ||||
| 		$dir = $dropfolderdir.'/'.$user->getLogin(); | ||||
| 		/* Check if we are still looking in the configured directory and | ||||
| 		 * not somewhere else, e.g. if the login was '../test' | ||||
| 		 */ | ||||
| 		if(dirname($dir) == $dropfolderdir) { | ||||
| 			if(is_dir($dir)) { | ||||
| 				$d = dir($dir); | ||||
| 
 | ||||
| 				$finfo = finfo_open(FILEINFO_MIME_TYPE); | ||||
| 				while (false !== ($entry = $d->read())) { | ||||
| 					if($entry != '..' && $entry != '.') { | ||||
| 						if($showfolders == 0 && !is_dir($dir.'/'.$entry)) { | ||||
| 							$mimetype = finfo_file($finfo, $dir.'/'.$entry); | ||||
| 							$previewer->createRawPreview($dir.'/'.$entry, 'dropfolder/', $mimetype); | ||||
| 							$content .= "<li><a _href=\"\">"; | ||||
| 							if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) { | ||||
| 								$content .= "<div style=\"float: left; display:inline; width:40px;\"><img filename=\"".$entry."\" width=\"".$previewwidth."\" src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\"></div>"; | ||||
| 							} | ||||
| 							$content .= "<div style=\"margin-left:10px; margin-right: 40px; display:inline-block;\">".$entry."<br /><span style=\"font-size: 85%;\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry)).", ".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</span></div></a></li>\n"; | ||||
| 						} elseif($showfolders && is_dir($dir.'/'.$entry)) { | ||||
| 							$content .= "<li><a _href=\"\">".$entry."</a></li>"; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		$content .= "     </ul>\n"; | ||||
| 		$content .= "    </li>\n"; | ||||
| 		$content .= "   </ul>\n"; | ||||
| 		echo $content; | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	function show() { /* {{{ */ | ||||
| 		$dms = $this->params['dms']; | ||||
| 		$user = $this->params['user']; | ||||
|  |  | |||
|  | @ -269,6 +269,10 @@ if(!is_writeable($settings->_configFilePath)) { | |||
| 	    <tr title="<?php printMLText("settings_enableMenuTasks_desc");?>"> | ||||
|         <td><?php printMLText("settings_enableMenuTasks");?>:</td>
 | ||||
|         <td><input name="enableMenuTasks" type="checkbox" <?php if ($settings->_enableMenuTasks) echo "checked" ?> /></td>
 | ||||
|       </tr> | ||||
| 	    <tr title="<?php printMLText("settings_enableDropFolderList_desc");?>"> | ||||
|         <td><?php printMLText("settings_enableDropFolderList");?>:</td>
 | ||||
|         <td><input name="enableDropFolderList" type="checkbox" <?php if ($settings->_enableDropFolderList) echo "checked" ?> /></td>
 | ||||
|       </tr> | ||||
| 	    <tr title="<?php printMLText("settings_enableSessionList_desc");?>"> | ||||
|         <td><?php printMLText("settings_enableSessionList");?>:</td>
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann