From a085fcd6ddabac6c80cf40bbd77db00a34c9a1d6 Mon Sep 17 00:00:00 2001 From: Julio Date: Fri, 15 Feb 2019 10:15:31 +0100 Subject: [PATCH] Minor - format code --- main/survey/surveyUtil.class.php | 2 +- plugin/apaexportsurvey/ApaExportSurvey.php | 50 +++++++++++----------- plugin/apaexportsurvey/export.php | 2 +- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/main/survey/surveyUtil.class.php b/main/survey/surveyUtil.class.php index 796b034d31..00b894fba3 100755 --- a/main/survey/surveyUtil.class.php +++ b/main/survey/surveyUtil.class.php @@ -2936,7 +2936,7 @@ class SurveyUtil } /** - * Get the additional actions added in survey_additional_teacher_modify_actions configuration + * Get the additional actions added in survey_additional_teacher_modify_actions configuration. * * @param int $surveyId * @param int $iconSize diff --git a/plugin/apaexportsurvey/ApaExportSurvey.php b/plugin/apaexportsurvey/ApaExportSurvey.php index 87920d510d..4edda23316 100644 --- a/plugin/apaexportsurvey/ApaExportSurvey.php +++ b/plugin/apaexportsurvey/ApaExportSurvey.php @@ -1,8 +1,6 @@ createQuery('SELECT c.id FROM ChamiloCoreBundle:Course c') - ->getResult(); - - foreach ($result as $item) { - $this->createLinkToCourseTool($this->get_name().':teacher', $item['id'], 'survey.png'); - } - } - - /** - * Remove all course tools created by plugin. - */ - private function removeLinkToCourseTools() - { - Database::getManager() - ->createQuery('DELETE FROM ChamiloCourseBundle:CTool t WHERE t.link LIKE :link AND t.category = :category') - ->execute(['link' => 'apaexportsurvey/start.php%', 'category' => 'plugin']); - } - /** * Uninstallation process. */ @@ -93,4 +67,28 @@ class ApaExportSurvey extends Plugin api_get_path(WEB_PLUGIN_PATH).'apaexportsurvey/export.php?survey='.$surveyId.'&'.api_get_cidreq() ); } + + /** + * Create tools for all courses. + */ + private function createLinkToCourseTools() + { + $result = Database::getManager() + ->createQuery('SELECT c.id FROM ChamiloCoreBundle:Course c') + ->getResult(); + + foreach ($result as $item) { + $this->createLinkToCourseTool($this->get_name().':teacher', $item['id'], 'survey.png'); + } + } + + /** + * Remove all course tools created by plugin. + */ + private function removeLinkToCourseTools() + { + Database::getManager() + ->createQuery('DELETE FROM ChamiloCourseBundle:CTool t WHERE t.link LIKE :link AND t.category = :category') + ->execute(['link' => 'apaexportsurvey/start.php%', 'category' => 'plugin']); + } } diff --git a/plugin/apaexportsurvey/export.php b/plugin/apaexportsurvey/export.php index 544b645e9b..a5c1bbacb2 100644 --- a/plugin/apaexportsurvey/export.php +++ b/plugin/apaexportsurvey/export.php @@ -8,7 +8,7 @@ require_once __DIR__.'/../../main/inc/global.inc.php'; api_protect_course_script(true); api_protect_teacher_script(); -$surveyId = isset($_GET['survey']) ? (int)$_GET['survey'] : 0; +$surveyId = isset($_GET['survey']) ? (int) $_GET['survey'] : 0; $surveyData = SurveyManager::get_survey($surveyId); $courseId = api_get_course_int_id();