Browse Source

[svn r10983] error message when no label on picture

Patrick Vandermaesen 18 years ago
parent
commit
26ce3d5aeb
2 changed files with 16 additions and 1 deletions
  1. 4 1
      main/admin/configure_homepage.php
  2. 12 0
      main/inc/lib/WCAG/WCAG_rendering.php

+ 4 - 1
main/admin/configure_homepage.php

@@ -1,4 +1,4 @@
-<?php // $Id: configure_homepage.php 10982 2007-01-29 22:14:31Z pvandermaesen $
+<?php // $Id: configure_homepage.php 10983 2007-01-29 22:29:10Z pvandermaesen $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -59,6 +59,9 @@ if(!file_exists('../../home/home_menu_'.$menu_language.'.html'))
 }
 
 $errorMsg='';
+if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
+	$errorMsg=WCAG_Rendering::request_validation();
+}
 
 if(!empty($action))
 {

+ 12 - 0
main/inc/lib/WCAG/WCAG_rendering.php

@@ -56,6 +56,18 @@ class WCAG_Rendering {
 		return $home_top;
 	}
 	
+	/**
+	* this method validate the content of current request (from WCAG editor).
+	* this function return the error msg.
+	*/
+	function request_validation() {
+		$imageFile = $_POST['imagefile'];				
+		$imageLabel = $_POST['imageLabel'];
+		if ((strlen($imageFile) > 0) and (strlen($imageLabel) == 0)) {
+			return get_lang('errorNoLabel');
+		}
+		return '';
+	}
 	
 /**
 * Converter Plaintext to (x)HTML