service_information.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Service information page
  5. * Show information about a service (for custom purposes).
  6. *
  7. * @author José Loguercio Silva <jose.loguercio@beeznest.com>
  8. *
  9. * @package chamilo.buycourses_plugin
  10. */
  11. $cidReset = true;
  12. require_once '../../../main/inc/global.inc.php';
  13. $serviceId = isset($_GET['service_id']) ? intval($_GET['service_id']) : false;
  14. $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(
  15. WEB_PLUGIN_PATH
  16. ).'buycourses/resources/css/style.css"/>';
  17. $plugin = BuyCoursesPlugin::create();
  18. $includeServices = $plugin->get('include_services') === 'true';
  19. if (!$includeServices) {
  20. api_not_allowed(true);
  21. }
  22. $service = $plugin->getService($serviceId);
  23. if (!$service['id']) {
  24. api_not_allowed(true);
  25. }
  26. $template = new Template(false);
  27. $template->assign('pageUrl', api_get_path(WEB_PATH)."service/{$serviceId}/information/");
  28. $template->assign('service', $service);
  29. $template->assign('essence', Essence\Essence::instance());
  30. $content = $template->fetch('buycourses/view/service_information.tpl');
  31. $template->assign('content', $content);
  32. $template->display_one_col_template();