mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	added hook before adding a document
This commit is contained in:
		
							parent
							
								
									c0c9aaa61c
								
							
						
					
					
						commit
						08c0961a16
					
				|  | @ -216,6 +216,14 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){ | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) { | ||||||
|  | 		foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) { | ||||||
|  | 			if (method_exists($hookObj, 'pretAddDocument')) { | ||||||
|  | 				$hookObj->preAddDocument(array('name'=>&$name, 'comment'=>&$comment)); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	$res = $folder->addDocument($name, $comment, $expires, $user, $keywords, | 	$res = $folder->addDocument($name, $comment, $expires, $user, $keywords, | ||||||
| 															$cats, $userfiletmp, basename($userfilename), | 															$cats, $userfiletmp, basename($userfilename), | ||||||
| 	                            $fileType, $userfiletype, $sequence, | 	                            $fileType, $userfiletype, $sequence, | ||||||
|  | @ -226,8 +234,8 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){ | ||||||
| 		UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured")); | 		UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured")); | ||||||
| 	} else { | 	} else { | ||||||
| 		$document = $res[0]; | 		$document = $res[0]; | ||||||
| 		if(isset($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'])) { | 		if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) { | ||||||
| 			foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) { | 			foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) { | ||||||
| 				if (method_exists($hookObj, 'postAddDocument')) { | 				if (method_exists($hookObj, 'postAddDocument')) { | ||||||
| 					$hookObj->postAddDocument($document); | 					$hookObj->postAddDocument($document); | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann