Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
19699e28
Commit
19699e28
authored
2 years ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
fix for BIESt #1015
Merge request
studip/studip!584
parent
0d95625c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/oer/oai.php
+10
-10
10 additions, 10 deletions
app/controllers/oer/oai.php
with
10 additions
and
10 deletions
app/controllers/oer/oai.php
+
10
−
10
View file @
19699e28
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Gets initialized due to requests. Validates metadata-prefix and used verb
* Gets initialized due to requests. Validates metadata-prefix and used verb
* and calls a response-template with specified values.
* and calls a response-template with specified values.
*/
*/
class
Oer_OaiController
extends
Plugin
Controller
class
Oer_OaiController
extends
Studip
Controller
{
{
public
function
index_action
()
public
function
index_action
()
...
@@ -23,7 +23,7 @@ class Oer_OaiController extends PluginController
...
@@ -23,7 +23,7 @@ class Oer_OaiController extends PluginController
$verb
=
lcfirst
(
$verb
);
$verb
=
lcfirst
(
$verb
);
$this
->
verb
=
$verb
;
$this
->
verb
=
$verb
;
}
else
{
}
else
{
$this
->
render_template
(
"oai/badVerb"
);
$this
->
render_template
(
"
oer/
oai/badVerb"
);
}
}
$metadataPrefix
=
$request
->
offsetGet
(
'metadataPrefix'
);
$metadataPrefix
=
$request
->
offsetGet
(
'metadataPrefix'
);
...
@@ -31,7 +31,7 @@ class Oer_OaiController extends PluginController
...
@@ -31,7 +31,7 @@ class Oer_OaiController extends PluginController
$this
->
metadataPrefix
=
$metadataPrefix
;
$this
->
metadataPrefix
=
$metadataPrefix
;
}
else
{
}
else
{
if
(
empty
(
$this
->
response
->
body
))
{
if
(
empty
(
$this
->
response
->
body
))
{
$this
->
render_template
(
"oai/badPrefix"
);
$this
->
render_template
(
"
oer/
oai/badPrefix"
);
}
}
}
}
...
@@ -77,7 +77,7 @@ class Oer_OaiController extends PluginController
...
@@ -77,7 +77,7 @@ class Oer_OaiController extends PluginController
$this
->
vcard
=
vCard
::
export
(
User
::
find
(
$targetMaterial
->
user_id
));
$this
->
vcard
=
vCard
::
export
(
User
::
find
(
$targetMaterial
->
user_id
));
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
}
else
{
}
else
{
$this
->
render_template
(
"oai/idNotExists"
);
$this
->
render_template
(
"
oer/
oai/idNotExists"
);
}
}
}
}
...
@@ -89,7 +89,7 @@ class Oer_OaiController extends PluginController
...
@@ -89,7 +89,7 @@ class Oer_OaiController extends PluginController
if
(
!
empty
(
$set
))
{
if
(
!
empty
(
$set
))
{
if
(
empty
(
$target_set
=
OERTag
::
findBySQL
(
'name = ?'
,
[
$set
]))){
if
(
empty
(
$target_set
=
OERTag
::
findBySQL
(
'name = ?'
,
[
$set
]))){
$this
->
render_template
(
"oai/noSets"
);
$this
->
render_template
(
"
oer/
oai/noSets"
);
}
}
if
(
$this
->
records
=
OERMaterial
::
findByTag
(
$set
))
{
if
(
$this
->
records
=
OERMaterial
::
findByTag
(
$set
))
{
foreach
(
$this
->
records
as
$key
=>
$value
)
{
foreach
(
$this
->
records
as
$key
=>
$value
)
{
...
@@ -118,7 +118,7 @@ class Oer_OaiController extends PluginController
...
@@ -118,7 +118,7 @@ class Oer_OaiController extends PluginController
$this
->
tag_collection
=
$tag_collection
;
$this
->
tag_collection
=
$tag_collection
;
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
}
else
{
}
else
{
$this
->
render_template
(
"oai/noRecordsMatch"
);
$this
->
render_template
(
"
oer/
oai/noRecordsMatch"
);
}
}
}
}
...
@@ -133,7 +133,7 @@ class Oer_OaiController extends PluginController
...
@@ -133,7 +133,7 @@ class Oer_OaiController extends PluginController
$this
->
identifier
=
$identifier
;
$this
->
identifier
=
$identifier
;
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
}
else
{
}
else
{
$this
->
render_template
(
"oai/noSets"
);
$this
->
render_template
(
"
oer/
oai/noSets"
);
}
}
}
}
...
@@ -175,7 +175,7 @@ class Oer_OaiController extends PluginController
...
@@ -175,7 +175,7 @@ class Oer_OaiController extends PluginController
$this
->
targetMaterial
=
$targetMaterial
;
$this
->
targetMaterial
=
$targetMaterial
;
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
}
else
{
}
else
{
$this
->
render_template
(
"oai/idNotExists"
);
$this
->
render_template
(
"
oer/
oai/idNotExists"
);
}
}
}
else
{
}
else
{
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
...
@@ -188,13 +188,13 @@ class Oer_OaiController extends PluginController
...
@@ -188,13 +188,13 @@ class Oer_OaiController extends PluginController
$this
->
tags
=
$tags
;
$this
->
tags
=
$tags
;
$this
->
renderResponse
(
$this
->
verb
);
$this
->
renderResponse
(
$this
->
verb
);
}
else
{
}
else
{
$this
->
render_template
(
"oai/noSets"
);
$this
->
render_template
(
"
oer/
oai/noSets"
);
}
}
}
}
//Render
//Render
public
function
renderResponse
(
$verb
)
public
function
renderResponse
(
$verb
)
{
{
$this
->
render_template
(
"oai/"
.
$verb
);
$this
->
render_template
(
"
oer/
oai/"
.
$verb
);
}
}
//Helper
//Helper
public
function
getEarliestTime
()
public
function
getEarliestTime
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment