Minor: Format code

pull/5880/head
Angel Fernando Quiroz Campos 11 months ago
parent 7c5857d456
commit e4b75cec33
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 4
      main/admin/export_exercise_results.php
  2. 2
      main/cron/forum_bulk_notification_to_course_teacher_for_new_post_in_last_X_days.php
  3. 2
      plugin/buycourses/src/stripe_success.php
  4. 6
      plugin/h5pimport/Entity/H5pImport.php
  5. 8
      plugin/h5pimport/Entity/H5pImportLibrary.php
  6. 10
      plugin/h5pimport/Entity/H5pImportResults.php
  7. 4
      plugin/h5pimport/src/H5pPackageImporter.php
  8. 8
      plugin/h5pimport/src/H5pPackageTools.php
  9. 6
      plugin/h5pimport/src/ZipPackageImporter.php
  10. 8
      plugin/h5pimport/src/ajax.php
  11. 2
      plugin/h5pimport/view.php
  12. 1
      plugin/onlyoffice/ajax/saveas.php
  13. 5
      plugin/onlyoffice/callback.php
  14. 1
      plugin/onlyoffice/create.php
  15. 3
      plugin/onlyoffice/editor.php
  16. 1
      plugin/onlyoffice/error.php
  17. 1
      plugin/onlyoffice/install.php
  18. 1
      plugin/onlyoffice/lib/langManager.php
  19. 2
      plugin/onlyoffice/lib/onlyofficeAppRequests.php
  20. 2
      plugin/onlyoffice/lib/onlyofficeDocumentManager.php
  21. 1
      plugin/onlyoffice/lib/onlyofficeSettingsFormBuilder.php
  22. 3
      plugin/onlyoffice/lib/onlyofficeTools.php
  23. 1
      plugin/onlyoffice/lib/templateManager.php
  24. 1
      plugin/onlyoffice/plugin.php
  25. 1
      plugin/onlyoffice/uninstall.php

@ -181,9 +181,9 @@ Display::display_header(get_lang('ExportExerciseAllResults'));
echo Display::return_message( echo Display::return_message(
get_lang('PleaseWaitThisCouldTakeAWhile'), get_lang('PleaseWaitThisCouldTakeAWhile'),
'normal', 'normal',
false, false
); );
echo $form->display(); $form->display();
Display::display_footer(); Display::display_footer();

@ -109,7 +109,7 @@ function sendMessage(
$toUserId, $toUserId,
$subject, $subject,
$content, $content,
1, 1
); );
} }

@ -45,7 +45,7 @@ if (!empty($globalParameters['sale_email'])) {
$plugin->get_lang('bc_subject'), $plugin->get_lang('bc_subject'),
$messageConfirmBuyerTemplate->fetch('buycourses/view/message_confirm_buyer.tpl'), $messageConfirmBuyerTemplate->fetch('buycourses/view/message_confirm_buyer.tpl'),
'', '',
$globalParameters['sale_email'], $globalParameters['sale_email']
); );
$messageConfirmTemplate = new Template(); $messageConfirmTemplate = new Template();

@ -74,7 +74,7 @@ class H5pImport
private $course; private $course;
/** /**
* @var null|Session * @var Session|null
* *
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session") * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* *
@ -83,14 +83,14 @@ class H5pImport
private $session; private $session;
/** /**
* @var null|string * @var string|null
* *
* @ORM\Column(name="name", type="text", nullable=true) * @ORM\Column(name="name", type="text", nullable=true)
*/ */
private $name; private $name;
/** /**
* @var null|string * @var string|null
* *
* @ORM\Column(name="description", type="text", nullable=true) * @ORM\Column(name="description", type="text", nullable=true)
*/ */

