mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-15768 - more cap checks in resource mod
This commit is contained in:
parent
728e1931a2
commit
600af1f9fe
@ -65,7 +65,7 @@ function display() {
|
||||
parent::display_course_blocks_start();
|
||||
|
||||
echo format_text($this->resource->alltext, FORMAT_HTML, $formatoptions, $this->course->id);
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ function display() {
|
||||
print_header();
|
||||
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id),
|
||||
"center clearfix", "", "", "20");
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
print_footer($course);
|
||||
@ -124,7 +124,7 @@ function display() {
|
||||
navmenu($course, $cm));
|
||||
|
||||
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id), "center clearfix", "", "", "20");
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ function display() {
|
||||
|
||||
if (trim(strip_tags($this->resource->alltext))) {
|
||||
echo format_text($this->resource->alltext, FORMAT_MOODLE, $formatoptions, $this->course->id);
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ function display() {
|
||||
print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id),
|
||||
"center", "", "", "20");
|
||||
print_footer($course);
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
} else { /// Make a page and a pop-up window
|
||||
@ -126,7 +126,7 @@ function display() {
|
||||
print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id),
|
||||
"center", "", "", "20");
|
||||
|
||||
if (true) { //@todo penny replace later with capability check
|
||||
if (has_capability('mod/resource:exportresource', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
|
||||
resource_portfolio_caller::add_button($this);
|
||||
}
|
||||
$strlastmodified = get_string("lastmodified");
|
||||
|
Loading…
x
Reference in New Issue
Block a user