public function get_content() { global $CFG; if ($this->content !== null) { return $this->content; } $this->content = new stdClass(); $this->content->footer = ''; // Has this been setup properly if (!is_commerce_configured()) { $this->content->text = '<div class=\\"alert alert-danger\\">' . get_string('notconfigured', 'block_iomad_commerce') . '</div>'; return $this->content; } $this->content->text = '<a href="' . new moodle_url('/blocks/iomad_commerce/shop.php') . '">' . get_string('shop_title', 'block_iomad_commerce') . '</a>'; $this->content->text .= get_basket_info(); return $this->content; }
} } } if ($hide) { $courserecord = $DB->get_record('course_shopsettings', array('id' => $hide)); if ($courserecord->enabled == 0) { $courserecord->enabled = 1; } else { $courserecord->enabled = 0; } $DB->update_record('course_shopsettings', $courserecord); redirect(new moodle_url($baseurl)); } $blockpage->display_header(); // Has this been setup properly if (!is_commerce_configured()) { echo '<div class=\\"alert alert-danger\\">' . get_string('notconfigured', 'block_iomad_commerce') . '</div>'; echo $OUTPUT->footer(); die; } // Check we can actually do anything on this page. iomad::require_capability('block/iomad_commerce:admin_view', $context); // Get the number of companies. $objectcount = $DB->count_records('course_shopsettings'); echo $OUTPUT->paging_bar($objectcount, $page, $perpage, $baseurl); flush(); if ($courses = $DB->get_recordset_sql('SELECT css.*, c.fullname FROM {course_shopsettings} css INNER JOIN {course} c ON c.id = css.courseid ORDER BY c.fullname', null, $page, $perpage)) { if (count($courses)) {