@@ -136,9 +136,13 @@ public static function caption($selector = 'img.caption')
136136 * @return void
137137 *
138138 * @since 1.5
139+ *
140+ * @Deprecated 3.4 Use formvalidator instead
139141 */
140142 public static function formvalidation ()
141143 {
144+ JLog::add ('The use of formvalidation is deprecated use formvalidator instead. ' , JLog::WARNING , 'deprecated ' );
145+
142146 // Only load once
143147 if (isset (static ::$ loaded [__METHOD__ ]))
144148 {
@@ -148,8 +152,32 @@ public static function formvalidation()
148152 // Include MooTools framework
149153 static ::framework ();
150154
151- // Include jQuery Framework
152- JHtml::_ ('jquery.framework ' );
155+ // Load the new jQuery code
156+ static ::formvalidator ();
157+ }
158+
159+ /**
160+ * Add unobtrusive JavaScript support for form validation.
161+ *
162+ * To enable form validation the form tag must have class="form-validate".
163+ * Each field that needs to be validated needs to have class="validate".
164+ * Additional handlers can be added to the handler for username, password,
165+ * numeric and email. To use these add class="validate-email" and so on.
166+ *
167+ * @return void
168+ *
169+ * @since 3.4
170+ */
171+ public static function formvalidator ()
172+ {
173+ // Only load once
174+ if (isset (static ::$ loaded [__METHOD__ ]))
175+ {
176+ return ;
177+ }
178+
179+ // Include core
180+ static ::core ();
153181
154182 // Add validate.js language strings
155183 JText::script ('JLIB_FORM_FIELD_INVALID ' );
@@ -209,10 +237,10 @@ public static function combobox()
209237 {
210238 return ;
211239 }
212- // Include MooTools framework
213- static ::framework ();
240+ // Include core
241+ static ::core ();
214242
215- JHtml::_ ('script ' , 'system/combobox.js ' , true , true );
243+ JHtml::_ ('script ' , 'system/combobox.js ' , false , true );
216244 static ::$ loaded [__METHOD__ ] = true ;
217245 }
218246
@@ -400,14 +428,14 @@ public static function multiselect($id = 'adminForm')
400428 }
401429
402430 // Include jQuery
403- JHtml:: _ ( ' jquery.framework ' );
431+ static :: core ( );
404432
405- JHtml::_ ('script ' , 'system/multiselect.js ' , true , true );
433+ JHtml::_ ('script ' , 'system/multiselect.js ' , false , true );
406434
407435 // Attach multiselect to document
408436 JFactory::getDocument ()->addScriptDeclaration (
409- "window.addEvent('domready', function() {
410- new Joomla.JMultiSelect(' " . $ id . "');
437+ "jQuery(document).ready( function() {
438+ Joomla.JMultiSelect(' " . $ id . "');
411439 }); "
412440 );
413441
@@ -649,9 +677,9 @@ public static function highlighter(array $terms, $start = 'highlighter-start', $
649677 }
650678
651679 // Include jQuery
652- JHtml:: _ ( ' jquery.framework ' );
680+ static :: core ( );
653681
654- JHtml::_ ('script ' , 'system/highlighter.js ' , true , true );
682+ JHtml::_ ('script ' , 'system/highlighter.js ' , false , true );
655683
656684 $ terms = str_replace ('" ' , '\" ' , $ terms );
657685
@@ -695,11 +723,8 @@ public static function noframes()
695723 return ;
696724 }
697725
698- // Include MooTools framework
699- static ::framework ();
700-
701726 // Include jQuery
702- JHtml:: _ ( ' jquery.framework ' );
727+ static :: core ( );
703728
704729 $ js = "jQuery(function () {if (top == self) {document.documentElement.style.display = 'block'; } " .
705730 " else {top.location = self.location; }}); " ;
0 commit comments