Minor - format code

pull/2821/head
Julio 7 years ago
parent b9a622e660
commit a085fcd6dd
  1. 2
      main/survey/surveyUtil.class.php
  2. 50
      plugin/apaexportsurvey/ApaExportSurvey.php
  3. 2
      plugin/apaexportsurvey/export.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 $surveyId
* @param int $iconSize * @param int $iconSize

@ -1,8 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CTool;
/** /**
* Class ApaExportSurvey. * Class ApaExportSurvey.
*/ */
@ -37,30 +35,6 @@ class ApaExportSurvey extends Plugin
{ {
} }
/**
* 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']);
}
/** /**
* Uninstallation process. * Uninstallation process.
*/ */
@ -93,4 +67,28 @@ class ApaExportSurvey extends Plugin
api_get_path(WEB_PLUGIN_PATH).'apaexportsurvey/export.php?survey='.$surveyId.'&'.api_get_cidreq() 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']);
}
} }

@ -8,7 +8,7 @@ require_once __DIR__.'/../../main/inc/global.inc.php';
api_protect_course_script(true); api_protect_course_script(true);
api_protect_teacher_script(); 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); $surveyData = SurveyManager::get_survey($surveyId);
$courseId = api_get_course_int_id(); $courseId = api_get_course_int_id();

Loading…
Cancel
Save