MDL-15768 - more cap checks in resource mod

This commit is contained in:
mjollnir_ 2008-08-11 15:43:14 +00:00
parent 728e1931a2
commit 600af1f9fe
2 changed files with 6 additions and 6 deletions

View File

@ -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);
}

View File

@ -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");