@ -298,24 +298,24 @@ class H5pImportLibrary extends EntityRepository
return $this; return $this;
} }
public function getCreatedAt(): \DateTime public function getCreatedAt(): DateTime
{ {
return $this->createdAt; return $this->createdAt;
} }
public function setCreatedAt(\DateTime $createdAt): H5pImportLibrary public function setCreatedAt(DateTime $createdAt): H5pImportLibrary
{ {
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
public function getModifiedAt(): \DateTime public function getModifiedAt(): DateTime
{ {
return $this->modifiedAt; return $this->modifiedAt;
} }
public function setModifiedAt(\DateTime $modifiedAt): H5pImportLibrary public function setModifiedAt(DateTime $modifiedAt): H5pImportLibrary
{ {
$this->modifiedAt = $modifiedAt; $this->modifiedAt = $modifiedAt;

@ -68,7 +68,7 @@ class H5pImportResults
private $course; private $course;
/** /**
* @var null|Session * @var Session|null
* *
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session") * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* *
@ -205,7 +205,7 @@ class H5pImportResults
return $this; return $this;
} }
public function getCreatedAt(): \DateTime public function getCreatedAt(): DateTime
{ {
return $this->createdAt; return $this->createdAt;
} }
@ -246,19 +246,19 @@ class H5pImportResults
return $this; return $this;
} }
public function setCreatedAt(\DateTime $createdAt): H5pImportResults public function setCreatedAt(DateTime $createdAt): H5pImportResults
{ {
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
public function getModifiedAt(): \DateTime public function getModifiedAt(): DateTime
{ {
return $this->modifiedAt; return $this->modifiedAt;
} }
public function setModifiedAt(\DateTime $modifiedAt): H5pImportResults public function setModifiedAt(DateTime $modifiedAt): H5pImportResults
{ {
$this->modifiedAt = $modifiedAt; $this->modifiedAt = $modifiedAt;

@ -65,9 +65,9 @@ abstract class H5pPackageImporter
/** /**
* Check the package and unzip it, checking if it has the 'h5p.json' file or some php script. * Check the package and unzip it, checking if it has the 'h5p.json' file or some php script.
* *
* @return mixed
*
* @throws \Exception * @throws \Exception
*
* @return mixed
*/ */
abstract public function import(): string; abstract public function import(): string;

@ -88,8 +88,8 @@ class H5pPackageTools
* @param string $packagePath the path to the H5P package file * @param string $packagePath the path to the H5P package file
* @param object $h5pJson the parsed H5P JSON object * @param object $h5pJson the parsed H5P JSON object
* @param Course $course the course entity related to the package * @param Course $course the course entity related to the package
* @param null|Session $session the session entity related to the package * @param Session|null $session the session entity related to the package
* @param null|array $values the advance options in upload form * @param array|null $values the advance options in upload form
*/ */
public static function storeH5pPackage( public static function storeH5pPackage(
string $packagePath, string $packagePath,
@ -196,7 +196,7 @@ class H5pPackageTools
* *
* @return array the core settings for H5P content * @return array the core settings for H5P content
*/ */
public static function getCoreSettings(H5pImport $h5pImport, \H5PCore $h5pCore): array public static function getCoreSettings(H5pImport $h5pImport, H5PCore $h5pCore): array
{ {
$originIsLearnpath = 'learnpath' === api_get_origin(); $originIsLearnpath = 'learnpath' === api_get_origin();
@ -270,7 +270,7 @@ class H5pPackageTools
* *
* @param mixed $h5pNode * @param mixed $h5pNode
*/ */
public static function getContentSettings($h5pNode, \H5PCore $h5pCore): array public static function getContentSettings($h5pNode, H5PCore $h5pCore): array
{ {
$filtered = $h5pCore->filterParameters($h5pNode); $filtered = $h5pCore->filterParameters($h5pNode);
$contentUserData = [ $contentUserData = [

@ -67,9 +67,9 @@ class ZipPackageImporter extends H5pPackageImporter
/** /**
* Import an H5P package. No DB change. * Import an H5P package. No DB change.
* *
* @return string The path to the extracted package directory.
*
* @throws Exception When the H5P package is invalid. * @throws Exception When the H5P package is invalid.
*
* @return string The path to the extracted package directory.
*/ */
public function import(): string public function import(): string
{ {
@ -160,7 +160,7 @@ class ZipPackageImporter extends H5pPackageImporter
while ($fs->exists($directoryPath)) { while ($fs->exists($directoryPath)) {
$modifiedName = $safeName.'_'.$counter; $modifiedName = $safeName.'_'.$counter;
$directoryPath = $baseDirectory.$modifiedName; $directoryPath = $baseDirectory.$modifiedName;
++$counter; $counter++;
} }
} }

@ -27,7 +27,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
} }
if (is_numeric($_POST['score']) && is_numeric($_POST['maxScore'])) { if (is_numeric($_POST['score']) && is_numeric($_POST['maxScore'])) {
/** @var null|H5pImport $h5pImport */ /** @var H5pImport|null $h5pImport */
$h5pImport = $h5pImportRepo->find($h5pId); $h5pImport = $h5pImportRepo->find($h5pId);
$entityManager = Database::getManager(); $entityManager = Database::getManager();
@ -48,7 +48,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
$lpObject = Session::read('oLP'); $lpObject = Session::read('oLP');
$clpItemViewRepo = $em->getRepository('ChamiloCourseBundle:CLpItemView'); $clpItemViewRepo = $em->getRepository('ChamiloCourseBundle:CLpItemView');
/** @var null|CLpItemView $lpItemView */ /** @var CLpItemView|null $lpItemView */
$lpItemView = $clpItemViewRepo->findOneBy( $lpItemView = $clpItemViewRepo->findOneBy(
[ [
'lpViewId' => $lpObject->lp_view_id, 'lpViewId' => $lpObject->lp_view_id,
@ -56,7 +56,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
] ]
); );
/** @var null|CLpItem $lpItem */ /** @var CLpItem|null $lpItem */
$lpItem = $entityManager->find('ChamiloCourseBundle:CLpItem', $lpItemView->getLpItemId()); $lpItem = $entityManager->find('ChamiloCourseBundle:CLpItem', $lpItemView->getLpItemId());
if ('h5p' !== $lpItem->getItemType()) { if ('h5p' !== $lpItem->getItemType()) {
return null; return null;
@ -83,7 +83,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
H5PCore::ajaxError($plugin->get_lang('h5p_error_invalid_token')); H5PCore::ajaxError($plugin->get_lang('h5p_error_invalid_token'));
} }
/** @var null|H5pImport $h5pImport */ /** @var H5pImport|null $h5pImport */
$h5pImport = $h5pImportRepo->find($h5pId); $h5pImport = $h5pImportRepo->find($h5pId);
} else { } else {
H5PCore::ajaxError(get_lang('InvalidAction')); H5PCore::ajaxError(get_lang('InvalidAction'));

@ -32,7 +32,7 @@ if (!$h5pImportId) {
api_not_allowed(true); api_not_allowed(true);
} }
/** @var null|H5pImport $h5pImport */ /** @var H5pImport|null $h5pImport */
$h5pImport = $embedRepo->find($h5pImportId); $h5pImport = $embedRepo->find($h5pImportId);
if (!$h5pImport) { if (!$h5pImport) {

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../../main/inc/global.inc.php'; require_once __DIR__.'/../../../main/inc/global.inc.php';
use ChamiloSession as Session; use ChamiloSession as Session;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
use ChamiloSession as Session; use ChamiloSession as Session;
@ -230,10 +229,10 @@ function emptyFile()
global $appSettings; global $appSettings;
global $jwtManager; global $jwtManager;
if ($type !== 'empty') { if ($type !== 'empty') {
$result['status'] = 'error'; $result['status'] = 'error';
$result['error'] = 'Download empty with other action'; $result['error'] = 'Download empty with other action';
return $result; return $result;
} }
@ -244,6 +243,7 @@ function emptyFile()
} catch (UnexpectedValueException $e) { } catch (UnexpectedValueException $e) {
$result['status'] = 'error'; $result['status'] = 'error';
$result['error'] = '403 Access denied'; $result['error'] = '403 Access denied';
return $result; return $result;
} }
} }
@ -253,6 +253,7 @@ function emptyFile()
if (!$template) { if (!$template) {
$result['status'] = 'error'; $result['status'] = 'error';
$result['error'] = 'File not found'; $result['error'] = 'File not found';
return $result; return $result;
} }

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
use ChamiloSession as Session; use ChamiloSession as Session;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
$plugin = OnlyofficePlugin::create(); $plugin = OnlyofficePlugin::create();
@ -50,7 +49,7 @@ $courseCode = $courseInfo['code'];
$docInfo = DocumentManager::get_document_data_by_id($docId, $courseCode, false, $sessionId); $docInfo = DocumentManager::get_document_data_by_id($docId, $courseCode, false, $sessionId);
$langInfo = LangManager::getLangUser(); $langInfo = LangManager::getLangUser();
$jwtManager = new OnlyofficeJwtManager($appSettings); $jwtManager = new OnlyofficeJwtManager($appSettings);
if (isset($_GET['forceEdit']) && (bool)$_GET['forceEdit'] === true) { if (isset($_GET['forceEdit']) && (bool) $_GET['forceEdit'] === true) {
$docInfo['forceEdit'] = $_GET['forceEdit']; $docInfo['forceEdit'] = $_GET['forceEdit'];
} }
$documentManager = new OnlyofficeDocumentManager($appSettings, $docInfo); $documentManager = new OnlyofficeDocumentManager($appSettings, $docInfo);

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
const ErrorStatus_UpdateOnlyoffice = 1; const ErrorStatus_UpdateOnlyoffice = 1;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
/* /*

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../../main/inc/global.inc.php'; require_once __DIR__.'/../../../main/inc/global.inc.php';
class LangManager class LangManager

@ -40,7 +40,7 @@ class OnlyofficeAppRequests extends RequestService
'sessionId' => api_get_session_id(), 'sessionId' => api_get_session_id(),
]; ];
$hashUrl = $this->jwtManager->getHash($data); $hashUrl = $this->jwtManager->getHash($data);
return api_get_path(WEB_PLUGIN_PATH).'onlyoffice/callback.php?hash='.$hashUrl; return api_get_path(WEB_PLUGIN_PATH).'onlyoffice/callback.php?hash='.$hashUrl;
} }
} }

@ -23,7 +23,7 @@ class OnlyofficeDocumentManager extends DocumentManager
public function __construct($settingsManager, array $docInfo, $formats = null, $systemLangCode = 'en') public function __construct($settingsManager, array $docInfo, $formats = null, $systemLangCode = 'en')
{ {
$formats = new OnlyofficeFormatsManager; $formats = new OnlyofficeFormatsManager();
parent::__construct($settingsManager, $formats, $systemLangCode); parent::__construct($settingsManager, $formats, $systemLangCode);
$this->docInfo = $docInfo; $this->docInfo = $docInfo;
} }

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../../main/inc/global.inc.php'; require_once __DIR__.'/../../../main/inc/global.inc.php';
class OnlyofficeSettingsFormBuilder class OnlyofficeSettingsFormBuilder

@ -152,7 +152,8 @@ class OnlyofficeTools
/** /**
* Return path to OnlyOffice viewer for a given file. * Return path to OnlyOffice viewer for a given file.
* @param int $documentId The ID from c_document.iid *
* @param int $documentId The ID from c_document.iid
* @param bool $showHeaders Whether to show Chamilo headers on top of the OnlyOffice frame or not * @param bool $showHeaders Whether to show Chamilo headers on top of the OnlyOffice frame or not
* *
* @return string A link to open the OnlyOffice viewer * @return string A link to open the OnlyOffice viewer

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../../main/inc/global.inc.php'; require_once __DIR__.'/../../../main/inc/global.inc.php';
class TemplateManager class TemplateManager

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/lib/onlyofficeSettingsFormBuilder.php'; require_once __DIR__.'/lib/onlyofficeSettingsFormBuilder.php';
require_once __DIR__.'/lib/onlyofficeAppSettings.php'; require_once __DIR__.'/lib/onlyofficeAppSettings.php';

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require_once __DIR__.'/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';
/* /*

Loading…
Cancel
Save