Skip to content
GitLab
Menu
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
3d9930e9
Commit
3d9930e9
authored
Dec 04, 2006
by
Penny Leach
Browse files
fixing error messages in template validator
parent
20ee7e11
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/template.php
View file @
3d9930e9
...
...
@@ -98,13 +98,13 @@ function template_validate_block($data, $name='') {
if
(
!
empty
(
$type
))
{
if
(
empty
(
$format
))
{
throw
new
InvalidArgumentException
(
"Cannot specify type without format"
);
throw
new
InvalidArgumentException
(
"Cannot specify
{
$name
}
type without
(
$name
}
format"
);
}
}
if
(
!
empty
(
$format
)
&&
$format
!=
'label'
)
{
if
(
empty
(
$type
))
{
throw
new
InvalidArgumentException
(
"Cannot specify format without type"
);
throw
new
InvalidArgumentException
(
"Cannot specify
{
$name
}
format without
{
$name
}
type"
);
}
}
...
...
@@ -114,14 +114,14 @@ function template_validate_block($data, $name='') {
// figure out what plugin handles this type and validate the class exists.
if
(
!
$plugin
=
get_field
(
'artefact_installed_type'
,
'plugin'
,
'name'
,
$type
))
{
throw
new
InvalidArgumentException
(
"
T
ype
$type
is not installed"
);
throw
new
InvalidArgumentException
(
"
{
$name
}
t
ype
$type
is not installed"
);
}
require_once
(
'artefact.php'
);
safe_require
(
'artefact'
,
$plugin
);
if
(
!
artefact_can_render_to
(
$type
,
$format
))
{
throw
new
InvalidArgumentException
(
"
T
ype
$type
can't render to format
$format
"
);
throw
new
InvalidArgumentException
(
"
{
$name
}
t
ype
$type
can't render to
{
$name
}
format
$format
"
);
}
// @todo validate resizing stuff
...
...
Write
Preview
Supports
Markdown
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