Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f11d1bad
authored
2013-01-25 20:00:15 -0500
by
mpenner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add a function that outputs user prefixes (like 'Mr.') with no blank first option. refs #1555
1 parent
ab2665d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
com/HTML/HTML.php
com/HTML/HTML.php
View file @
f11d1ba
...
...
@@ -52,6 +52,25 @@ function select_opts_prefixes($selected = null, $echo = true) {
return
select_opts
(
Vars
::
$prefixes
,
$selected
,
$echo
);
}
function
selectOptsPrefixesNoBlank
(
$selected
=
null
)
{
$return
=
''
;
foreach
(
Vars
::
$prefixes
as
$val
=>
&
$label
)
{
if
(
empty
(
$val
))
{
continue
;
}
$sel
=
(
$val
==
$selected
?
' selected'
:
''
);
$string
=
'<option value="'
.
$val
.
'"'
.
$sel
.
'>'
.
$label
.
'</option>'
;
$return
.=
$string
;
}
unset
(
$label
);
return
$return
;
}
function
select_opts_countries
(
$selected
=
null
,
$echo
=
true
)
{
return
select_opts
(
Vars
::
$countries
,
$selected
,
$echo
);
}
...
...
@@ -155,7 +174,7 @@ if ( ! function_exists('form_dropdown'))
if
(
$extra
!=
''
)
$extra
=
' '
.
$extra
;
$multiple
=
(
count
(
$selected
)
>
1
&&
strpos
(
$extra
,
'multiple'
)
===
FALSE
)
?
' multiple="multiple"'
:
''
;
$multiple
=
(
count
(
$selected
)
>
1
&&
strpos
(
$extra
,
'multiple'
)
===
false
)
?
' multiple="multiple"'
:
''
;
$form
=
'<select name="'
.
$name
.
'"'
.
$extra
.
$multiple
.
">
\n
"
;
if
(
$blankFirstOption
)
{
...
...
@@ -381,7 +400,7 @@ if (!function_exists('formLinkedDropdownWithExtra')) {
if
(
!
function_exists
(
'url_title'
))
{
function
url_title
(
$str
,
$separator
=
'dash'
,
$lowercase
=
FALSE
)
function
url_title
(
$str
,
$separator
=
'dash'
,
$lowercase
=
false
)
{
if
(
$separator
==
'dash'
)
{
...
...
@@ -412,7 +431,7 @@ if ( ! function_exists('url_title'))
$str
=
preg_replace
(
"#"
.
$key
.
"#i"
,
$val
,
$str
);
}
if
(
$lowercase
===
TRUE
)
if
(
$lowercase
===
true
)
{
$str
=
strtolower
(
$str
);
}
...
...
Please
register
or
sign in
to post a comment