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
e0284f0e
Commit
e0284f0e
authored
Sep 06, 2009
by
Nigel McNie
Browse files
Use associative array trick to identify related achievements for education entries.
Signed-off-by:
Nigel McNie
<
nigel@catalyst.net.nz
>
parent
c006a45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/import/leap/lib.php
View file @
e0284f0e
...
...
@@ -176,13 +176,14 @@ class LeapImportResume extends LeapImportArtefactPlugin {
// If this entry supports an achievement, that achievement will be
// the qualification the user gained in relation to this entry
foreach
(
$entry
->
link
as
$link
)
{
if
(
$importer
->
curie_equals
(
$link
[
'rel'
],
PluginImportLeap
::
NS_LEAP
,
'supports'
)
&&
isset
(
$link
[
'href'
]))
{
if
(
!
isset
(
$other_required_entries
[
'achievement'
])
&&
$importer
->
curie_equals
(
$link
[
'rel'
],
PluginImportLeap
::
NS_LEAP
,
'supports'
)
&&
isset
(
$link
[
'href'
]))
{
if
(
$potentialqualification
=
$importer
->
get_entry_by_id
((
string
)
$link
[
'href'
]))
{
$correctrdftype
=
count
(
$potentialqualification
->
xpath
(
'rdf:type['
.
$importer
->
curie_xpath
(
'@rdf:resource'
,
PluginImportLeap
::
NS_LEAPTYPE
,
'achievement'
)
.
']'
))
==
1
;
if
(
$correctrdftype
)
{
// We have a related achievement!
$other_required_entries
[]
=
(
string
)
$link
[
'href'
];
$other_required_entries
[
'achievement'
]
=
(
string
)
$link
[
'href'
];
break
;
}
}
...
...
@@ -305,8 +306,8 @@ class LeapImportResume extends LeapImportArtefactPlugin {
$enddate
=
(
isset
(
$dates
[
'end'
]))
?
self
::
convert_leap_date_to_resume_date
(
$dates
[
'end'
])
:
''
;
$qualtype
=
$qualname
=
''
;
if
(
coun
t
(
$otherentries
))
{
$qualification
=
$importer
->
get_entry_by_id
(
$otherentries
[
0
]);
if
(
isse
t
(
$otherentries
[
'achievement'
]
))
{
$qualification
=
$importer
->
get_entry_by_id
(
$otherentries
[
'achievement'
]);
$qualtype
=
$qualification
->
title
;
$qualname
=
PluginImportLeap
::
get_entry_content
(
$qualification
,
$importer
);
}
...
...
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