Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
1c6096c1
Commit
1c6096c1
authored
Jun 27, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup js code in system_groupmanager.php for
https://github.com/opnsense/core/issues/1005
parent
464f7d6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
64 deletions
+18
-64
system_groupmanager.php
src/www/system_groupmanager.php
+18
-64
No files found.
src/www/system_groupmanager.php
View file @
1c6096c1
...
...
@@ -161,70 +161,11 @@ legacy_html_escape_form_data($pconfig);
legacy_html_escape_form_data
(
$a_group
);
include
(
"head.inc"
);
?>
<body>
<?php
include
(
"fbegin.inc"
);
?>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
function
setall_selected
(
id
)
{
selbox
=
document
.
getElementById
(
id
);
count
=
selbox
.
options
.
length
;
for
(
index
=
0
;
index
<
count
;
index
++
)
{
selbox
.
options
[
index
].
selected
=
true
;
}
}
function
clear_selected
(
id
)
{
selbox
=
document
.
getElementById
(
id
);
count
=
selbox
.
options
.
length
;
for
(
index
=
0
;
index
<
count
;
index
++
)
{
selbox
.
options
[
index
].
selected
=
false
;
}
}
function
remove_selected
(
id
)
{
selbox
=
document
.
getElementById
(
id
);
index
=
selbox
.
options
.
length
-
1
;
for
(;
index
>=
0
;
index
--
)
{
if
(
selbox
.
options
[
index
].
selected
)
{
selbox
.
remove
(
index
);
}
}
}
function
copy_selected
(
srcid
,
dstid
)
{
src_selbox
=
document
.
getElementById
(
srcid
);
dst_selbox
=
document
.
getElementById
(
dstid
);
count
=
dst_selbox
.
options
.
length
;
for
(
index
=
count
-
1
;
index
>=
0
;
index
--
)
{
if
(
dst_selbox
.
options
[
index
].
value
==
''
)
{
dst_selbox
.
remove
(
index
);
}
}
count
=
src_selbox
.
options
.
length
;
for
(
index
=
0
;
index
<
count
;
index
++
)
{
if
(
src_selbox
.
options
[
index
].
selected
)
{
option
=
document
.
createElement
(
'
option
'
);
option
.
text
=
src_selbox
.
options
[
index
].
text
;
option
.
value
=
src_selbox
.
options
[
index
].
value
;
dst_selbox
.
add
(
option
,
null
);
}
}
}
function
move_selected
(
srcid
,
dstid
)
{
copy_selected
(
srcid
,
dstid
);
remove_selected
(
srcid
);
}
function
presubmit
()
{
clear_selected
(
'
notmembers
'
);
setall_selected
(
'
members
'
);
}
$
(
document
).
ready
(
function
()
{
// remove group
$
(
"
.act-del-group
"
).
click
(
function
(
event
){
...
...
@@ -250,8 +191,21 @@ $( document ).ready(function() {
}]
});
});
$
(
"
#add_groups
"
).
click
(
function
(){
$
(
"
#members
"
).
append
(
$
(
"
#notmembers option:selected
"
));
$
(
"
#notmembers option:selected
"
).
remove
();
$
(
"
#members option:selected
"
).
prop
(
'
selected
'
,
false
);
})
$
(
"
#remove_groups
"
).
click
(
function
(){
$
(
"
#notmembers
"
).
append
(
$
(
"
#members option:selected
"
));
$
(
"
#members option:selected
"
).
remove
();
$
(
"
#notmembers option:selected
"
).
prop
(
'
selected
'
,
false
);
})
$
(
"
#save
"
).
click
(
function
(){
$
(
"
#members > option
"
).
prop
(
'
selected
'
,
true
);
$
(
"
#notmembers > option
"
).
prop
(
'
selected
'
,
false
);
});
});
//]]>
</script>
...
...
@@ -268,7 +222,7 @@ $( document ).ready(function() {
<div
class=
"tab-content content-box col-xs-12 table-responsive"
>
<?php
if
(
$act
==
"new"
||
$act
==
"edit"
)
:?>
<
form
method
=
"post"
name
=
"iform"
id
=
"iform"
onsubmit
=
"presubmit()"
>
<
form
method
=
"post"
name
=
"iform"
id
=
"iform"
>
<
input
type
=
"hidden"
id
=
"act"
name
=
"act"
value
=
""
/>
<
input
type
=
"hidden"
id
=
"groupid"
name
=
"groupid"
value
=
"<?=(isset(
$id
) ?
$id
: '');?>"
/>
<
input
type
=
"hidden"
id
=
"privid"
name
=
"privid"
value
=
""
/>
...
...
@@ -325,11 +279,11 @@ $( document ).ready(function() {
</td>
<td
class=
"text-center"
>
<br
/>
<a
href=
"javascript:move_selected('notmembers','members')
"
class=
"btn btn-default btn-xs"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"Add Groups"
);
?>
"
>
<a
id=
"add_groups
"
class=
"btn btn-default btn-xs"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"Add Groups"
);
?>
"
>
<span
class=
"glyphicon glyphicon-arrow-right"
></span>
</a>
<br
/><br
/>
<a
href=
"javascript:move_selected('members','notmembers')
"
class=
"btn btn-default btn-xs"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"Remove Groups"
);
?>
"
>
<a
id=
"remove_groups
"
class=
"btn btn-default btn-xs"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"Remove Groups"
);
?>
"
>
<span
class=
"glyphicon glyphicon-arrow-left"
></span>
</a>
</td>
...
...
@@ -392,7 +346,7 @@ $( document ).ready(function() {
<tr>
<td></td>
<td>
<input
name=
"save"
type=
"submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Save"
);
?>
"
/>
<input
name=
"save"
id=
"save"
type=
"submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Save"
);
?>
"
/>
<input
type=
"button"
class=
"btn btn-default"
value=
"
<?=
gettext
(
"Cancel"
);
?>
"
onclick=
"window.location.href='/system_groupmanager.php'"
/>
<?php
if
(
isset
(
$id
))
:?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment