ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
52  case self::EMPTY_ENTRY:
53  $this->message = "Empty Entry " . $this->add_info;
54  break;
55  case self::PARSING_JSON_FAILED:
56  $this->message = "Parsing JSON Failed " . $this->add_info;
57  break;
58  case self::INVALID_MANDATORY_ENTRY_ATTRIBUTE:
59  $this->message = "Invalid mandatory entry Attribute: " . $this->add_info;
60  break;
61  case self::DUPLICATE_ENTRY:
62  $this->message = "There are entries with the same ID. Duplicate: " . $this->add_info;
63  break;
64  case self::DUPLICATE_ROOT_ENTRY:
65  $this->message = "There are multiple root entry. Duplicate: " . $this->add_info;
66  break;
67  case self::INVALID_ID:
68  $this->message = "No such ID found in list or tree: " . $this->add_info;
69  break;
70  case self::INVALID_CHARACTERS_IN_ID:
71  $this->message = "The ID given contains invalid characters: " . $this->add_info;
72  break;
73  case self::INVALID_FILE_PATH:
74  $this->message = "Invalid file path or file not readable: " . $this->add_info;
75  break;
76  case self::FILE_CREATION_FAILED:
77  $this->message = "File creation failed, path: " . $this->add_info;
78  break;
79  case self::FOLDER_CREATION_FAILED:
80  $this->message = "Folder creation failed, path: " . $this->add_info;
81  break;
82  case self::FOLDER_DELETION_FAILED:
83  $this->message = "Folder delation failed, path: " . $this->add_info;
84  break;
85  case self::FILE_DELETION_FAILED:
86  $this->message = "File delation failed, path: " . $this->add_info;
87  break;
88  case self::LESS_COMPILE_FAILED:
89  $this->message = "Compilation of less failed: " . $this->add_info;
90  break;
91  case self::FILE_OPENING_FAILED:
92  $this->message = "Failed to open file : " . $this->add_info;
93  break;
94  case self::SKIN_CSS_DOES_NOT_EXIST:
95  $this->message = "Skin CSS does not exist: " . $this->add_info;
96  break;
97  case self::SKIN_FOLDER_DOES_NOT_EXIST:
98  $this->message = "Skin folder does not exist: " . $this->add_info;
99  break;
100  case self::INVALID_RULES_ENTRY:
101  $this->message = "Invalid rules entry: " . $this->add_info;
102  break;
103  case self::NO_STYLE_ID:
104  $this->message = "No Style ID is given.";
105  break;
106  case self::NO_SKIN_ID:
107  $this->message = "No Skin ID is given.";
108  break;
109  case self::NOT_EXISTING_SKIN:
110  $this->message = "Skin does not exist: " . $this->add_info;
111  break;
112  case self::NOT_EXISTING_STYLE:
113  $this->message = "Style does not exist: " . $this->add_info;
114  break;
115  case self::SKIN_ALREADY_EXISTS:
116  $this->message = "Skin already exists: ".$this->add_info;
117  break;
118  case self::NO_PARENT_STYLE:
119  $this->message = "No parent style defined for style: ".$this->add_info;
120  break;
121  case self::SUBSTYLE_ASSIGNMENT_EXISTS:
122  $this->message = "The assignment of this substyle already exists: ".$this->add_info;
123  break;
124  case self::LESSC_NOT_INSTALLED:
125  $this->message = "No less compiler is installed";
126  break;
127  default:
128  $this->message = "Unknown Exception " . $this->add_info;
129  break;
130  }
131  }
132 }
Class for advanced editing exception handling in ILIAS.
Class for advanced editing exception handling in ILIAS.