ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
base.php File Reference

Go to the source code of this file.

Functions

 base ()
 

Function Documentation

◆ base()

base ( )

Definition at line 2 of file base.php.

References $_GET, $_SERVER, $DIC, and exit.

3 {
4  global $DIC;
5 
6  // Handle a file upload ajax request
7  if (isset($_GET['example']) && $_GET['example'] == 1) {
8  $upload = $DIC->upload();
9  try {
10  $upload->process();
11  // $upload->moveFilesTo('/myPath/'); // Since we are in an example here, we do not move the files. But this would be the way wou move files using the FileUpload-Service
12 
13  // The File-Dropzones will expect a valid json-Status (success true or false).
14  echo json_encode(['success' => true, 'message' => 'Successfully uploaded file']);
15  } catch (Exception $e) {
16  // See above
17  echo json_encode(['success' => false, 'message' => $e->getMessage()]);
18  }
19  exit();
20  }
21 
22  $uiFactory = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24 
25  $content = $uiFactory->panel()->standard('Panel', $uiFactory->legacy('Hello World, drag some files over me!'));
26  $uploadUrl = $_SERVER['REQUEST_URI'] . '&example=1';
27 
28  $upload = $uiFactory->dropzone()->file()->wrapper($uploadUrl, $content);
29 
30  return $renderer->render($upload);
31 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $DIC
Definition: saml.php:7
$_GET["client_id"]