public function showTask()
 {
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true;
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $tb_label = $ma->currentCanAccessObj('tb_label');
     if (!$tb_label) {
         $_SESSION['id_common_label'] = 0;
     } else {
         $id_common_label = Get::req('id_common_label', DOTY_INT, -1);
         if ($id_common_label >= 0) {
             $_SESSION['id_common_label'] = $id_common_label;
         } elseif ($id_common_label == -2) {
             $_SESSION['id_common_label'] = -1;
         }
         $block_list['labels'] = true;
     }
     if ($tb_label && $_SESSION['id_common_label'] == -1) {
         require_once _lms_ . '/admin/models/LabelAlms.php';
         $label_model = new LabelAlms();
         $user_label = $label_model->getLabelForUser(Docebo::user()->getId());
         $this->render('_labels', array('block_list' => $block_list, 'label' => $user_label));
     } else {
         if (!empty($block_list)) {
             $this->render('_tabs_block', array('block_list' => $block_list));
         } else {
             $this->render('_tabs', array());
         }
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $this->render('pluginslist', array('pluginslist' => $pluginslist));
 }
 public function show()
 {
     $model = new ClassroomLms();
     if (Get::sett('on_usercourse_empty') === 'on') {
         $conditions_t = array('cu.iduser = :id_user');
         $params_t = array(':id_user' => (int) Docebo::user()->getId());
         $cp_courses = $model->getUserCoursePathCourses(Docebo::user()->getIdst());
         if (!empty($cp_courses)) {
             $conditions_t[] = "cu.idCourse NOT IN (" . implode(",", $cp_courses) . ")";
         }
         $courselist_t = $model->findAll($conditions_t, $params_t);
         if (empty($courselist_t)) {
             Util::jump_to('index.php?r=lms/catalog/show&sop=unregistercourse');
         }
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     if ($ma->currentCanAccessObj('user_details_short')) {
         $block_list['user_details_short'] = true;
     }
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $tb_label = $ma->currentCanAccessObj('tb_label');
     if (!$tb_label) {
         $_SESSION['id_common_label'] = 0;
     } else {
         $id_common_label = Get::req('id_common_label', DOTY_INT, -1);
         if ($id_common_label >= 0) {
             $_SESSION['id_common_label'] = $id_common_label;
         } elseif ($id_common_label == -2) {
             $_SESSION['id_common_label'] = -1;
         }
         $block_list['labels'] = true;
     }
     if ($tb_label && $_SESSION['id_common_label'] == -1) {
         require_once _lms_ . '/admin/models/LabelAlms.php';
         $label_model = new LabelAlms();
         $user_label = $label_model->getLabelForUser(Docebo::user()->getId());
         $this->render('_labels', array('block_list' => $block_list, 'label' => $user_label));
     } else {
         if (!empty($block_list)) {
             $this->render('_tabs_block', array('block_list' => $block_list));
         } else {
             $this->render('_tabs', array());
         }
     }
 }
 public function showTask()
 {
     $model = new ElearningLms();
     if (Get::sett('on_usercourse_empty') === 'on') {
         $conditions_t = array('cu.iduser = :id_user');
         $params_t = array(':id_user' => (int) Docebo::user()->getId());
         $cp_courses = $model->getUserCoursePathCourses(Docebo::user()->getIdst());
         if (!empty($cp_courses)) {
             $conditions_t[] = "cu.idCourse NOT IN (" . implode(",", $cp_courses) . ")";
         }
         $courselist_t = $model->findAll($conditions_t, $params_t);
         if (empty($courselist_t)) {
             Util::jump_to('index.php?r=lms/catalog/show&sop=unregistercourse');
         }
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true;
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $tb_label = $ma->currentCanAccessObj('tb_label');
     if (!$tb_label) {
         $_SESSION['id_common_label'] = 0;
     } else {
         $id_common_label = Get::req('id_common_label', DOTY_INT, -1);
         if ($id_common_label >= 0) {
             $_SESSION['id_common_label'] = $id_common_label;
         } elseif ($id_common_label == -2) {
             $_SESSION['id_common_label'] = -1;
         }
         $block_list['labels'] = true;
     }
     if ($tb_label && $_SESSION['id_common_label'] == -1) {
         require_once _lms_ . '/admin/models/LabelAlms.php';
         $label_model = new LabelAlms();
         $user_label = $label_model->getLabelForUser(Docebo::user()->getId());
         $this->render('_labels', array('block_list' => $block_list, 'label' => $user_label));
     } else {
         if (!empty($block_list)) {
             $this->render('_tabs_block', array('block_list' => $block_list));
         } else {
             $this->render('_tabs', array());
         }
     }
     // add feedback:
     // - feedback_type: [err|inf] display error feedback or info feedback
     // - feedback_code: translation code of message
     // - feedback_extra: extrainfo concat at end message
     $feedback_code = Get::req('feedback_code', DOTY_STRING, "");
     $feedback_type = Get::req('feedback_type', DOTY_STRING, "");
     $feedback_extra = Get::req('feedback_extra', DOTY_STRING, "");
     switch ($feedback_type) {
         case "err":
             $msg = Lang::t($feedback_code, 'login') . " " . $feedback_extra;
             UIFeedback::error($msg);
             break;
         case "inf":
             $msg = Lang::t($feedback_code, 'login') . " " . $feedback_extra;
             UIFeedback::info($msg);
             break;
     }
 }