Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
learning_plan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moodle
learning_plan
Commits
eec07799
Commit
eec07799
authored
Nov 25, 2015
by
3i Logic LMS
Browse files
Options
Downloads
Patches
Plain Diff
Fix home page notice
issue fixes by initializing $this->content->text = '' after stdclass object creation.
parent
0d124a45
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
block_learning_plan.php
+5
-0
5 additions, 0 deletions
block_learning_plan.php
with
5 additions
and
0 deletions
block_learning_plan.php
+
5
−
0
View file @
eec07799
...
@@ -29,12 +29,15 @@ class block_learning_plan extends block_base {
...
@@ -29,12 +29,15 @@ class block_learning_plan extends block_base {
public
function
init
()
{
public
function
init
()
{
global
$CFG
,
$USER
,
$COURSE
;
global
$CFG
,
$USER
,
$COURSE
;
$this
->
title
=
get_string
(
'learning_plan'
,
'block_learning_plan'
);
$this
->
title
=
get_string
(
'learning_plan'
,
'block_learning_plan'
);
}
}
public
function
get_content
()
{
public
function
get_content
()
{
if
(
$this
->
content
!==
null
)
{
if
(
$this
->
content
!==
null
)
{
return
$this
->
content
;
return
$this
->
content
;
}
}
global
$CFG
,
$USER
,
$COURSE
,
$PAGE
,
$DB
;
global
$CFG
,
$USER
,
$COURSE
,
$PAGE
,
$DB
;
if
(
has_capability
(
'block/learning_plan:managepages'
,
$this
->
context
))
{
if
(
has_capability
(
'block/learning_plan:managepages'
,
$this
->
context
))
{
...
@@ -43,11 +46,13 @@ class block_learning_plan extends block_base {
...
@@ -43,11 +46,13 @@ class block_learning_plan extends block_base {
$this
->
title
=
get_string
(
'myview'
,
'block_learning_plan'
);
$this
->
title
=
get_string
(
'myview'
,
'block_learning_plan'
);
}
}
$this
->
content
=
new
stdClass
;
$this
->
content
=
new
stdClass
;
$this
->
content
->
text
=
''
;
if
(
has_capability
(
'block/learning_plan:managepages'
,
$this
->
context
))
{
if
(
has_capability
(
'block/learning_plan:managepages'
,
$this
->
context
))
{
$pageurl
=
new
moodle_url
(
'/blocks/learning_plan/view.php?viewpage'
);
$pageurl
=
new
moodle_url
(
'/blocks/learning_plan/view.php?viewpage'
);
if
(
!
strpos
(
$pageurl
,
'='
))
{
if
(
!
strpos
(
$pageurl
,
'='
))
{
$pageurl
.
=
'='
;
$pageurl
.
=
'='
;
}
}
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'1'
,
get_string
(
'learningpath'
,
'block_learning_plan'
))
.
'<br>'
;
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'1'
,
get_string
(
'learningpath'
,
'block_learning_plan'
))
.
'<br>'
;
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'2'
,
get_string
(
'add_training'
,
'block_learning_plan'
))
.
'<br>'
;
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'2'
,
get_string
(
'add_training'
,
'block_learning_plan'
))
.
'<br>'
;
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'4'
,
get_string
(
'assign_training_learningplan'
,
'block_learning_plan'
))
.
'<br>'
;
$this
->
content
->
text
.
=
html_writer
::
link
(
$pageurl
.
'4'
,
get_string
(
'assign_training_learningplan'
,
'block_learning_plan'
))
.
'<br>'
;
...
...
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
sign in
to comment