Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-path-block
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
iena
iena-path-block
Commits
c4102d46
Commit
c4102d46
authored
3 years ago
by
Lea
Browse files
Options
Downloads
Patches
Plain Diff
add function gat_all_path_list
parent
70e006e2
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
block_career.php
+17
-1
17 additions, 1 deletion
block_career.php
with
17 additions
and
1 deletion
block_career.php
+
17
−
1
View file @
c4102d46
...
@@ -51,6 +51,15 @@ class block_career extends block_base
...
@@ -51,6 +51,15 @@ class block_career extends block_base
{
{
return
true
;
return
true
;
}
}
function
get_all_path_list
(
$course_id
){
global
$DB
;
$list
=
array
();
$request
=
$DB
->
get_records_sql
(
'SELECT * FROM {block_career} WHERE course = ?'
,
array
(
$course_id
));
foreach
(
$request
as
$value
){
array_push
(
$list
,
$value
);
}
return
$list
;
}
function
get_path_list
(
$course_id
,
$user_id
){
function
get_path_list
(
$course_id
,
$user_id
){
global
$DB
;
global
$DB
;
...
@@ -93,8 +102,15 @@ class block_career extends block_base
...
@@ -93,8 +102,15 @@ class block_career extends block_base
$this
->
content
->
text
.
=
'<div class="list-group career-list-group font-weight-light">'
;
$this
->
content
->
text
.
=
'<div class="list-group career-list-group font-weight-light">'
;
$this
->
content
->
text
.
=
'<a href="'
.
$CFG
->
wwwroot
.
'/course/view.php?id='
.
$COURSE
->
id
.
'" class="list-group-item list-group-item-success list-group-item-action" style="border-top-left-radius: .15rem; border-top-right-radius: .15rem; border-top: none;">Accueil du cours</a>'
;
$this
->
content
->
text
.
=
'<a href="'
.
$CFG
->
wwwroot
.
'/course/view.php?id='
.
$COURSE
->
id
.
'" class="list-group-item list-group-item-success list-group-item-action" style="border-top-left-radius: .15rem; border-top-right-radius: .15rem; border-top: none;">Accueil du cours</a>'
;
$list
=
$this
->
get_path_list
(
$COURSE
->
id
,
$USER
->
id
);
$context
=
context_course
::
instance
(
$COURSE
->
id
);
if
(
has_capability
(
'moodle/course:update'
,
$context
)){
$list
=
$this
->
get_all_path_list
(
$COURSE
->
id
);
}
else
{
$list
=
$this
->
get_path_list
(
$COURSE
->
id
,
$USER
->
id
);
}
foreach
(
$list
as
$value
)
{
foreach
(
$list
as
$value
)
{
// if (file_get_contents("$CFG->wwwroot/blocks/career/$value->image") != null) {
// if (file_get_contents("$CFG->wwwroot/blocks/career/$value->image") != null) {
...
...
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