ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSystemStyleException.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Exceptions/classes/class.ilException.php';
5 require_once 'class.ilSystemStyleExceptionBase.php';
6 
15 {
17 
18  const EMPTY_ENTRY = 1001;
20  const DUPLICATE_ENTRY = 1003;
21  const DUPLICATE_ROOT_ENTRY = 1004;
22  const INVALID_ID = 1005;
23  const INVALID_FILE_PATH = 1006;
24  const INVALID_RULES_ENTRY = 1007;
26 
27  const FILE_CREATION_FAILED = 2001;
28  const FOLDER_CREATION_FAILED = 2002;
29  const FILE_OPENING_FAILED = 2003;
30  const LESS_COMPILE_FAILED = 2004;
31  const FOLDER_DELETION_FAILED = 2005;
32  const FILE_DELETION_FAILED = 2006;
33  const LESSC_NOT_INSTALLED = 2007;
34 
37 
38  const NO_STYLE_ID = 5001;
39  const NO_SKIN_ID = 5002;
40  const NO_PARENT_STYLE = 5003;
41  const NOT_EXISTING_STYLE = 5004;
42  const NOT_EXISTING_SKIN = 5005;
43 
44  const SKIN_ALREADY_EXISTS = 6001;
45 
47 
48  protected function assignMessageToCode()
49  {
50  switch ($this->code) {
51  case self::EMPTY_ENTRY:
52  $this->message = "Empty Entry " . $this->add_info;
53  break;
54  case self::PARSING_JSON_FAILED:
55  $this->message = "Parsing JSON Failed " . $this->add_info;
56  break;
57  case self::INVALID_MANDATORY_ENTRY_ATTRIBUTE:
58  $this->message = "Invalid mandatory entry Attribute: " . $this->add_info;
59  break;
60  case self::DUPLICATE_ENTRY:
61  $this->message = "There are entries with the same ID. Duplicate: " . $this->add_info;
62  break;
63  case self::DUPLICATE_ROOT_ENTRY:
64  $this->message = "There are multiple root entry. Duplicate: " . $this->add_info;
65  break;
66  case self::INVALID_ID:
67  $this->message = "No such ID found in list or tree: " . $this->add_info;
68  break;
69  case self::INVALID_CHARACTERS_IN_ID:
70  $this->message = "The ID given contains invalid characters: " . $this->add_info;
71  break;
72  case self::INVALID_FILE_PATH:
73  $this->message = "Invalid file path or file not readable: " . $this->add_info;
74  break;
75  case self::FILE_CREATION_FAILED:
76  $this->message = "File creation failed, path: " . $this->add_info;
77  break;
78  case self::FOLDER_CREATION_FAILED:
79  $this->message = "Folder creation failed, path: " . $this->add_info;
80  break;
81  case self::FOLDER_DELETION_FAILED:
82  $this->message = "Folder delation failed, path: " . $this->add_info;
83  break;
84  case self::FILE_DELETION_FAILED:
85  $this->message = "File delation failed, path: " . $this->add_info;
86  break;
87  case self::LESS_COMPILE_FAILED:
88  $this->message = "Compilation of less failed: " . $this->add_info;
89  break;
90  case self::FILE_OPENING_FAILED:
91  $this->message = "Failed to open file : " . $this->add_info;
92  break;
93  case self::SKIN_CSS_DOES_NOT_EXIST:
94  $this->message = "Skin CSS does not exist: " . $this->add_info;
95  break;
96  case self::SKIN_FOLDER_DOES_NOT_EXIST:
97  $this->message = "Skin folder does not exist: " . $this->add_info;
98  break;
99  case self::INVALID_RULES_ENTRY:
100  $this->message = "Invalid rules entry: " . $this->add_info;
101  break;
102  case self::NO_STYLE_ID:
103  $this->message = "No Style ID is given.";
104  break;
105  case self::NO_SKIN_ID:
106  $this->message = "No Skin ID is given.";
107  break;
108  case self::NOT_EXISTING_SKIN:
109  $this->message = "Skin does not exist: " . $this->add_info;
110  break;
111  case self::NOT_EXISTING_STYLE:
112  $this->message = "Style does not exist: " . $this->add_info;
113  break;
114  case self::SKIN_ALREADY_EXISTS:
115  $this->message = "Skin already exists: " . $this->add_info;
116  break;
117  case self::NO_PARENT_STYLE:
118  $this->message = "No parent style defined for style: " . $this->add_info;
119  break;
120  case self::SUBSTYLE_ASSIGNMENT_EXISTS:
121  $this->message = "The assignment of this substyle already exists: " . $this->add_info;
122  break;
123  case self::LESSC_NOT_INSTALLED:
124  $this->message = "No less compiler is installed";
125  break;
126  default:
127  $this->message = "Unknown Exception " . $this->add_info;
128  break;
129  }
130  }
131 }
Class for advanced editing exception handling in ILIAS.
Class for advanced editing exception handling in ILIAS.