Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Formvalidator element of type URL - refs BT#9889 #TMI
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/* For licensing terms, see /license.txt */ | ||
/** | ||
* Url element | ||
* | ||
* Class Url | ||
*/ | ||
class Url extends HTML_QuickForm_text | ||
{ | ||
|
||
/** | ||
* Constructor of Url class | ||
* @param type $elementName | ||
* @param type $elementLabel | ||
* @param type $attributes | ||
*/ | ||
public function Url($elementName = null, $elementLabel = null, $attributes = null) | ||
{ | ||
if (!isset($attributes['id'])) { | ||
$attributes['id'] = $elementName; | ||
} | ||
|
||
$attributes['type'] = 'url'; | ||
$attributes['class'] = 'form-control'; | ||
|
||
parent::__construct($elementName, $elementLabel, $attributes); | ||
|
||
$this->setType('url'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters