Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
166bedd0
Commit
166bedd0
authored
Jul 13, 2009
by
Richard Mansfield
Browse files
More checking on view access date formatting (bug 3072)
parent
61836039
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lang/en.utf8/view.php
View file @
166bedd0
...
@@ -41,6 +41,7 @@ $string['description'] = 'View Description';
...
@@ -41,6 +41,7 @@ $string['description'] = 'View Description';
$string
[
'startdate'
]
=
'Access Start Date/Time'
;
$string
[
'startdate'
]
=
'Access Start Date/Time'
;
$string
[
'stopdate'
]
=
'Access End Date/Time'
;
$string
[
'stopdate'
]
=
'Access End Date/Time'
;
$string
[
'startdatemustbebeforestopdate'
]
=
'The start date must be before the stop date'
;
$string
[
'startdatemustbebeforestopdate'
]
=
'The start date must be before the stop date'
;
$string
[
'unrecogniseddateformat'
]
=
'Unrecognised date format'
;
$string
[
'ownerformat'
]
=
'Name display format'
;
$string
[
'ownerformat'
]
=
'Name display format'
;
$string
[
'ownerformatdescription'
]
=
'How do you want people who look at your View to see your name?'
;
$string
[
'ownerformatdescription'
]
=
'How do you want people who look at your View to see your name?'
;
$string
[
'profileviewtitle'
]
=
'Profile view'
;
$string
[
'profileviewtitle'
]
=
'Profile view'
;
...
...
htdocs/view/access.php
View file @
166bedd0
...
@@ -241,13 +241,21 @@ function editaccess_validate(Pieform $form, $values) {
...
@@ -241,13 +241,21 @@ function editaccess_validate(Pieform $form, $values) {
}
}
$loggedinaccess
=
false
;
$loggedinaccess
=
false
;
if
(
$values
[
'accesslist'
])
{
if
(
$values
[
'accesslist'
])
{
foreach
(
$values
[
'accesslist'
]
as
$item
)
{
foreach
(
$values
[
'accesslist'
]
as
&
$item
)
{
if
(
!
isset
(
$item
[
'startdate'
]))
{
if
(
!
isset
(
$item
[
'startdate'
]))
{
$item
[
'startdate'
]
=
null
;
$item
[
'startdate'
]
=
null
;
}
}
else
if
(
!
$item
[
'startdate'
]
=
strtotime
(
$item
[
'startdate'
]))
{
$form
->
set_error
(
'accesslist'
,
get_string
(
'unrecogniseddateformat'
,
'view'
));
break
;
}
if
(
!
isset
(
$item
[
'stopdate'
]))
{
if
(
!
isset
(
$item
[
'stopdate'
]))
{
$item
[
'stopdate'
]
=
null
;
$item
[
'stopdate'
]
=
null
;
}
}
else
if
(
!
$item
[
'stopdate'
]
=
strtotime
(
$item
[
'stopdate'
]))
{
$form
->
set_error
(
'accesslist'
,
get_string
(
'invaliddate'
,
'view'
));
break
;
}
if
(
$item
[
'type'
]
==
'loggedin'
&&
!
$item
[
'startdate'
]
&&
!
$item
[
'stopdate'
])
{
if
(
$item
[
'type'
]
==
'loggedin'
&&
!
$item
[
'startdate'
]
&&
!
$item
[
'stopdate'
])
{
$loggedinaccess
=
true
;
$loggedinaccess
=
true
;
}
}
...
@@ -285,6 +293,16 @@ function editaccess_submit(Pieform $form, $values) {
...
@@ -285,6 +293,16 @@ function editaccess_submit(Pieform $form, $values) {
redirect
(
'/view/blocks.php?id='
.
$view
->
get
(
'id'
)
.
'&new='
.
$new
);
redirect
(
'/view/blocks.php?id='
.
$view
->
get
(
'id'
)
.
'&new='
.
$new
);
}
}
if
(
$values
[
'accesslist'
])
{
foreach
(
$values
[
'accesslist'
]
as
&
$item
)
{
if
(
isset
(
$item
[
'startdate'
]))
{
$item
[
'startdate'
]
=
strtotime
(
$item
[
'startdate'
]);
}
if
(
isset
(
$item
[
'stopdate'
]))
{
$item
[
'stopdate'
]
=
strtotime
(
$item
[
'stopdate'
]);
}
}
}
$view
->
set_access
(
$values
[
'accesslist'
]);
$view
->
set_access
(
$values
[
'accesslist'
]);
$view
->
set
(
'startdate'
,
$values
[
'startdate'
]);
$view
->
set
(
'startdate'
,
$values
[
'startdate'
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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