From 046a724272ae30596190ed39ddf07fdd222c8d14 Mon Sep 17 00:00:00 2001 From: coderkun Date: Mon, 27 Apr 2015 16:42:05 +0200 Subject: [PATCH] merge --- .hgignore | 9 + .htaccess | 44 + agents/BottomlevelAgent.inc | 25 + agents/IntermediateAgent.inc | 49 + agents/ToplevelAgent.inc | 395 + agents/bottomlevel/MailreceiverAgent.inc | 38 + agents/bottomlevel/MenuAgent.inc | 40 + .../QuestgroupshierarchypathAgent.inc | 38 + agents/bottomlevel/SeminarybarAgent.inc | 38 + agents/bottomlevel/SeminarymenuAgent.inc | 38 + agents/bottomlevel/UserrolesAgent.inc | 38 + agents/bottomlevel/empty | 0 agents/intermediate/AchievementsAgent.inc | 38 + agents/intermediate/CharactergroupsAgent.inc | 38 + .../CharactergroupsquestsAgent.inc | 38 + agents/intermediate/CharactersAgent.inc | 49 + agents/intermediate/CharactertypesAgent.inc | 38 + agents/intermediate/ErrorAgent.inc | 38 + agents/intermediate/IntroductionAgent.inc | 38 + agents/intermediate/LibraryAgent.inc | 38 + agents/intermediate/MailAgent.inc | 38 + agents/intermediate/MapAgent.inc | 38 + agents/intermediate/MediaAgent.inc | 38 + agents/intermediate/QuestgroupsAgent.inc | 99 + .../QuestgroupshierarchyAgent.inc | 24 + agents/intermediate/QuestsAgent.inc | 123 + agents/intermediate/SeminariesAgent.inc | 38 + agents/intermediate/UploadsAgent.inc | 38 + agents/intermediate/UsersAgent.inc | 50 + agents/intermediate/XplevelsAgent.inc | 38 + agents/intermediate/empty | 0 agents/toplevel/AjaxAgent.inc | 80 + agents/toplevel/BinaryAgent.inc | 51 + agents/toplevel/FaultAgent.inc | 38 + agents/toplevel/HtmlAgent.inc | 156 + agents/toplevel/HtmlmailAgent.inc | 52 + agents/toplevel/TextmailAgent.inc | 54 + agents/toplevel/empty | 0 apis/WebApi.inc | 250 + app/Controller.inc | 134 + app/Model.inc | 42 + app/TextFormatter.inc | 149 + app/Utils.inc | 214 + app/agents/QuesttypeAgent.inc | 268 + app/agents/ToplevelAgent.inc | 43 + app/apis/MailApi.inc | 202 + app/controllers/IntermediateController.inc | 197 + app/controllers/QuesttypeController.inc | 320 + app/controllers/SeminaryController.inc | 328 + app/empty | 0 app/exceptions/FileCopyException.inc | 79 + app/exceptions/FileUploadException.inc | 79 + app/exceptions/MailingException.inc | 79 + app/exceptions/MaxFilesizeException.inc | 54 + .../QuesttypeAgentNotFoundException.inc | 79 + .../QuesttypeAgentNotValidException.inc | 79 + .../QuesttypeControllerNotFoundException.inc | 79 + .../QuesttypeControllerNotValidException.inc | 79 + .../QuesttypeModelNotFoundException.inc | 79 + .../QuesttypeModelNotValidException.inc | 79 + .../SubmissionNotValidException.inc | 79 + app/exceptions/WrongFiletypeException.inc | 79 + app/lib/PHPMailer.inc | 3453 ++ app/lib/PHPMailerAutoload.inc | 86 + app/lib/Password.inc | 316 + app/lib/SMTP.inc | 972 + app/models/QuesttypeModel.inc | 165 + app/requests/MailRequest.inc | 92 + app/responses/MailResponse.inc | 55 + app/views/QuesttypeView.inc | 76 + bootstrap.inc | 33 + configs/AppConfig.inc | 373 + configs/CoreConfig.inc | 167 + controllers/AchievementsController.inc | 960 + controllers/AjaxController.inc | 52 + controllers/BinaryController.inc | 37 + controllers/CharactergroupsController.inc | 759 + .../CharactergroupsquestsController.inc | 625 + controllers/CharactersController.inc | 695 + controllers/CharactertypesController.inc | 406 + controllers/ErrorController.inc | 51 + controllers/FaultController.inc | 37 + controllers/HtmlController.inc | 114 + controllers/HtmlmailController.inc | 54 + controllers/IntroductionController.inc | 37 + controllers/LibraryController.inc | 513 + controllers/MailController.inc | 136 + controllers/MailreceiverController.inc | 39 + controllers/MapController.inc | 72 + controllers/MediaController.inc | 597 + controllers/MenuController.inc | 52 + controllers/QuestgroupsController.inc | 757 + .../QuestgroupshierarchyController.inc | 346 + .../QuestgroupshierarchypathController.inc | 91 + controllers/QuestsController.inc | 1506 + controllers/SeminariesController.inc | 601 + controllers/SeminarybarController.inc | 89 + controllers/SeminarymenuController.inc | 53 + controllers/TextmailController.inc | 55 + controllers/UploadsController.inc | 318 + controllers/UserrolesController.inc | 47 + controllers/UsersController.inc | 641 + controllers/XplevelsController.inc | 188 + .../components/AchievementComponent.inc | 41 + controllers/components/AuthComponent.inc | 79 + .../components/NotificationComponent.inc | 108 + .../components/QuesttypedataComponent.inc | 89 + .../components/ValidationComponent.inc | 183 + controllers/components/empty | 0 controllers/empty | 0 core/Agent.inc | 608 + core/Api.inc | 163 + core/Autoloader.inc | 98 + core/ClassLoader.inc | 129 + core/Component.inc | 85 + core/Config.inc | 49 + core/Controller.inc | 431 + core/Driver.inc | 97 + core/Exception.inc | 65 + core/Linker.inc | 313 + core/Logger.inc | 143 + core/Model.inc | 141 + core/Request.inc | 64 + core/Response.inc | 158 + core/View.inc | 124 + core/WebUtils.inc | 75 + db/create.sql | 1956 + db/import.sql | 717 + db/procedures.sql | 151 + db/triggers.sql | 155 + doc/.htaccess | 5 + doc/classes/PHPMailer.html | 7052 ++++ doc/classes/SMTP.html | 2653 ++ doc/classes/hhu.z.Controller.html | 1870 + doc/classes/hhu.z.Model.html | 1292 + doc/classes/hhu.z.TextFormatter.html | 1117 + doc/classes/hhu.z.Utils.html | 1204 + doc/classes/hhu.z.agents.QuesttypeAgent.html | 2142 + doc/classes/hhu.z.agents.ToplevelAgent.html | 2264 ++ ....agents.bottomlevel.MailreceiverAgent.html | 1971 + .../hhu.z.agents.bottomlevel.MenuAgent.html | 1971 + ...omlevel.QuestgroupshierarchypathAgent.html | 1971 + ...z.agents.bottomlevel.SeminarybarAgent.html | 1971 + ....agents.bottomlevel.SeminarymenuAgent.html | 1971 + ...u.z.agents.bottomlevel.UserrolesAgent.html | 1971 + ...agents.intermediate.AchievementsAgent.html | 2012 + ...nts.intermediate.CharactergroupsAgent.html | 2012 + ...termediate.CharactergroupsquestsAgent.html | 2012 + ...z.agents.intermediate.CharactersAgent.html | 2052 + ...ents.intermediate.CharactertypesAgent.html | 2012 + .../hhu.z.agents.intermediate.ErrorAgent.html | 2012 + ...agents.intermediate.IntroductionAgent.html | 2012 + ...hu.z.agents.intermediate.LibraryAgent.html | 2012 + .../hhu.z.agents.intermediate.MailAgent.html | 2012 + .../hhu.z.agents.intermediate.MediaAgent.html | 2012 + ....agents.intermediate.QuestgroupsAgent.html | 2132 + ...ntermediate.QuestgroupshierarchyAgent.html | 1972 + ...hhu.z.agents.intermediate.QuestsAgent.html | 2292 ++ ...z.agents.intermediate.SeminariesAgent.html | 2012 + ...hu.z.agents.intermediate.UploadsAgent.html | 2012 + .../hhu.z.agents.intermediate.UsersAgent.html | 2052 + ...u.z.agents.intermediate.XplevelsAgent.html | 2012 + .../hhu.z.agents.toplevel.AjaxAgent.html | 2340 ++ .../hhu.z.agents.toplevel.BinaryAgent.html | 2305 ++ .../hhu.z.agents.toplevel.FaultAgent.html | 2324 ++ .../hhu.z.agents.toplevel.HtmlAgent.html | 2340 ++ .../hhu.z.agents.toplevel.HtmlmailAgent.html | 2305 ++ .../hhu.z.agents.toplevel.TextmailAgent.html | 2305 ++ doc/classes/hhu.z.apis.MailApi.html | 1437 + ....z.controllers.AchievementsController.html | 2615 ++ .../hhu.z.controllers.AjaxController.html | 1910 + .../hhu.z.controllers.BinaryController.html | 2148 + ...controllers.CharactergroupsController.html | 2736 ++ ...llers.CharactergroupsquestsController.html | 2516 ++ ...hu.z.controllers.CharactersController.html | 2569 ++ ....controllers.CharactertypesController.html | 2416 ++ .../hhu.z.controllers.ErrorController.html | 1920 + .../hhu.z.controllers.FaultController.html | 1788 + .../hhu.z.controllers.HtmlController.html | 1937 + .../hhu.z.controllers.HtmlmailController.html | 1786 + ....z.controllers.IntermediateController.html | 2100 + ....z.controllers.IntroductionController.html | 2148 + .../hhu.z.controllers.LibraryController.html | 2530 ++ .../hhu.z.controllers.MailController.html | 1957 + ....z.controllers.MailreceiverController.html | 1797 + .../hhu.z.controllers.MediaController.html | 2791 ++ .../hhu.z.controllers.MenuController.html | 1910 + ...u.z.controllers.QuestgroupsController.html | 2575 ++ ...ollers.QuestgroupshierarchyController.html | 2485 ++ ...rs.QuestgroupshierarchypathController.html | 1956 + .../hhu.z.controllers.QuestsController.html | 3121 ++ ...hhu.z.controllers.QuesttypeController.html | 2396 ++ ...hu.z.controllers.SeminariesController.html | 2484 ++ .../hhu.z.controllers.SeminaryController.html | 2206 ++ ...u.z.controllers.SeminarybarController.html | 1938 + ....z.controllers.SeminarymenuController.html | 1911 + .../hhu.z.controllers.TextmailController.html | 1787 + .../hhu.z.controllers.UploadsController.html | 2492 ++ ...hhu.z.controllers.UserrolesController.html | 1925 + .../hhu.z.controllers.UsersController.html | 2469 ++ .../hhu.z.controllers.XplevelsController.html | 2286 ++ ...llers.components.AchievementComponent.html | 1135 + ....controllers.components.AuthComponent.html | 1197 + ...lers.components.NotificationComponent.html | 1283 + ...ollers.components.ValidationComponent.html | 1367 + .../hhu.z.exceptions.FileUploadException.html | 1154 + .../hhu.z.exceptions.MailingException.html | 1154 + ...hhu.z.exceptions.MaxFilesizeException.html | 1087 + ...tions.QuesttypeAgentNotFoundException.html | 1154 + ...tions.QuesttypeAgentNotValidException.html | 1154 + ....QuesttypeControllerNotFoundException.html | 1154 + ....QuesttypeControllerNotValidException.html | 1154 + ...tions.QuesttypeModelNotFoundException.html | 1154 + ...tions.QuesttypeModelNotValidException.html | 1154 + ...xceptions.SubmissionNotValidException.html | 1154 + ...u.z.exceptions.WrongFiletypeException.html | 1154 + doc/classes/hhu.z.lib.PHPMailer.html | 979 + doc/classes/hhu.z.lib.PHPMailerAutoload.html | 979 + doc/classes/hhu.z.lib.Password.html | 979 + doc/classes/hhu.z.lib.SMTP.html | 979 + .../hhu.z.models.AchievementsModel.html | 3315 ++ doc/classes/hhu.z.models.AvatarsModel.html | 1467 + .../hhu.z.models.CharactergroupsModel.html | 2136 + ...u.z.models.CharactergroupsquestsModel.html | 1968 + .../hhu.z.models.CharacterrolesModel.html | 1399 + doc/classes/hhu.z.models.CharactersModel.html | 2198 ++ .../hhu.z.models.CharactertypesModel.html | 1571 + doc/classes/hhu.z.models.MediaModel.html | 1903 + .../hhu.z.models.QuestgroupsModel.html | 2491 ++ ...hu.z.models.QuestgroupshierarchyModel.html | 1706 + .../hhu.z.models.QuestgrouptextsModel.html | 1501 + doc/classes/hhu.z.models.QuestsModel.html | 2555 ++ doc/classes/hhu.z.models.QuesttextsModel.html | 1721 + .../hhu.z.models.QuesttopicsModel.html | 1935 + doc/classes/hhu.z.models.QuesttypeModel.html | 1416 + doc/classes/hhu.z.models.QuesttypesModel.html | 1349 + doc/classes/hhu.z.models.SeminariesModel.html | 1685 + ...z.models.SeminarycharacterfieldsModel.html | 1442 + doc/classes/hhu.z.models.UploadsModel.html | 1435 + doc/classes/hhu.z.models.UserrolesModel.html | 1437 + doc/classes/hhu.z.models.UsersModel.html | 1876 + doc/classes/hhu.z.models.XplevelsModel.html | 1497 + ....z.questtypes.BossfightQuesttypeAgent.html | 2157 + ...esttypes.BossfightQuesttypeController.html | 2451 ++ ....z.questtypes.BossfightQuesttypeModel.html | 1687 + ....questtypes.ChoiceinputQuesttypeAgent.html | 2157 + ...ttypes.ChoiceinputQuesttypeController.html | 2377 ++ ....questtypes.ChoiceinputQuesttypeModel.html | 1705 + ....z.questtypes.CrosswordQuesttypeAgent.html | 2157 + ...esttypes.CrosswordQuesttypeController.html | 2378 ++ ....z.questtypes.CrosswordQuesttypeModel.html | 1533 + ....z.questtypes.DragndropQuesttypeAgent.html | 2157 + ...esttypes.DragndropQuesttypeController.html | 2377 ++ ....z.questtypes.DragndropQuesttypeModel.html | 1657 + ...esttypes.MultiplechoiceQuesttypeAgent.html | 2157 + ...pes.MultiplechoiceQuesttypeController.html | 2466 ++ ...esttypes.MultiplechoiceQuesttypeModel.html | 1847 + ...hhu.z.questtypes.SubmitQuesttypeAgent.html | 2157 + ....questtypes.SubmitQuesttypeController.html | 2382 ++ ...hhu.z.questtypes.SubmitQuesttypeModel.html | 1655 + ....z.questtypes.TextinputQuesttypeAgent.html | 2157 + ...esttypes.TextinputQuesttypeController.html | 2420 ++ ....z.questtypes.TextinputQuesttypeModel.html | 1696 + doc/classes/hhu.z.requests.MailRequest.html | 1266 + doc/classes/hhu.z.responses.MailResponse.html | 1464 + doc/classes/hhu.z.views.QuesttypeView.html | 1166 + doc/classes/nre.agents.BottomlevelAgent.html | 1931 + doc/classes/nre.agents.IntermediateAgent.html | 1970 + doc/classes/nre.agents.ToplevelAgent.html | 2249 ++ doc/classes/nre.apis.WebApi.html | 1333 + doc/classes/nre.configs.AppConfig.html | 1307 + doc/classes/nre.configs.CoreConfig.html | 1261 + doc/classes/nre.core.Agent.html | 1882 + doc/classes/nre.core.Api.html | 1253 + doc/classes/nre.core.Autoloader.html | 1107 + doc/classes/nre.core.ClassLoader.html | 1196 + doc/classes/nre.core.Component.html | 1069 + doc/classes/nre.core.Config.html | 989 + doc/classes/nre.core.Controller.html | 1720 + doc/classes/nre.core.Driver.html | 1100 + doc/classes/nre.core.Exception.html | 1037 + doc/classes/nre.core.Linker.html | 1309 + doc/classes/nre.core.Logger.html | 1251 + doc/classes/nre.core.Model.html | 1148 + doc/classes/nre.core.Request.html | 1064 + doc/classes/nre.core.Response.html | 1348 + doc/classes/nre.core.View.html | 1158 + doc/classes/nre.core.WebUtils.html | 1095 + doc/classes/nre.drivers.DatabaseDriver.html | 1260 + doc/classes/nre.drivers.MysqliDriver.html | 1433 + .../nre.exceptions.AccessDeniedException.html | 1074 + ...re.exceptions.ActionNotFoundException.html | 1144 + ...nre.exceptions.AgentNotFoundException.html | 1180 + ...nre.exceptions.AgentNotValidException.html | 1180 + ...nre.exceptions.ClassNotFoundException.html | 1154 + ...nre.exceptions.ClassNotValidException.html | 1154 + ...exceptions.ComponentNotFoundException.html | 1180 + ...exceptions.ComponentNotValidException.html | 1180 + ...xceptions.ControllerNotFoundException.html | 1180 + ...xceptions.ControllerNotValidException.html | 1180 + .../nre.exceptions.DatamodelException.html | 1205 + ...re.exceptions.DriverNotFoundException.html | 1180 + ...re.exceptions.DriverNotValidException.html | 1180 + ...re.exceptions.FatalDatamodelException.html | 1204 + .../nre.exceptions.IdNotFoundException.html | 1144 + ...re.exceptions.LayoutNotFoundException.html | 1214 + ...re.exceptions.LayoutNotValidException.html | 1214 + ...nre.exceptions.ModelNotFoundException.html | 1180 + ...nre.exceptions.ModelNotValidException.html | 1180 + ...re.exceptions.ParamsNotValidException.html | 1144 + ...xceptions.ServiceUnavailableException.html | 1144 + .../nre.exceptions.ViewNotFoundException.html | 1144 + doc/classes/nre.models.DatabaseModel.html | 1293 + doc/classes/nre.requests.WebRequest.html | 1762 + doc/classes/nre.responses.WebResponse.html | 1705 + doc/classes/phpmailerException.html | 975 + doc/css/bootstrap-combined.no-icons.min.css | 732 + doc/css/font-awesome.min.css | 403 + doc/css/jquery.iviewer.css | 65 + doc/css/phpdocumentor-clean-icons/Read Me.txt | 3 + .../fonts/phpdocumentor-clean-icons.dev.svg | 17 + .../fonts/phpdocumentor-clean-icons.eot | Bin 0 -> 2324 bytes .../fonts/phpdocumentor-clean-icons.svg | 17 + .../fonts/phpdocumentor-clean-icons.ttf | Bin 0 -> 2080 bytes .../fonts/phpdocumentor-clean-icons.woff | Bin 0 -> 1832 bytes doc/css/phpdocumentor-clean-icons/lte-ie7.js | 30 + doc/css/phpdocumentor-clean-icons/style.css | 48 + doc/css/prism.css | 204 + doc/css/template.css | 429 + doc/empty | 0 doc/files/agents.BottomlevelAgent.html | 916 + doc/files/agents.IntermediateAgent.html | 916 + doc/files/agents.ToplevelAgent.html | 916 + .../agents.bottomlevel.MailreceiverAgent.html | 915 + doc/files/agents.bottomlevel.MenuAgent.html | 915 + ...omlevel.QuestgroupshierarchypathAgent.html | 915 + .../agents.bottomlevel.SeminarybarAgent.html | 915 + .../agents.bottomlevel.SeminarymenuAgent.html | 915 + .../agents.bottomlevel.UserrolesAgent.html | 915 + ...agents.intermediate.AchievementsAgent.html | 915 + ...nts.intermediate.CharactergroupsAgent.html | 915 + ...termediate.CharactergroupsquestsAgent.html | 915 + .../agents.intermediate.CharactersAgent.html | 915 + ...ents.intermediate.CharactertypesAgent.html | 915 + doc/files/agents.intermediate.ErrorAgent.html | 915 + ...agents.intermediate.IntroductionAgent.html | 915 + .../agents.intermediate.LibraryAgent.html | 915 + doc/files/agents.intermediate.MailAgent.html | 915 + doc/files/agents.intermediate.MediaAgent.html | 915 + .../agents.intermediate.QuestgroupsAgent.html | 915 + ...ntermediate.QuestgroupshierarchyAgent.html | 915 + .../agents.intermediate.QuestsAgent.html | 915 + .../agents.intermediate.SeminariesAgent.html | 915 + .../agents.intermediate.UploadsAgent.html | 915 + doc/files/agents.intermediate.UsersAgent.html | 915 + .../agents.intermediate.XplevelsAgent.html | 915 + doc/files/agents.toplevel.AjaxAgent.html | 915 + doc/files/agents.toplevel.BinaryAgent.html | 915 + doc/files/agents.toplevel.FaultAgent.html | 915 + doc/files/agents.toplevel.HtmlAgent.html | 915 + doc/files/agents.toplevel.HtmlmailAgent.html | 915 + doc/files/agents.toplevel.TextmailAgent.html | 915 + doc/files/agents/BottomlevelAgent.inc.txt | 26 + doc/files/agents/IntermediateAgent.inc.txt | 50 + doc/files/agents/ToplevelAgent.inc.txt | 396 + .../bottomlevel/MailreceiverAgent.inc.txt | 39 + .../agents/bottomlevel/MenuAgent.inc.txt | 41 + .../QuestgroupshierarchypathAgent.inc.txt | 39 + .../bottomlevel/SeminarybarAgent.inc.txt | 39 + .../bottomlevel/SeminarymenuAgent.inc.txt | 39 + .../agents/bottomlevel/UserrolesAgent.inc.txt | 39 + .../intermediate/AchievementsAgent.inc.txt | 39 + .../intermediate/CharactergroupsAgent.inc.txt | 39 + .../CharactergroupsquestsAgent.inc.txt | 39 + .../intermediate/CharactersAgent.inc.txt | 50 + .../intermediate/CharactertypesAgent.inc.txt | 39 + .../agents/intermediate/ErrorAgent.inc.txt | 39 + .../intermediate/IntroductionAgent.inc.txt | 39 + .../agents/intermediate/LibraryAgent.inc.txt | 39 + .../agents/intermediate/MailAgent.inc.txt | 39 + .../agents/intermediate/MediaAgent.inc.txt | 39 + .../intermediate/QuestgroupsAgent.inc.txt | 76 + .../QuestgroupshierarchyAgent.inc.txt | 25 + .../agents/intermediate/QuestsAgent.inc.txt | 124 + .../intermediate/SeminariesAgent.inc.txt | 39 + .../agents/intermediate/UploadsAgent.inc.txt | 39 + .../agents/intermediate/UsersAgent.inc.txt | 51 + .../agents/intermediate/XplevelsAgent.inc.txt | 39 + doc/files/agents/toplevel/AjaxAgent.inc.txt | 81 + doc/files/agents/toplevel/BinaryAgent.inc.txt | 52 + doc/files/agents/toplevel/FaultAgent.inc.txt | 39 + doc/files/agents/toplevel/HtmlAgent.inc.txt | 86 + .../agents/toplevel/HtmlmailAgent.inc.txt | 53 + .../agents/toplevel/TextmailAgent.inc.txt | 55 + doc/files/apis.WebApi.html | 915 + doc/files/apis/WebApi.inc.txt | 251 + doc/files/app.Controller.html | 915 + doc/files/app.Model.html | 915 + doc/files/app.TextFormatter.html | 915 + doc/files/app.Utils.html | 915 + doc/files/app.agents.QuesttypeAgent.html | 915 + doc/files/app.agents.ToplevelAgent.html | 915 + doc/files/app.apis.MailApi.html | 915 + ...pp.controllers.IntermediateController.html | 915 + .../app.controllers.QuesttypeController.html | 915 + .../app.controllers.SeminaryController.html | 916 + .../app.exceptions.FileUploadException.html | 915 + .../app.exceptions.MailingException.html | 915 + .../app.exceptions.MaxFilesizeException.html | 915 + ...tions.QuesttypeAgentNotFoundException.html | 915 + ...tions.QuesttypeAgentNotValidException.html | 915 + ....QuesttypeControllerNotFoundException.html | 915 + ....QuesttypeControllerNotValidException.html | 915 + ...tions.QuesttypeModelNotFoundException.html | 915 + ...tions.QuesttypeModelNotValidException.html | 915 + ...xceptions.SubmissionNotValidException.html | 915 + ...app.exceptions.WrongFiletypeException.html | 915 + doc/files/app.lib.PHPMailer.html | 923 + doc/files/app.lib.PHPMailerAutoload.html | 1008 + doc/files/app.lib.Password.html | 1205 + doc/files/app.lib.SMTP.html | 919 + doc/files/app.models.QuesttypeModel.html | 915 + doc/files/app.requests.MailRequest.html | 915 + doc/files/app.responses.MailResponse.html | 915 + doc/files/app.views.QuesttypeView.html | 915 + doc/files/app/Controller.inc.txt | 132 + doc/files/app/Model.inc.txt | 43 + doc/files/app/TextFormatter.inc.txt | 150 + doc/files/app/Utils.inc.txt | 215 + doc/files/app/agents/QuesttypeAgent.inc.txt | 286 + doc/files/app/agents/ToplevelAgent.inc.txt | 44 + doc/files/app/apis/MailApi.inc.txt | 203 + .../IntermediateController.inc.txt | 198 + .../controllers/QuesttypeController.inc.txt | 321 + .../controllers/SeminaryController.inc.txt | 329 + .../exceptions/FileUploadException.inc.txt | 80 + .../app/exceptions/MailingException.inc.txt | 80 + .../exceptions/MaxFilesizeException.inc.txt | 55 + .../QuesttypeAgentNotFoundException.inc.txt | 80 + .../QuesttypeAgentNotValidException.inc.txt | 80 + ...esttypeControllerNotFoundException.inc.txt | 80 + ...esttypeControllerNotValidException.inc.txt | 80 + .../QuesttypeModelNotFoundException.inc.txt | 80 + .../QuesttypeModelNotValidException.inc.txt | 80 + .../SubmissionNotValidException.inc.txt | 80 + .../exceptions/WrongFiletypeException.inc.txt | 80 + doc/files/app/lib/PHPMailer.inc.txt | 3454 ++ doc/files/app/lib/PHPMailerAutoload.inc.txt | 87 + doc/files/app/lib/Password.inc.txt | 317 + doc/files/app/lib/SMTP.inc.txt | 973 + doc/files/app/models/QuesttypeModel.inc.txt | 155 + doc/files/app/requests/MailRequest.inc.txt | 93 + doc/files/app/responses/MailResponse.inc.txt | 56 + doc/files/app/views/QuesttypeView.inc.txt | 77 + doc/files/bootstrap.html | 883 + doc/files/bootstrap.inc.txt | 34 + doc/files/configs.AppConfig.html | 915 + doc/files/configs.CoreConfig.html | 915 + doc/files/configs/AppConfig.inc.txt | 371 + doc/files/configs/CoreConfig.inc.txt | 168 + .../controllers.AchievementsController.html | 915 + doc/files/controllers.AjaxController.html | 915 + doc/files/controllers.BinaryController.html | 915 + ...controllers.CharactergroupsController.html | 915 + ...llers.CharactergroupsquestsController.html | 916 + .../controllers.CharactersController.html | 915 + .../controllers.CharactertypesController.html | 916 + doc/files/controllers.ErrorController.html | 915 + doc/files/controllers.FaultController.html | 915 + doc/files/controllers.HtmlController.html | 915 + doc/files/controllers.HtmlmailController.html | 915 + .../controllers.IntroductionController.html | 915 + doc/files/controllers.LibraryController.html | 915 + doc/files/controllers.MailController.html | 915 + .../controllers.MailreceiverController.html | 916 + doc/files/controllers.MediaController.html | 915 + doc/files/controllers.MenuController.html | 915 + .../controllers.QuestgroupsController.html | 915 + ...ollers.QuestgroupshierarchyController.html | 915 + ...rs.QuestgroupshierarchypathController.html | 916 + doc/files/controllers.QuestsController.html | 915 + .../controllers.SeminariesController.html | 915 + .../controllers.SeminarybarController.html | 916 + .../controllers.SeminarymenuController.html | 916 + doc/files/controllers.TextmailController.html | 916 + doc/files/controllers.UploadsController.html | 915 + .../controllers.UserrolesController.html | 915 + doc/files/controllers.UsersController.html | 915 + doc/files/controllers.XplevelsController.html | 916 + ...llers.components.AchievementComponent.html | 915 + .../controllers.components.AuthComponent.html | 915 + ...lers.components.NotificationComponent.html | 915 + ...ollers.components.ValidationComponent.html | 915 + .../AchievementsController.inc.txt | 961 + doc/files/controllers/AjaxController.inc.txt | 53 + .../controllers/BinaryController.inc.txt | 38 + .../CharactergroupsController.inc.txt | 760 + .../CharactergroupsquestsController.inc.txt | 616 + .../controllers/CharactersController.inc.txt | 696 + .../CharactertypesController.inc.txt | 407 + doc/files/controllers/ErrorController.inc.txt | 52 + doc/files/controllers/FaultController.inc.txt | 38 + doc/files/controllers/HtmlController.inc.txt | 112 + .../controllers/HtmlmailController.inc.txt | 55 + .../IntroductionController.inc.txt | 38 + .../controllers/LibraryController.inc.txt | 514 + doc/files/controllers/MailController.inc.txt | 137 + .../MailreceiverController.inc.txt | 40 + doc/files/controllers/MediaController.inc.txt | 563 + doc/files/controllers/MenuController.inc.txt | 53 + .../controllers/QuestgroupsController.inc.txt | 715 + .../QuestgroupshierarchyController.inc.txt | 347 + ...QuestgroupshierarchypathController.inc.txt | 92 + .../controllers/QuestsController.inc.txt | 1507 + .../controllers/SeminariesController.inc.txt | 468 + .../controllers/SeminarybarController.inc.txt | 90 + .../SeminarymenuController.inc.txt | 54 + .../controllers/TextmailController.inc.txt | 56 + .../controllers/UploadsController.inc.txt | 319 + .../controllers/UserrolesController.inc.txt | 48 + doc/files/controllers/UsersController.inc.txt | 617 + .../controllers/XplevelsController.inc.txt | 189 + .../components/AchievementComponent.inc.txt | 42 + .../components/AuthComponent.inc.txt | 80 + .../components/NotificationComponent.inc.txt | 109 + .../components/ValidationComponent.inc.txt | 184 + doc/files/core.Agent.html | 915 + doc/files/core.Api.html | 915 + doc/files/core.Autoloader.html | 915 + doc/files/core.ClassLoader.html | 915 + doc/files/core.Component.html | 915 + doc/files/core.Config.html | 915 + doc/files/core.Controller.html | 915 + doc/files/core.Driver.html | 915 + doc/files/core.Exception.html | 915 + doc/files/core.Linker.html | 915 + doc/files/core.Logger.html | 915 + doc/files/core.Model.html | 915 + doc/files/core.Request.html | 915 + doc/files/core.Response.html | 915 + doc/files/core.View.html | 915 + doc/files/core.WebUtils.html | 915 + doc/files/core/Agent.inc.txt | 609 + doc/files/core/Api.inc.txt | 164 + doc/files/core/Autoloader.inc.txt | 99 + doc/files/core/ClassLoader.inc.txt | 130 + doc/files/core/Component.inc.txt | 86 + doc/files/core/Config.inc.txt | 50 + doc/files/core/Controller.inc.txt | 431 + doc/files/core/Driver.inc.txt | 98 + doc/files/core/Exception.inc.txt | 66 + doc/files/core/Linker.inc.txt | 314 + doc/files/core/Logger.inc.txt | 133 + doc/files/core/Model.inc.txt | 142 + doc/files/core/Request.inc.txt | 65 + doc/files/core/Response.inc.txt | 159 + doc/files/core/View.inc.txt | 125 + doc/files/core/WebUtils.inc.txt | 76 + doc/files/drivers.DatabaseDriver.html | 915 + doc/files/drivers.MysqliDriver.html | 915 + doc/files/drivers/DatabaseDriver.inc.txt | 88 + doc/files/drivers/MysqliDriver.inc.txt | 170 + .../exceptions.AccessDeniedException.html | 915 + .../exceptions.ActionNotFoundException.html | 915 + .../exceptions.AgentNotFoundException.html | 915 + .../exceptions.AgentNotValidException.html | 915 + .../exceptions.ClassNotFoundException.html | 915 + .../exceptions.ClassNotValidException.html | 915 + ...exceptions.ComponentNotFoundException.html | 915 + ...exceptions.ComponentNotValidException.html | 915 + ...xceptions.ControllerNotFoundException.html | 915 + ...xceptions.ControllerNotValidException.html | 915 + doc/files/exceptions.DatamodelException.html | 915 + .../exceptions.DriverNotFoundException.html | 915 + .../exceptions.DriverNotValidException.html | 915 + .../exceptions.FatalDatamodelException.html | 915 + doc/files/exceptions.IdNotFoundException.html | 915 + .../exceptions.LayoutNotFoundException.html | 915 + .../exceptions.LayoutNotValidException.html | 915 + .../exceptions.ModelNotFoundException.html | 915 + .../exceptions.ModelNotValidException.html | 915 + .../exceptions.ParamsNotValidException.html | 915 + ...xceptions.ServiceUnavailableException.html | 915 + .../exceptions.ViewNotFoundException.html | 915 + .../exceptions/AccessDeniedException.inc.txt | 52 + .../ActionNotFoundException.inc.txt | 78 + .../exceptions/AgentNotFoundException.inc.txt | 68 + .../exceptions/AgentNotValidException.inc.txt | 68 + .../exceptions/ClassNotFoundException.inc.txt | 80 + .../exceptions/ClassNotValidException.inc.txt | 80 + .../ComponentNotFoundException.inc.txt | 68 + .../ComponentNotValidException.inc.txt | 68 + .../ControllerNotFoundException.inc.txt | 68 + .../ControllerNotValidException.inc.txt | 68 + .../exceptions/DatamodelException.inc.txt | 100 + .../DriverNotFoundException.inc.txt | 69 + .../DriverNotValidException.inc.txt | 69 + .../FatalDatamodelException.inc.txt | 97 + .../exceptions/IdNotFoundException.inc.txt | 78 + .../LayoutNotFoundException.inc.txt | 69 + .../LayoutNotValidException.inc.txt | 68 + .../exceptions/ModelNotFoundException.inc.txt | 68 + .../exceptions/ModelNotValidException.inc.txt | 69 + .../ParamsNotValidException.inc.txt | 78 + .../ServiceUnavailableException.inc.txt | 78 + .../exceptions/ViewNotFoundException.inc.txt | 78 + doc/files/models.AchievementsModel.html | 915 + doc/files/models.AvatarsModel.html | 915 + doc/files/models.CharactergroupsModel.html | 916 + .../models.CharactergroupsquestsModel.html | 916 + doc/files/models.CharacterrolesModel.html | 915 + doc/files/models.CharactersModel.html | 915 + doc/files/models.CharactertypesModel.html | 915 + doc/files/models.DatabaseModel.html | 915 + doc/files/models.MediaModel.html | 915 + doc/files/models.QuestgroupsModel.html | 915 + .../models.QuestgroupshierarchyModel.html | 915 + doc/files/models.QuestgrouptextsModel.html | 915 + doc/files/models.QuestsModel.html | 915 + doc/files/models.QuesttextsModel.html | 915 + doc/files/models.QuesttopicsModel.html | 915 + doc/files/models.QuesttypesModel.html | 915 + doc/files/models.SeminariesModel.html | 915 + .../models.SeminarycharacterfieldsModel.html | 915 + doc/files/models.UploadsModel.html | 915 + doc/files/models.UserrolesModel.html | 915 + doc/files/models.UsersModel.html | 915 + doc/files/models.XplevelsModel.html | 915 + doc/files/models/AchievementsModel.inc.txt | 1174 + doc/files/models/AvatarsModel.inc.txt | 147 + doc/files/models/CharactergroupsModel.inc.txt | 506 + .../models/CharactergroupsquestsModel.inc.txt | 392 + doc/files/models/CharacterrolesModel.inc.txt | 101 + doc/files/models/CharactersModel.inc.txt | 698 + doc/files/models/CharactertypesModel.inc.txt | 217 + doc/files/models/DatabaseModel.inc.txt | 84 + doc/files/models/MediaModel.inc.txt | 498 + doc/files/models/QuestgroupsModel.inc.txt | 871 + .../models/QuestgroupshierarchyModel.inc.txt | 320 + doc/files/models/QuestgrouptextsModel.inc.txt | 182 + doc/files/models/QuestsModel.inc.txt | 714 + doc/files/models/QuesttextsModel.inc.txt | 333 + doc/files/models/QuesttopicsModel.inc.txt | 401 + doc/files/models/QuesttypesModel.inc.txt | 78 + doc/files/models/SeminariesModel.inc.txt | 243 + .../SeminarycharacterfieldsModel.inc.txt | 130 + doc/files/models/UploadsModel.inc.txt | 142 + doc/files/models/UserrolesModel.inc.txt | 121 + doc/files/models/UsersModel.inc.txt | 405 + doc/files/models/XplevelsModel.inc.txt | 201 + ...pes.bossfight.BossfightQuesttypeAgent.html | 915 + ...ossfight.BossfightQuesttypeController.html | 915 + ...pes.bossfight.BossfightQuesttypeModel.html | 915 + ...choiceinput.ChoiceinputQuesttypeAgent.html | 915 + ...einput.ChoiceinputQuesttypeController.html | 916 + ...choiceinput.ChoiceinputQuesttypeModel.html | 916 + ...pes.crossword.CrosswordQuesttypeAgent.html | 915 + ...rossword.CrosswordQuesttypeController.html | 915 + ...pes.crossword.CrosswordQuesttypeModel.html | 915 + ...pes.dragndrop.DragndropQuesttypeAgent.html | 915 + ...ragndrop.DragndropQuesttypeController.html | 915 + ...pes.dragndrop.DragndropQuesttypeModel.html | 915 + ...lechoice.MultiplechoiceQuesttypeAgent.html | 915 + ...ice.MultiplechoiceQuesttypeController.html | 915 + ...lechoice.MultiplechoiceQuesttypeModel.html | 915 + ...uesttypes.submit.SubmitQuesttypeAgent.html | 915 + ...ypes.submit.SubmitQuesttypeController.html | 915 + ...uesttypes.submit.SubmitQuesttypeModel.html | 915 + ...pes.textinput.TextinputQuesttypeAgent.html | 915 + ...extinput.TextinputQuesttypeController.html | 915 + ...pes.textinput.TextinputQuesttypeModel.html | 915 + .../bossfight/BossfightQuesttypeAgent.inc.txt | 25 + .../BossfightQuesttypeController.inc.txt | 293 + .../bossfight/BossfightQuesttypeModel.inc.txt | 184 + .../ChoiceinputQuesttypeAgent.inc.txt | 25 + .../ChoiceinputQuesttypeController.inc.txt | 300 + .../ChoiceinputQuesttypeModel.inc.txt | 296 + .../crossword/CrosswordQuesttypeAgent.inc.txt | 25 + .../CrosswordQuesttypeController.inc.txt | 381 + .../crossword/CrosswordQuesttypeModel.inc.txt | 94 + .../dragndrop/DragndropQuesttypeAgent.inc.txt | 25 + .../DragndropQuesttypeController.inc.txt | 233 + .../dragndrop/DragndropQuesttypeModel.inc.txt | 181 + .../MultiplechoiceQuesttypeAgent.inc.txt | 25 + .../MultiplechoiceQuesttypeController.inc.txt | 386 + .../MultiplechoiceQuesttypeModel.inc.txt | 269 + .../submit/SubmitQuesttypeAgent.inc.txt | 25 + .../submit/SubmitQuesttypeController.inc.txt | 242 + .../submit/SubmitQuesttypeModel.inc.txt | 145 + .../textinput/TextinputQuesttypeAgent.inc.txt | 25 + .../TextinputQuesttypeController.inc.txt | 308 + .../textinput/TextinputQuesttypeModel.inc.txt | 222 + doc/files/requests.WebRequest.html | 915 + doc/files/requests/WebRequest.inc.txt | 402 + doc/files/responses.WebResponse.html | 915 + doc/files/responses/WebResponse.inc.txt | 251 + doc/files/www.index.html | 975 + doc/files/www/index.php.txt | 46 + doc/font/FontAwesome.otf | Bin 0 -> 75188 bytes doc/font/fontawesome-webfont.eot | Bin 0 -> 72449 bytes doc/font/fontawesome-webfont.svg | 504 + doc/font/fontawesome-webfont.ttf | Bin 0 -> 141564 bytes doc/font/fontawesome-webfont.woff | Bin 0 -> 83760 bytes doc/graphs/class.html | 174 + doc/graphs/classes.svg | 1846 + doc/images/apple-touch-icon-114x114.png | Bin 0 -> 28338 bytes doc/images/apple-touch-icon-72x72.png | Bin 0 -> 12751 bytes doc/images/apple-touch-icon.png | Bin 0 -> 8358 bytes doc/images/custom-icons.svg | 116 + doc/images/favicon.ico | Bin 0 -> 1150 bytes doc/images/hierarchy-item.png | Bin 0 -> 236 bytes doc/images/icon-class-13x13.png | Bin 0 -> 428 bytes doc/images/icon-class.svg | 77 + doc/images/icon-interface-13x13.png | Bin 0 -> 308 bytes doc/images/icon-interface.svg | 73 + doc/images/icon-trait-13x13.png | Bin 0 -> 340 bytes doc/images/icon-trait.svg | 73 + doc/images/iviewer/grab.cur | Bin 0 -> 1150 bytes doc/images/iviewer/hand.cur | Bin 0 -> 1150 bytes doc/images/iviewer/iviewer.rotate_left.png | Bin 0 -> 1493 bytes doc/images/iviewer/iviewer.rotate_right.png | Bin 0 -> 1482 bytes doc/images/iviewer/iviewer.zoom_fit.png | Bin 0 -> 1252 bytes doc/images/iviewer/iviewer.zoom_in.png | Bin 0 -> 1420 bytes doc/images/iviewer/iviewer.zoom_out.png | Bin 0 -> 1416 bytes doc/images/iviewer/iviewer.zoom_zero.png | Bin 0 -> 1091 bytes doc/index.html | 1278 + doc/js/bootstrap.min.js | 7 + doc/js/html5.js | 8 + doc/js/jquery-1.11.0.min.js | 4 + doc/js/jquery.dotdotdot-1.5.9.js | 602 + doc/js/jquery.dotdotdot-1.5.9.min.js | 15 + doc/js/jquery.iviewer.js | 1169 + doc/js/jquery.iviewer.min.js | 47 + doc/js/jquery.mousewheel.js | 201 + doc/js/jquery.smooth-scroll.js | 32 + doc/js/prism.min.js | 16 + doc/js/ui/1.10.4/jquery-ui.min.js | 7 + doc/namespaces/default.html | 1278 + doc/namespaces/hhu.html | 826 + doc/namespaces/hhu.z.agents.bottomlevel.html | 853 + doc/namespaces/hhu.z.agents.html | 847 + doc/namespaces/hhu.z.agents.intermediate.html | 897 + doc/namespaces/hhu.z.agents.toplevel.html | 853 + doc/namespaces/hhu.z.apis.html | 831 + .../hhu.z.controllers.components.html | 845 + doc/namespaces/hhu.z.controllers.html | 970 + doc/namespaces/hhu.z.exceptions.html | 871 + doc/namespaces/hhu.z.html | 874 + doc/namespaces/hhu.z.lib.html | 843 + doc/namespaces/hhu.z.models.html | 917 + doc/namespaces/hhu.z.questtypes.html | 913 + doc/namespaces/hhu.z.requests.html | 831 + doc/namespaces/hhu.z.responses.html | 831 + doc/namespaces/hhu.z.views.html | 831 + doc/namespaces/nre.agents.html | 840 + doc/namespaces/nre.apis.html | 829 + doc/namespaces/nre.configs.html | 833 + doc/namespaces/nre.core.html | 889 + doc/namespaces/nre.drivers.html | 833 + doc/namespaces/nre.exceptions.html | 913 + doc/namespaces/nre.html | 850 + doc/namespaces/nre.models.html | 829 + doc/namespaces/nre.requests.html | 829 + doc/namespaces/nre.responses.html | 829 + doc/reports/deprecated.html | 224 + doc/reports/errors.html | 553 + doc/reports/markers.html | 223 + drivers/DatabaseDriver.inc | 87 + drivers/MysqliDriver.inc | 167 + exceptions/AccessDeniedException.inc | 51 + exceptions/ActionNotFoundException.inc | 77 + exceptions/AgentNotFoundException.inc | 67 + exceptions/AgentNotValidException.inc | 67 + exceptions/ClassNotFoundException.inc | 79 + exceptions/ClassNotValidException.inc | 79 + exceptions/ComponentNotFoundException.inc | 67 + exceptions/ComponentNotValidException.inc | 67 + exceptions/ControllerNotFoundException.inc | 67 + exceptions/ControllerNotValidException.inc | 67 + exceptions/DatamodelException.inc | 99 + exceptions/DriverNotFoundException.inc | 68 + exceptions/DriverNotValidException.inc | 68 + exceptions/FatalDatamodelException.inc | 96 + exceptions/IdNotFoundException.inc | 77 + exceptions/LayoutNotFoundException.inc | 68 + exceptions/LayoutNotValidException.inc | 67 + exceptions/ModelNotFoundException.inc | 67 + exceptions/ModelNotValidException.inc | 68 + exceptions/ParamsNotValidException.inc | 77 + exceptions/ServiceUnavailableException.inc | 77 + exceptions/ViewNotFoundException.inc | 77 + locale/de_DE/LC_MESSAGES/The Legend of Z.mo | Bin 0 -> 25930 bytes locale/de_DE/LC_MESSAGES/The Legend of Z.po | 2299 ++ logs/empty | 0 media/empty | 0 models/AchievementsModel.inc | 1407 + models/AvatarsModel.inc | 223 + models/CharactergroupsModel.inc | 541 + models/CharactergroupsquestsModel.inc | 440 + models/CharacterrolesModel.inc | 100 + models/CharactersModel.inc | 697 + models/CharactertypesModel.inc | 252 + models/DatabaseModel.inc | 83 + models/MapModel.inc | 62 + models/MediaModel.inc | 655 + models/QuestgroupsModel.inc | 1002 + models/QuestgroupshierarchyModel.inc | 393 + models/QuestgrouptextsModel.inc | 151 + models/QuestsModel.inc | 818 + models/QuesttextsModel.inc | 389 + models/QuesttopicsModel.inc | 475 + models/QuesttypesModel.inc | 77 + models/SeminariesModel.inc | 456 + models/SeminarycharacterfieldsModel.inc | 151 + models/UploadsModel.inc | 175 + models/UserrolesModel.inc | 120 + models/UsersModel.inc | 430 + models/XplevelsModel.inc | 236 + phpdoc.dist.xml | 39 + .../bossfight/BossfightQuesttypeAgent.inc | 24 + .../BossfightQuesttypeController.inc | 292 + .../bossfight/BossfightQuesttypeModel.inc | 275 + questtypes/bossfight/html/edittask.tpl | 41 + questtypes/bossfight/html/quest.tpl | 54 + questtypes/bossfight/html/submission.tpl | 38 + .../choiceinput/ChoiceinputQuesttypeAgent.inc | 24 + .../ChoiceinputQuesttypeController.inc | 299 + .../choiceinput/ChoiceinputQuesttypeModel.inc | 368 + questtypes/choiceinput/html/edittask.tpl | 179 + questtypes/choiceinput/html/quest.tpl | 17 + questtypes/choiceinput/html/submission.tpl | 14 + .../crossword/CrosswordQuesttypeAgent.inc | 24 + .../CrosswordQuesttypeController.inc | 380 + .../crossword/CrosswordQuesttypeModel.inc | 117 + questtypes/crossword/html/edittask.tpl | 1 + questtypes/crossword/html/quest.tpl | 136 + questtypes/crossword/html/submission.tpl | 48 + .../dragndrop/DragndropQuesttypeAgent.inc | 24 + .../DragndropQuesttypeController.inc | 240 + .../dragndrop/DragndropQuesttypeModel.inc | 285 + questtypes/dragndrop/html/edittask.tpl | 1 + questtypes/dragndrop/html/quest.tpl | 17 + questtypes/dragndrop/html/submission.tpl | 15 + .../MultiplechoiceQuesttypeAgent.inc | 24 + .../MultiplechoiceQuesttypeController.inc | 386 + .../MultiplechoiceQuesttypeModel.inc | 312 + questtypes/multiplechoice/html/edittask.tpl | 137 + questtypes/multiplechoice/html/quest.tpl | 23 + questtypes/multiplechoice/html/submission.tpl | 16 + questtypes/submit/SubmitQuesttypeAgent.inc | 24 + .../submit/SubmitQuesttypeController.inc | 241 + questtypes/submit/SubmitQuesttypeModel.inc | 157 + questtypes/submit/html/edittask.tpl | 1 + questtypes/submit/html/quest.tpl | 53 + questtypes/submit/html/submission.tpl | 33 + .../textinput/TextinputQuesttypeAgent.inc | 24 + .../TextinputQuesttypeController.inc | 334 + .../textinput/TextinputQuesttypeModel.inc | 257 + questtypes/textinput/html/edittask.tpl | 111 + questtypes/textinput/html/quest.tpl | 16 + questtypes/textinput/html/submission.tpl | 10 + requests/WebRequest.inc | 417 + responses/WebResponse.inc | 250 + seminarymedia/empty | 0 seminaryuploads/empty | 0 tmp/empty | 0 uploads/empty | 0 views/ajax/ajax.tpl | 1 + views/ajax/characters/index.tpl | 25 + views/ajax/quests/index.tpl | 37 + views/ajax/users/index.tpl | 27 + views/binary/binary.tpl | 1 + views/binary/error/index.tpl | 1 + views/binary/media/achievement.tpl | 1 + views/binary/media/avatar.tpl | 1 + views/binary/media/charactergroup.tpl | 1 + views/binary/media/charactergroupsquest.tpl | 1 + views/binary/media/index.tpl | 1 + views/binary/media/seminary.tpl | 1 + views/binary/media/seminarymap.tpl | 1 + views/binary/media/seminarymoodpic.tpl | 1 + views/binary/uploads/charactergroup.tpl | 1 + views/binary/uploads/seminary.tpl | 1 + views/error.tpl | 27 + views/fault/error/index.tpl | 2 + views/fault/fault.tpl | 16 + views/html/achievements/conditions.tpl | 152 + views/html/achievements/create.tpl | 109 + views/html/achievements/delete.tpl | 16 + views/html/achievements/edit.tpl | 113 + views/html/achievements/index.tpl | 97 + views/html/achievements/manage.tpl | 28 + views/html/achievements/movedown.tpl | 0 views/html/achievements/moveup.tpl | 0 views/html/charactergroups/creategroup.tpl | 78 + .../charactergroups/creategroupsgroup.tpl | 51 + views/html/charactergroups/deletegroup.tpl | 17 + .../charactergroups/deletegroupsgroup.tpl | 16 + views/html/charactergroups/editgroup.tpl | 84 + .../html/charactergroups/editgroupsgroup.tpl | 51 + views/html/charactergroups/group.tpl | 65 + views/html/charactergroups/groupsgroup.tpl | 50 + views/html/charactergroups/index.tpl | 21 + views/html/charactergroups/managegroup.tpl | 111 + views/html/charactergroupsquests/create.tpl | 94 + views/html/charactergroupsquests/delete.tpl | 17 + views/html/charactergroupsquests/edit.tpl | 95 + views/html/charactergroupsquests/manage.tpl | 97 + views/html/charactergroupsquests/quest.tpl | 77 + views/html/characters/character.tpl | 154 + views/html/characters/delete.tpl | 19 + views/html/characters/edit.tpl | 109 + views/html/characters/index.tpl | 117 + views/html/characters/manage.tpl | 63 + views/html/characters/register.tpl | 97 + views/html/charactertypes/create.tpl | 45 + views/html/charactertypes/delete.tpl | 16 + views/html/charactertypes/edit.tpl | 143 + views/html/charactertypes/index.tpl | 29 + views/html/error/index.tpl | 17 + views/html/html.tpl | 128 + views/html/introduction/index.tpl | 50 + views/html/library/create.tpl | 47 + views/html/library/delete.tpl | 16 + views/html/library/edit.tpl | 125 + views/html/library/index.tpl | 33 + views/html/library/manage.tpl | 40 + views/html/library/topic.tpl | 37 + views/html/map/index.tpl | 45 + views/html/menu/index.tpl | 9 + views/html/questgroups/create.tpl | 77 + views/html/questgroups/delete.tpl | 19 + views/html/questgroups/edit.tpl | 65 + views/html/questgroups/edittexts.tpl | 25 + views/html/questgroups/movedown.tpl | 19 + views/html/questgroups/moveup.tpl | 19 + views/html/questgroups/questgroup.tpl | 123 + views/html/questgroupshierarchy/create.tpl | 64 + views/html/questgroupshierarchy/delete.tpl | 16 + views/html/questgroupshierarchy/edit.tpl | 58 + views/html/questgroupshierarchy/movedown.tpl | 0 views/html/questgroupshierarchy/moveup.tpl | 0 views/html/questgroupshierarchypath/index.tpl | 16 + views/html/quests/create.tpl | 109 + views/html/quests/delete.tpl | 13 + views/html/quests/edit.tpl | 115 + views/html/quests/edittask.tpl | 11 + views/html/quests/edittexts.tpl | 64 + views/html/quests/index.tpl | 135 + views/html/quests/quest.tpl | 150 + views/html/quests/submission.tpl | 12 + views/html/quests/submissions.tpl | 39 + views/html/seminaries/calculatexps.tpl | 0 views/html/seminaries/copy.tpl | 116 + views/html/seminaries/create.tpl | 76 + views/html/seminaries/delete.tpl | 15 + views/html/seminaries/edit.tpl | 78 + views/html/seminaries/index.tpl | 53 + views/html/seminaries/seminary.tpl | 84 + views/html/seminarybar/index.tpl | 60 + views/html/seminarymenu/index.tpl | 10 + views/html/userroles/user.tpl | 15 + views/html/users/create.tpl | 101 + views/html/users/delete.tpl | 13 + views/html/users/edit.tpl | 110 + views/html/users/index.tpl | 95 + views/html/users/login.tpl | 21 + views/html/users/logout.tpl | 0 views/html/users/manage.tpl | 54 + views/html/users/register.tpl | 101 + views/html/users/user.tpl | 49 + views/html/xplevels/manage.tpl | 84 + views/htmlmail/htmlmail.tpl | 19 + views/htmlmail/mail/characterregistration.tpl | 2 + views/htmlmail/mail/charactersubmission.tpl | 2 + .../mail/charactersubmissionapproved.tpl | 2 + views/htmlmail/mail/userregistration.tpl | 2 + views/htmlmail/mailreceiver/index.tpl | 1 + views/inlineerror.tpl | 1 + views/textmail/mail/characterregistration.tpl | 3 + views/textmail/mail/charactersubmission.tpl | 2 + .../mail/charactersubmissionapproved.tpl | 2 + views/textmail/mail/userregistration.tpl | 3 + views/textmail/mailreceiver/index.tpl | 1 + views/textmail/textmail.tpl | 8 + www/.htaccess | 8 + www/analytics/LEGALNOTICE | 265 + www/analytics/README.md | 92 + www/analytics/composer.json | 30 + www/analytics/composer.lock | 310 + www/analytics/config/.htaccess | 13 + www/analytics/config/global.ini.php | 627 + www/analytics/config/manifest.inc.php | 3200 ++ www/analytics/console | 28 + www/analytics/core/.htaccess | 13 + .../core/API/DataTableGenericFilter.php | 149 + .../core/API/DataTableManipulator.php | 192 + .../API/DataTableManipulator/Flattener.php | 137 + .../API/DataTableManipulator/LabelFilter.php | 167 + .../ReportTotalsCalculator.php | 250 + .../core/API/DocumentationGenerator.php | 238 + www/analytics/core/API/Proxy.php | 514 + www/analytics/core/API/Request.php | 398 + www/analytics/core/API/ResponseBuilder.php | 478 + www/analytics/core/Access.php | 418 + www/analytics/core/Archive.php | 809 + www/analytics/core/Archive/DataCollection.php | 336 + .../core/Archive/DataTableFactory.php | 426 + www/analytics/core/Archive/Parameters.php | 73 + www/analytics/core/ArchiveProcessor.php | 489 + .../core/ArchiveProcessor/Loader.php | 214 + .../core/ArchiveProcessor/Parameters.php | 194 + .../core/ArchiveProcessor/PluginsArchiver.php | 197 + www/analytics/core/ArchiveProcessor/Rules.php | 304 + www/analytics/core/AssetManager.php | 405 + www/analytics/core/AssetManager/UIAsset.php | 61 + .../AssetManager/UIAsset/InMemoryUIAsset.php | 63 + .../AssetManager/UIAsset/OnDiskUIAsset.php | 113 + .../core/AssetManager/UIAssetCacheBuster.php | 54 + .../core/AssetManager/UIAssetCatalog.php | 70 + .../AssetManager/UIAssetCatalogSorter.php | 59 + .../core/AssetManager/UIAssetFetcher.php | 119 + .../UIAssetFetcher/JScriptUIAssetFetcher.php | 90 + .../UIAssetFetcher/StaticUIAssetFetcher.php | 37 + .../StylesheetUIAssetFetcher.php | 64 + .../core/AssetManager/UIAssetMerger.php | 209 + .../UIAssetMerger/JScriptUIAssetMerger.php | 89 + .../UIAssetMerger/StylesheetUIAssetMerger.php | 147 + .../core/AssetManager/UIAssetMinifier.php | 66 + www/analytics/core/Auth.php | 147 + www/analytics/core/CacheFile.php | 206 + www/analytics/core/CliMulti.php | 280 + www/analytics/core/CliMulti/Output.php | 53 + www/analytics/core/CliMulti/Process.php | 195 + .../core/CliMulti/RequestCommand.php | 84 + www/analytics/core/Common.php | 1088 + www/analytics/core/Config.php | 714 + www/analytics/core/Console.php | 166 + www/analytics/core/Cookie.php | 383 + www/analytics/core/CronArchive.php | 1247 + .../core/CronArchive/FixedSiteIds.php | 68 + .../core/CronArchive/SharedSiteIds.php | 176 + .../core/DataAccess/ArchiveSelector.php | 360 + .../core/DataAccess/ArchiveTableCreator.php | 119 + .../core/DataAccess/ArchiveWriter.php | 317 + .../core/DataAccess/LogAggregator.php | 880 + www/analytics/core/DataArray.php | 396 + www/analytics/core/DataFiles/Countries.php | 326 + www/analytics/core/DataFiles/Currencies.php | 186 + .../core/DataFiles/LanguageToCountry.php | 63 + www/analytics/core/DataFiles/Languages.php | 203 + www/analytics/core/DataFiles/Providers.php | 48 + .../core/DataFiles/SearchEngines.php | 1033 + www/analytics/core/DataFiles/Socials.php | 226 + www/analytics/core/DataTable.php | 1638 + www/analytics/core/DataTable/BaseFilter.php | 81 + www/analytics/core/DataTable/Bridges.php | 28 + .../core/DataTable/DataTableInterface.php | 30 + .../Filter/AddColumnsProcessedMetrics.php | 149 + .../Filter/AddColumnsProcessedMetricsGoal.php | 226 + .../core/DataTable/Filter/AddSummaryRow.php | 52 + .../DataTable/Filter/BeautifyRangeLabels.php | 168 + .../Filter/BeautifyTimeRangeLabels.php | 121 + .../Filter/CalculateEvolutionFilter.php | 187 + .../Filter/ColumnCallbackAddColumn.php | 96 + .../ColumnCallbackAddColumnPercentage.php | 39 + .../ColumnCallbackAddColumnQuotient.php | 145 + .../Filter/ColumnCallbackAddMetadata.php | 89 + .../Filter/ColumnCallbackDeleteRow.php | 81 + .../Filter/ColumnCallbackReplace.php | 122 + .../core/DataTable/Filter/ColumnDelete.php | 150 + .../DataTable/Filter/ExcludeLowPopulation.php | 90 + .../core/DataTable/Filter/GroupBy.php | 104 + www/analytics/core/DataTable/Filter/Limit.php | 69 + .../Filter/MetadataCallbackAddMetadata.php | 81 + .../Filter/MetadataCallbackReplace.php | 66 + .../core/DataTable/Filter/Pattern.php | 96 + .../DataTable/Filter/PatternRecursive.php | 88 + .../core/DataTable/Filter/RangeCheck.php | 59 + .../DataTable/Filter/ReplaceColumnNames.php | 171 + .../Filter/ReplaceSummaryRowLabel.php | 74 + .../core/DataTable/Filter/SafeDecodeLabel.php | 72 + www/analytics/core/DataTable/Filter/Sort.php | 221 + .../core/DataTable/Filter/Truncate.php | 113 + www/analytics/core/DataTable/Manager.php | 156 + www/analytics/core/DataTable/Map.php | 445 + www/analytics/core/DataTable/Renderer.php | 417 + .../core/DataTable/Renderer/Console.php | 167 + www/analytics/core/DataTable/Renderer/Csv.php | 403 + .../core/DataTable/Renderer/Html.php | 207 + .../core/DataTable/Renderer/Json.php | 140 + www/analytics/core/DataTable/Renderer/Php.php | 271 + www/analytics/core/DataTable/Renderer/Rss.php | 207 + www/analytics/core/DataTable/Renderer/Tsv.php | 39 + www/analytics/core/DataTable/Renderer/Xml.php | 443 + www/analytics/core/DataTable/Row.php | 665 + .../DataTable/Row/DataTableSummaryRow.php | 68 + www/analytics/core/DataTable/Simple.php | 38 + .../core/DataTable/TableNotFoundException.php | 15 + www/analytics/core/Date.php | 706 + www/analytics/core/Db.php | 671 + www/analytics/core/Db/Adapter.php | 114 + www/analytics/core/Db/Adapter/Mysqli.php | 177 + www/analytics/core/Db/Adapter/Pdo/Mssql.php | 264 + www/analytics/core/Db/Adapter/Pdo/Mysql.php | 233 + www/analytics/core/Db/Adapter/Pdo/Pgsql.php | 182 + www/analytics/core/Db/AdapterInterface.php | 73 + www/analytics/core/Db/BatchInsert.php | 255 + www/analytics/core/Db/Schema.php | 245 + www/analytics/core/Db/Schema/Mysql.php | 539 + www/analytics/core/Db/SchemaInterface.php | 96 + www/analytics/core/DbHelper.php | 164 + www/analytics/core/Error.php | 222 + www/analytics/core/EventDispatcher.php | 186 + www/analytics/core/ExceptionHandler.php | 63 + www/analytics/core/Filechecks.php | 224 + www/analytics/core/Filesystem.php | 314 + www/analytics/core/FrontController.php | 545 + www/analytics/core/Http.php | 754 + www/analytics/core/IP.php | 431 + www/analytics/core/Loader.php | 126 + www/analytics/core/Log.php | 635 + www/analytics/core/Mail.php | 103 + www/analytics/core/Menu/MenuAbstract.php | 269 + www/analytics/core/Menu/MenuAdmin.php | 113 + www/analytics/core/Menu/MenuMain.php | 91 + www/analytics/core/Menu/MenuTop.php | 121 + www/analytics/core/Metrics.php | 346 + www/analytics/core/MetricsFormatter.php | 242 + www/analytics/core/Nonce.php | 175 + www/analytics/core/Notification.php | 207 + www/analytics/core/Notification/Manager.php | 140 + www/analytics/core/Option.php | 247 + www/analytics/core/Period.php | 342 + www/analytics/core/Period/Day.php | 102 + www/analytics/core/Period/Month.php | 74 + www/analytics/core/Period/Range.php | 451 + www/analytics/core/Period/Week.php | 102 + www/analytics/core/Period/Year.php | 87 + www/analytics/core/Piwik.php | 847 + www/analytics/core/Plugin.php | 326 + www/analytics/core/Plugin/API.php | 45 + www/analytics/core/Plugin/Archiver.php | 133 + www/analytics/core/Plugin/ConsoleCommand.php | 68 + www/analytics/core/Plugin/Controller.php | 944 + www/analytics/core/Plugin/ControllerAdmin.php | 213 + www/analytics/core/Plugin/Dependency.php | 105 + www/analytics/core/Plugin/Manager.php | 1251 + www/analytics/core/Plugin/MetadataLoader.php | 106 + www/analytics/core/Plugin/Settings.php | 378 + www/analytics/core/Plugin/ViewDataTable.php | 459 + www/analytics/core/Plugin/Visualization.php | 595 + www/analytics/core/Profiler.php | 290 + www/analytics/core/ProxyHeaders.php | 92 + www/analytics/core/ProxyHttp.php | 232 + www/analytics/core/QuickForm2.php | 145 + www/analytics/core/RankingQuery.php | 373 + www/analytics/core/Registry.php | 57 + www/analytics/core/ReportRenderer.php | 259 + www/analytics/core/ReportRenderer/Csv.php | 151 + www/analytics/core/ReportRenderer/Html.php | 164 + www/analytics/core/ReportRenderer/Pdf.php | 526 + www/analytics/core/ScheduledTask.php | 204 + www/analytics/core/ScheduledTaskTimetable.php | 121 + www/analytics/core/ScheduledTime.php | 225 + www/analytics/core/ScheduledTime/Daily.php | 56 + www/analytics/core/ScheduledTime/Hourly.php | 62 + www/analytics/core/ScheduledTime/Monthly.php | 145 + www/analytics/core/ScheduledTime/Weekly.php | 83 + www/analytics/core/Segment.php | 454 + www/analytics/core/SegmentExpression.php | 378 + www/analytics/core/Session.php | 146 + .../core/Session/SaveHandler/DbTable.php | 145 + .../core/Session/SessionNamespace.php | 33 + www/analytics/core/Settings/Manager.php | 133 + www/analytics/core/Settings/Setting.php | 241 + .../core/Settings/StorageInterface.php | 52 + www/analytics/core/Settings/SystemSetting.php | 47 + www/analytics/core/Settings/UserSetting.php | 118 + www/analytics/core/SettingsPiwik.php | 372 + www/analytics/core/SettingsServer.php | 213 + www/analytics/core/Singleton.php | 61 + www/analytics/core/Site.php | 553 + www/analytics/core/TCPDF.php | 91 + www/analytics/core/TaskScheduler.php | 204 + www/analytics/core/Theme.php | 153 + www/analytics/core/Timer.php | 91 + www/analytics/core/Tracker.php | 861 + www/analytics/core/Tracker/Action.php | 310 + www/analytics/core/Tracker/ActionClickUrl.php | 63 + www/analytics/core/Tracker/ActionEvent.php | 78 + www/analytics/core/Tracker/ActionPageview.php | 71 + .../core/Tracker/ActionSiteSearch.php | 254 + www/analytics/core/Tracker/Cache.php | 205 + www/analytics/core/Tracker/Db.php | 225 + www/analytics/core/Tracker/Db/DbException.php | 20 + www/analytics/core/Tracker/Db/Mysqli.php | 279 + www/analytics/core/Tracker/Db/Pdo/Mysql.php | 237 + www/analytics/core/Tracker/Db/Pdo/Pgsql.php | 116 + www/analytics/core/Tracker/GoalManager.php | 905 + www/analytics/core/Tracker/IgnoreCookie.php | 73 + www/analytics/core/Tracker/PageUrl.php | 328 + www/analytics/core/Tracker/Referrer.php | 301 + www/analytics/core/Tracker/Request.php | 573 + www/analytics/core/Tracker/TableLogAction.php | 257 + www/analytics/core/Tracker/Visit.php | 1010 + www/analytics/core/Tracker/VisitExcluded.php | 244 + www/analytics/core/Tracker/VisitInterface.php | 32 + .../core/Tracker/VisitorNotFoundInDb.php | 17 + www/analytics/core/Translate.php | 215 + .../Translate/Filter/ByBaseTranslations.php | 65 + .../Translate/Filter/ByParameterCount.php | 87 + .../Translate/Filter/EmptyTranslations.php | 47 + .../core/Translate/Filter/EncodedEntities.php | 44 + .../core/Translate/Filter/FilterAbstract.php | 36 + .../Filter/UnnecassaryWhitespaces.php | 65 + .../Translate/Validate/CoreTranslations.php | 101 + .../core/Translate/Validate/NoScripts.php | 39 + .../Translate/Validate/ValidateAbstract.php | 37 + www/analytics/core/Translate/Writer.php | 383 + www/analytics/core/Twig.php | 305 + www/analytics/core/Unzip.php | 52 + www/analytics/core/Unzip/Gzip.php | 82 + www/analytics/core/Unzip/PclZip.php | 89 + www/analytics/core/Unzip/Tar.php | 84 + .../core/Unzip/UncompressInterface.php | 39 + www/analytics/core/Unzip/ZipArchive.php | 132 + www/analytics/core/UpdateCheck.php | 110 + www/analytics/core/Updater.php | 335 + www/analytics/core/Updates.php | 108 + www/analytics/core/Updates/0.2.10.php | 73 + www/analytics/core/Updates/0.2.12.php | 38 + www/analytics/core/Updates/0.2.13.php | 38 + www/analytics/core/Updates/0.2.24.php | 36 + www/analytics/core/Updates/0.2.27.php | 81 + www/analytics/core/Updates/0.2.32.php | 39 + www/analytics/core/Updates/0.2.33.php | 45 + www/analytics/core/Updates/0.2.34.php | 28 + www/analytics/core/Updates/0.2.35.php | 32 + www/analytics/core/Updates/0.2.37.php | 33 + www/analytics/core/Updates/0.4.1.php | 34 + www/analytics/core/Updates/0.4.2.php | 38 + www/analytics/core/Updates/0.4.4.php | 29 + www/analytics/core/Updates/0.4.php | 39 + www/analytics/core/Updates/0.5.4.php | 65 + www/analytics/core/Updates/0.5.5.php | 46 + www/analytics/core/Updates/0.5.php | 40 + www/analytics/core/Updates/0.6-rc1.php | 67 + www/analytics/core/Updates/0.6.2.php | 47 + www/analytics/core/Updates/0.6.3.php | 49 + www/analytics/core/Updates/0.7.php | 32 + www/analytics/core/Updates/0.9.1.php | 57 + www/analytics/core/Updates/1.1.php | 44 + www/analytics/core/Updates/1.10-b4.php | 31 + www/analytics/core/Updates/1.10.1.php | 31 + www/analytics/core/Updates/1.10.2-b1.php | 33 + www/analytics/core/Updates/1.10.2-b2.php | 33 + www/analytics/core/Updates/1.11-b1.php | 31 + www/analytics/core/Updates/1.12-b1.php | 38 + www/analytics/core/Updates/1.12-b15.php | 26 + www/analytics/core/Updates/1.12-b16.php | 33 + www/analytics/core/Updates/1.2-rc1.php | 150 + www/analytics/core/Updates/1.2-rc2.php | 26 + www/analytics/core/Updates/1.2.3.php | 41 + www/analytics/core/Updates/1.2.5-rc1.php | 37 + www/analytics/core/Updates/1.2.5-rc7.php | 34 + www/analytics/core/Updates/1.4-rc1.php | 37 + www/analytics/core/Updates/1.4-rc2.php | 44 + www/analytics/core/Updates/1.5-b1.php | 63 + www/analytics/core/Updates/1.5-b2.php | 41 + www/analytics/core/Updates/1.5-b3.php | 63 + www/analytics/core/Updates/1.5-b4.php | 32 + www/analytics/core/Updates/1.5-b5.php | 37 + www/analytics/core/Updates/1.5-rc6.php | 26 + www/analytics/core/Updates/1.6-b1.php | 68 + www/analytics/core/Updates/1.6-rc1.php | 26 + www/analytics/core/Updates/1.7-b1.php | 37 + www/analytics/core/Updates/1.7.2-rc5.php | 35 + www/analytics/core/Updates/1.7.2-rc7.php | 45 + www/analytics/core/Updates/1.8.3-b1.php | 115 + www/analytics/core/Updates/1.8.4-b1.php | 190 + www/analytics/core/Updates/1.9-b16.php | 54 + www/analytics/core/Updates/1.9-b19.php | 43 + www/analytics/core/Updates/1.9-b9.php | 57 + www/analytics/core/Updates/1.9.1-b2.php | 36 + www/analytics/core/Updates/1.9.3-b10.php | 31 + www/analytics/core/Updates/1.9.3-b3.php | 28 + www/analytics/core/Updates/1.9.3-b8.php | 34 + www/analytics/core/Updates/2.0-a12.php | 48 + www/analytics/core/Updates/2.0-a13.php | 66 + www/analytics/core/Updates/2.0-a17.php | 42 + www/analytics/core/Updates/2.0-a7.php | 37 + www/analytics/core/Updates/2.0-b10.php | 23 + www/analytics/core/Updates/2.0-b13.php | 42 + www/analytics/core/Updates/2.0-b3.php | 46 + www/analytics/core/Updates/2.0-b9.php | 33 + www/analytics/core/Updates/2.0-rc1.php | 24 + www/analytics/core/Updates/2.0.3-b7.php | 67 + www/analytics/core/Updates/2.0.4-b5.php | 92 + www/analytics/core/Updates/2.0.4-b7.php | 73 + www/analytics/core/Updates/2.0.4-b8.php | 78 + www/analytics/core/Updates/2.1.1-b11.php | 133 + www/analytics/core/Updates/2.2.0-b15.php | 27 + www/analytics/core/Url.php | 562 + www/analytics/core/UrlHelper.php | 496 + www/analytics/core/Version.php | 25 + www/analytics/core/View.php | 365 + www/analytics/core/View/OneClickDone.php | 87 + www/analytics/core/View/RenderTokenParser.php | 83 + .../core/View/ReportsByDimension.php | 129 + www/analytics/core/View/UIControl.php | 172 + www/analytics/core/View/ViewInterface.php | 25 + www/analytics/core/ViewDataTable/Config.php | 633 + www/analytics/core/ViewDataTable/Factory.php | 174 + www/analytics/core/ViewDataTable/Manager.php | 273 + www/analytics/core/ViewDataTable/Request.php | 137 + .../core/ViewDataTable/RequestConfig.php | 301 + .../core/Visualization/Sparkline.php | 177 + www/analytics/core/WidgetsList.php | 215 + www/analytics/core/dispatch.php | 39 + www/analytics/core/testMinimumPhpVersion.php | 139 + www/analytics/favicon.ico | 0 www/analytics/index.php | 47 + www/analytics/js/.htaccess | 17 + www/analytics/js/LICENSE.txt | 32 + www/analytics/js/README.md | 58 + www/analytics/js/index.php | 37 + www/analytics/js/piwik.js | 3280 ++ www/analytics/lang/.htaccess | 13 + www/analytics/lang/README.md | 5 + www/analytics/lang/am.json | 814 + www/analytics/lang/ar.json | 1497 + www/analytics/lang/be.json | 1423 + www/analytics/lang/bg.json | 2301 ++ www/analytics/lang/bn.json | 587 + www/analytics/lang/bs.json | 975 + www/analytics/lang/ca.json | 2022 + www/analytics/lang/cs.json | 1688 + www/analytics/lang/cy.json | 723 + www/analytics/lang/da.json | 2437 ++ www/analytics/lang/de.json | 2443 ++ www/analytics/lang/el.json | 2457 ++ www/analytics/lang/en.json | 2467 ++ www/analytics/lang/es.json | 2430 ++ www/analytics/lang/et.json | 1800 + www/analytics/lang/eu.json | 964 + www/analytics/lang/fa.json | 2171 + www/analytics/lang/fi.json | 2399 ++ www/analytics/lang/fr.json | 2402 ++ www/analytics/lang/gl.json | 763 + www/analytics/lang/he.json | 1162 + www/analytics/lang/hi.json | 2082 + www/analytics/lang/hr.json | 906 + www/analytics/lang/hu.json | 1372 + www/analytics/lang/id.json | 2205 ++ www/analytics/lang/is.json | 982 + www/analytics/lang/it.json | 2464 ++ www/analytics/lang/ja.json | 1809 + www/analytics/lang/ka.json | 1227 + www/analytics/lang/ko.json | 2089 + www/analytics/lang/lt.json | 1299 + www/analytics/lang/lv.json | 1310 + www/analytics/lang/nb.json | 1557 + www/analytics/lang/nl.json | 2279 ++ www/analytics/lang/nn.json | 1332 + www/analytics/lang/pl.json | 1579 + www/analytics/lang/pt-br.json | 2360 ++ www/analytics/lang/pt.json | 1547 + www/analytics/lang/ro.json | 1799 + www/analytics/lang/ru.json | 2258 ++ www/analytics/lang/sk.json | 1357 + www/analytics/lang/sl.json | 1387 + www/analytics/lang/sq.json | 1517 + www/analytics/lang/sr.json | 2393 ++ www/analytics/lang/sv.json | 2415 ++ www/analytics/lang/ta.json | 1054 + www/analytics/lang/te.json | 854 + www/analytics/lang/th.json | 1584 + www/analytics/lang/tr.json | 1320 + www/analytics/lang/uk.json | 1257 + www/analytics/lang/vi.json | 2324 ++ www/analytics/lang/zh-cn.json | 2335 ++ www/analytics/lang/zh-tw.json | 1294 + www/analytics/libs/.htaccess | 33 + www/analytics/libs/Archive_Tar/Tar.php | 1993 + www/analytics/libs/HTML/Common2.php | 488 + www/analytics/libs/HTML/QuickForm2.php | 224 + .../libs/HTML/QuickForm2/Container.php | 487 + .../HTML/QuickForm2/Container/Fieldset.php | 92 + .../libs/HTML/QuickForm2/Container/Group.php | 328 + .../libs/HTML/QuickForm2/Controller.php | 508 + .../HTML/QuickForm2/Controller/Action.php | 68 + .../QuickForm2/Controller/Action/Back.php | 74 + .../QuickForm2/Controller/Action/Direct.php | 71 + .../QuickForm2/Controller/Action/Display.php | 117 + .../QuickForm2/Controller/Action/Jump.php | 209 + .../QuickForm2/Controller/Action/Next.php | 88 + .../QuickForm2/Controller/Action/Submit.php | 79 + .../QuickForm2/Controller/DefaultAction.php | 106 + .../libs/HTML/QuickForm2/Controller/Page.php | 258 + .../Controller/SessionContainer.php | 195 + .../libs/HTML/QuickForm2/DataSource.php | 67 + .../libs/HTML/QuickForm2/DataSource/Array.php | 101 + .../HTML/QuickForm2/DataSource/Session.php | 78 + .../HTML/QuickForm2/DataSource/Submit.php | 76 + .../QuickForm2/DataSource/SuperGlobal.php | 170 + .../libs/HTML/QuickForm2/Element.php | 133 + .../libs/HTML/QuickForm2/Element/Button.php | 161 + .../libs/HTML/QuickForm2/Element/Date.php | 503 + .../libs/HTML/QuickForm2/Element/Input.php | 114 + .../HTML/QuickForm2/Element/InputButton.php | 99 + .../QuickForm2/Element/InputCheckable.php | 172 + .../HTML/QuickForm2/Element/InputCheckbox.php | 99 + .../HTML/QuickForm2/Element/InputFile.php | 268 + .../HTML/QuickForm2/Element/InputHidden.php | 82 + .../HTML/QuickForm2/Element/InputImage.php | 162 + .../HTML/QuickForm2/Element/InputPassword.php | 71 + .../HTML/QuickForm2/Element/InputRadio.php | 69 + .../HTML/QuickForm2/Element/InputReset.php | 99 + .../HTML/QuickForm2/Element/InputSubmit.php | 120 + .../HTML/QuickForm2/Element/InputText.php | 64 + .../libs/HTML/QuickForm2/Element/Select.php | 575 + .../libs/HTML/QuickForm2/Element/Static.php | 153 + .../libs/HTML/QuickForm2/Element/Textarea.php | 110 + .../libs/HTML/QuickForm2/Exception.php | 109 + .../libs/HTML/QuickForm2/Factory.php | 233 + .../HTML/QuickForm2/JavascriptBuilder.php | 121 + www/analytics/libs/HTML/QuickForm2/Loader.php | 141 + www/analytics/libs/HTML/QuickForm2/Node.php | 693 + .../libs/HTML/QuickForm2/Renderer.php | 367 + .../libs/HTML/QuickForm2/Renderer/Array.php | 376 + .../libs/HTML/QuickForm2/Renderer/Default.php | 598 + .../libs/HTML/QuickForm2/Renderer/Plugin.php | 69 + .../libs/HTML/QuickForm2/Renderer/Proxy.php | 264 + .../libs/HTML/QuickForm2/Renderer/Smarty.php | 292 + www/analytics/libs/HTML/QuickForm2/Rule.php | 333 + .../libs/HTML/QuickForm2/Rule/Callback.php | 172 + .../libs/HTML/QuickForm2/Rule/Compare.php | 231 + .../libs/HTML/QuickForm2/Rule/Each.php | 137 + .../libs/HTML/QuickForm2/Rule/Empty.php | 89 + .../libs/HTML/QuickForm2/Rule/Length.php | 236 + .../libs/HTML/QuickForm2/Rule/MaxFileSize.php | 124 + .../libs/HTML/QuickForm2/Rule/MimeType.php | 122 + .../libs/HTML/QuickForm2/Rule/Nonempty.php | 141 + .../libs/HTML/QuickForm2/Rule/NotCallback.php | 80 + .../libs/HTML/QuickForm2/Rule/NotRegex.php | 106 + .../libs/HTML/QuickForm2/Rule/Regex.php | 133 + .../libs/HTML/QuickForm2/Rule/Required.php | 88 + www/analytics/libs/MaxMindGeoIP/geoip.inc | 749 + www/analytics/libs/MaxMindGeoIP/geoipcity.inc | 237 + .../libs/MaxMindGeoIP/geoipregionvars.php | 4192 ++ www/analytics/libs/PEAR.php | 1063 + www/analytics/libs/PEAR/Exception.php | 389 + .../libs/PEAR/FixPHP5PEARWarnings.php | 7 + www/analytics/libs/PEAR/LICENSE | 27 + www/analytics/libs/PEAR5.php | 33 + www/analytics/libs/PclZip/lgpl-2.1.txt | 502 + www/analytics/libs/PclZip/pclzip.lib.php | 5694 +++ www/analytics/libs/PiwikTracker/LICENSE.txt | 29 + .../libs/PiwikTracker/PiwikTracker.php | 1537 + www/analytics/libs/README.md | 35 + www/analytics/libs/UserAgentParser/README.md | 23 + .../libs/UserAgentParser/UserAgentParser.php | 725 + .../UserAgentParser/UserAgentParser.test.php | 56 + www/analytics/libs/Zend/Cache.php | 250 + www/analytics/libs/Zend/Cache/Backend.php | 268 + www/analytics/libs/Zend/Cache/Backend/Apc.php | 355 + .../libs/Zend/Cache/Backend/BlackHole.php | 250 + .../Zend/Cache/Backend/ExtendedInterface.php | 126 + .../libs/Zend/Cache/Backend/File.php | 1007 + .../libs/Zend/Cache/Backend/Interface.php | 99 + .../libs/Zend/Cache/Backend/Libmemcached.php | 484 + .../libs/Zend/Cache/Backend/Memcached.php | 504 + .../libs/Zend/Cache/Backend/Sqlite.php | 678 + .../libs/Zend/Cache/Backend/Static.php | 564 + .../libs/Zend/Cache/Backend/Test.php | 413 + .../libs/Zend/Cache/Backend/TwoLevels.php | 536 + .../libs/Zend/Cache/Backend/WinCache.php | 349 + .../libs/Zend/Cache/Backend/Xcache.php | 221 + .../libs/Zend/Cache/Backend/ZendPlatform.php | 317 + .../libs/Zend/Cache/Backend/ZendServer.php | 207 + .../Zend/Cache/Backend/ZendServer/Disk.php | 100 + .../Zend/Cache/Backend/ZendServer/ShMem.php | 100 + www/analytics/libs/Zend/Cache/Core.php | 764 + www/analytics/libs/Zend/Cache/Exception.php | 32 + .../libs/Zend/Cache/Frontend/Capture.php | 88 + .../libs/Zend/Cache/Frontend/Class.php | 265 + .../libs/Zend/Cache/Frontend/File.php | 222 + .../libs/Zend/Cache/Frontend/Function.php | 179 + .../libs/Zend/Cache/Frontend/Output.php | 105 + .../libs/Zend/Cache/Frontend/Page.php | 404 + www/analytics/libs/Zend/Cache/Manager.php | 298 + www/analytics/libs/Zend/Config.php | 484 + www/analytics/libs/Zend/Config/Exception.php | 33 + www/analytics/libs/Zend/Config/Ini.php | 309 + www/analytics/libs/Zend/Config/Json.php | 240 + www/analytics/libs/Zend/Config/Writer.php | 101 + .../libs/Zend/Config/Writer/Array.php | 55 + .../libs/Zend/Config/Writer/FileAbstract.php | 134 + www/analytics/libs/Zend/Config/Writer/Ini.php | 193 + .../libs/Zend/Config/Writer/Json.php | 106 + www/analytics/libs/Zend/Config/Writer/Xml.php | 127 + .../libs/Zend/Config/Writer/Yaml.php | 144 + www/analytics/libs/Zend/Config/Xml.php | 296 + www/analytics/libs/Zend/Config/Yaml.php | 381 + www/analytics/libs/Zend/Db.php | 286 + .../libs/Zend/Db/Adapter/Abstract.php | 1280 + www/analytics/libs/Zend/Db/Adapter/Db2.php | 840 + .../libs/Zend/Db/Adapter/Db2/Exception.php | 45 + .../libs/Zend/Db/Adapter/Exception.php | 57 + www/analytics/libs/Zend/Db/Adapter/Mysqli.php | 549 + .../libs/Zend/Db/Adapter/Mysqli/Exception.php | 40 + www/analytics/libs/Zend/Db/Adapter/Oracle.php | 643 + .../libs/Zend/Db/Adapter/Oracle/Exception.php | 60 + .../libs/Zend/Db/Adapter/Pdo/Abstract.php | 401 + .../libs/Zend/Db/Adapter/Pdo/Ibm.php | 360 + .../libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php | 228 + .../libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php | 301 + .../libs/Zend/Db/Adapter/Pdo/Mssql.php | 423 + .../libs/Zend/Db/Adapter/Pdo/Mysql.php | 270 + .../libs/Zend/Db/Adapter/Pdo/Oci.php | 378 + .../libs/Zend/Db/Adapter/Pdo/Pgsql.php | 336 + .../libs/Zend/Db/Adapter/Pdo/Sqlite.php | 297 + www/analytics/libs/Zend/Db/Adapter/Sqlsrv.php | 673 + .../libs/Zend/Db/Adapter/Sqlsrv/Exception.php | 63 + www/analytics/libs/Zend/Db/Exception.php | 35 + www/analytics/libs/Zend/Db/Expr.php | 77 + www/analytics/libs/Zend/Db/Profiler.php | 471 + .../libs/Zend/Db/Profiler/Exception.php | 40 + .../libs/Zend/Db/Profiler/Firebug.php | 161 + www/analytics/libs/Zend/Db/Profiler/Query.php | 213 + www/analytics/libs/Zend/Db/Select.php | 1351 + .../libs/Zend/Db/Select/Exception.php | 39 + www/analytics/libs/Zend/Db/Statement.php | 485 + www/analytics/libs/Zend/Db/Statement/Db2.php | 360 + .../libs/Zend/Db/Statement/Db2/Exception.php | 58 + .../libs/Zend/Db/Statement/Exception.php | 56 + .../libs/Zend/Db/Statement/Interface.php | 203 + .../libs/Zend/Db/Statement/Mysqli.php | 362 + .../Zend/Db/Statement/Mysqli/Exception.php | 38 + .../libs/Zend/Db/Statement/Oracle.php | 577 + .../Zend/Db/Statement/Oracle/Exception.php | 59 + www/analytics/libs/Zend/Db/Statement/Pdo.php | 439 + .../libs/Zend/Db/Statement/Pdo/Ibm.php | 94 + .../libs/Zend/Db/Statement/Pdo/Oci.php | 91 + .../libs/Zend/Db/Statement/Sqlsrv.php | 440 + .../Zend/Db/Statement/Sqlsrv/Exception.php | 61 + www/analytics/libs/Zend/Db/Table.php | 79 + www/analytics/libs/Zend/Db/Table/Abstract.php | 1534 + .../libs/Zend/Db/Table/Definition.php | 131 + .../libs/Zend/Db/Table/Exception.php | 38 + www/analytics/libs/Zend/Db/Table/Row.php | 42 + .../libs/Zend/Db/Table/Row/Abstract.php | 1203 + .../libs/Zend/Db/Table/Row/Exception.php | 38 + www/analytics/libs/Zend/Db/Table/Rowset.php | 43 + .../libs/Zend/Db/Table/Rowset/Abstract.php | 435 + .../libs/Zend/Db/Table/Rowset/Exception.php | 37 + www/analytics/libs/Zend/Db/Table/Select.php | 224 + .../libs/Zend/Db/Table/Select/Exception.php | 39 + www/analytics/libs/Zend/Exception.php | 96 + www/analytics/libs/Zend/LICENSE.txt | 27 + www/analytics/libs/Zend/Mail.php | 1276 + www/analytics/libs/Zend/Mail/Exception.php | 37 + www/analytics/libs/Zend/Mail/Message.php | 112 + www/analytics/libs/Zend/Mail/Message/File.php | 96 + .../libs/Zend/Mail/Message/Interface.php | 55 + www/analytics/libs/Zend/Mail/Part.php | 520 + www/analytics/libs/Zend/Mail/Part/File.php | 198 + .../libs/Zend/Mail/Part/Interface.php | 136 + .../libs/Zend/Mail/Protocol/Abstract.php | 447 + .../libs/Zend/Mail/Protocol/Exception.php | 39 + .../libs/Zend/Mail/Protocol/Imap.php | 838 + .../libs/Zend/Mail/Protocol/Pop3.php | 472 + .../libs/Zend/Mail/Protocol/Smtp.php | 443 + .../Zend/Mail/Protocol/Smtp/Auth/Crammd5.php | 108 + .../Zend/Mail/Protocol/Smtp/Auth/Login.php | 98 + .../Zend/Mail/Protocol/Smtp/Auth/Plain.php | 96 + www/analytics/libs/Zend/Mail/Storage.php | 39 + .../libs/Zend/Mail/Storage/Abstract.php | 366 + .../libs/Zend/Mail/Storage/Exception.php | 39 + .../libs/Zend/Mail/Storage/Folder.php | 236 + .../Zend/Mail/Storage/Folder/Interface.php | 60 + .../libs/Zend/Mail/Storage/Folder/Maildir.php | 265 + .../libs/Zend/Mail/Storage/Folder/Mbox.php | 264 + www/analytics/libs/Zend/Mail/Storage/Imap.php | 644 + .../libs/Zend/Mail/Storage/Maildir.php | 475 + www/analytics/libs/Zend/Mail/Storage/Mbox.php | 447 + www/analytics/libs/Zend/Mail/Storage/Pop3.php | 328 + .../Zend/Mail/Storage/Writable/Interface.php | 108 + .../Zend/Mail/Storage/Writable/Maildir.php | 1049 + .../libs/Zend/Mail/Transport/Abstract.php | 350 + .../libs/Zend/Mail/Transport/Exception.php | 39 + .../libs/Zend/Mail/Transport/File.php | 134 + .../libs/Zend/Mail/Transport/Sendmail.php | 220 + .../libs/Zend/Mail/Transport/Smtp.php | 243 + www/analytics/libs/Zend/Mime.php | 365 + www/analytics/libs/Zend/Mime/Decode.php | 244 + www/analytics/libs/Zend/Mime/Exception.php | 37 + www/analytics/libs/Zend/Mime/Message.php | 286 + www/analytics/libs/Zend/Mime/Part.php | 230 + www/analytics/libs/Zend/Registry.php | 210 + www/analytics/libs/Zend/Session.php | 870 + www/analytics/libs/Zend/Session/Abstract.php | 185 + www/analytics/libs/Zend/Session/Exception.php | 74 + www/analytics/libs/Zend/Session/Namespace.php | 529 + .../libs/Zend/Session/SaveHandler/DbTable.php | 591 + .../Zend/Session/SaveHandler/Exception.php | 37 + .../Zend/Session/SaveHandler/Interface.php | 81 + .../libs/Zend/Session/Validator/Abstract.php | 69 + .../Zend/Session/Validator/HttpUserAgent.php | 66 + .../libs/Zend/Session/Validator/Interface.php | 52 + www/analytics/libs/Zend/Validate.php | 292 + www/analytics/libs/Zend/Validate/Abstract.php | 456 + www/analytics/libs/Zend/Validate/Alnum.php | 150 + www/analytics/libs/Zend/Validate/Alpha.php | 150 + www/analytics/libs/Zend/Validate/Between.php | 224 + www/analytics/libs/Zend/Validate/Callback.php | 174 + www/analytics/libs/Zend/Validate/Ccnum.php | 112 + .../libs/Zend/Validate/CreditCard.php | 317 + www/analytics/libs/Zend/Validate/Date.php | 259 + www/analytics/libs/Zend/Validate/Digits.php | 91 + .../libs/Zend/Validate/EmailAddress.php | 560 + .../libs/Zend/Validate/Exception.php | 34 + .../libs/Zend/Validate/File/Count.php | 284 + .../libs/Zend/Validate/File/Crc32.php | 179 + .../Zend/Validate/File/ExcludeExtension.php | 94 + .../Zend/Validate/File/ExcludeMimeType.php | 109 + .../libs/Zend/Validate/File/Exists.php | 203 + .../libs/Zend/Validate/File/Extension.php | 232 + .../libs/Zend/Validate/File/FilesSize.php | 164 + .../libs/Zend/Validate/File/Hash.php | 194 + .../libs/Zend/Validate/File/ImageSize.php | 364 + .../libs/Zend/Validate/File/IsCompressed.php | 149 + .../libs/Zend/Validate/File/IsImage.php | 173 + www/analytics/libs/Zend/Validate/File/Md5.php | 183 + .../libs/Zend/Validate/File/MimeType.php | 392 + .../libs/Zend/Validate/File/NotExists.php | 84 + .../libs/Zend/Validate/File/Sha1.php | 181 + .../libs/Zend/Validate/File/Size.php | 404 + .../libs/Zend/Validate/File/Upload.php | 251 + .../libs/Zend/Validate/File/WordCount.php | 101 + www/analytics/libs/Zend/Validate/Float.php | 134 + .../libs/Zend/Validate/GreaterThan.php | 124 + www/analytics/libs/Zend/Validate/Hex.php | 72 + www/analytics/libs/Zend/Validate/Hostname.php | 784 + .../libs/Zend/Validate/Hostname/Biz.php | 2917 ++ .../libs/Zend/Validate/Hostname/Cn.php | 2199 ++ .../libs/Zend/Validate/Hostname/Com.php | 198 + .../libs/Zend/Validate/Hostname/Jp.php | 739 + www/analytics/libs/Zend/Validate/Iban.php | 223 + .../libs/Zend/Validate/Identical.php | 164 + www/analytics/libs/Zend/Validate/InArray.php | 204 + www/analytics/libs/Zend/Validate/Int.php | 148 + .../libs/Zend/Validate/Interface.php | 54 + www/analytics/libs/Zend/Validate/Ip.php | 191 + www/analytics/libs/Zend/Validate/Isbn.php | 279 + www/analytics/libs/Zend/Validate/LessThan.php | 122 + www/analytics/libs/Zend/Validate/NotEmpty.php | 279 + www/analytics/libs/Zend/Validate/PostCode.php | 210 + www/analytics/libs/Zend/Validate/Regex.php | 147 + .../libs/Zend/Validate/StringLength.php | 253 + www/analytics/libs/Zend/Version.php | 81 + www/analytics/libs/angularjs/LICENSE | 21 + .../libs/angularjs/angular-animate.js | 1589 + .../libs/angularjs/angular-animate.min.js | 26 + .../libs/angularjs/angular-cookies.js | 202 + .../libs/angularjs/angular-cookies.min.js | 8 + www/analytics/libs/angularjs/angular-csp.css | 18 + .../libs/angularjs/angular-loader.js | 410 + .../libs/angularjs/angular-loader.min.js | 9 + www/analytics/libs/angularjs/angular-mocks.js | 2136 + .../libs/angularjs/angular-resource.js | 596 + .../libs/angularjs/angular-resource.min.js | 13 + www/analytics/libs/angularjs/angular-route.js | 921 + .../libs/angularjs/angular-route.min.js | 14 + .../libs/angularjs/angular-sanitize.js | 625 + .../libs/angularjs/angular-sanitize.min.js | 13 + .../libs/angularjs/angular-scenario.js | 32880 ++++++++++++++++ www/analytics/libs/angularjs/angular-touch.js | 563 + .../libs/angularjs/angular-touch.min.js | 13 + www/analytics/libs/angularjs/angular.js | 20874 ++++++++++ www/analytics/libs/angularjs/angular.min.js | 203 + www/analytics/libs/angularjs/errors.json | 1 + www/analytics/libs/angularjs/version.json | 1 + www/analytics/libs/angularjs/version.txt | 1 + www/analytics/libs/html5shiv/html5shiv.js | 8 + www/analytics/libs/javascript/json2.js | 1 + www/analytics/libs/javascript/sprintf.js | 96 + www/analytics/libs/jqplot/MIT-LICENSE.txt | 21 + .../libs/jqplot/build_minified_script.sh | 26 + www/analytics/libs/jqplot/excanvas.min.js | 1 + www/analytics/libs/jqplot/gpl-2.0.txt | 280 + .../libs/jqplot/jqplot-custom.min.js | 172 + .../libs/jqplot/jqplot.axisLabelRenderer.js | 97 + .../libs/jqplot/jqplot.axisTickRenderer.js | 191 + .../libs/jqplot/jqplot.canvasGridRenderer.js | 383 + www/analytics/libs/jqplot/jqplot.core.js | 4105 ++ .../libs/jqplot/jqplot.divTitleRenderer.js | 120 + .../libs/jqplot/jqplot.linePattern.js | 149 + .../libs/jqplot/jqplot.lineRenderer.js | 1227 + .../libs/jqplot/jqplot.linearAxisRenderer.js | 1006 + .../libs/jqplot/jqplot.markerRenderer.js | 229 + .../libs/jqplot/jqplot.shadowRenderer.js | 140 + .../libs/jqplot/jqplot.shapeRenderer.js | 166 + www/analytics/libs/jqplot/jqplot.sprintf.js | 326 + .../libs/jqplot/jqplot.tableLegendRenderer.js | 323 + .../libs/jqplot/jqplot.themeEngine.js | 917 + .../libs/jqplot/plugins/jqplot.barRenderer.js | 801 + .../plugins/jqplot.canvasAxisTickRenderer.js | 253 + .../plugins/jqplot.canvasTextRenderer.js | 449 + .../plugins/jqplot.categoryAxisRenderer.js | 679 + .../libs/jqplot/plugins/jqplot.pieRenderer.js | 904 + www/analytics/libs/jquery/LICENSE-sizzle.txt | 148 + .../libs/jquery/MIT-LICENSE-history.txt | 20 + .../libs/jquery/MIT-LICENSE-jquery.txt | 20 + .../libs/jquery/MIT-LICENSE-jqueryui.txt | 25 + .../libs/jquery/MIT-LICENSE-placeholder.txt | 20 + .../libs/jquery/MIT-LICENSE-scrollto.txt | 19 + .../libs/jquery/MIT-LICENSE-smartbanner.txt | 19 + www/analytics/libs/jquery/gpl-2.0.txt | 278 + www/analytics/libs/jquery/gpl-3.0.txt | 674 + .../libs/jquery/images/down_arrow.png | Bin 0 -> 2898 bytes www/analytics/libs/jquery/images/scroller.png | Bin 0 -> 3329 bytes www/analytics/libs/jquery/images/slide.png | Bin 0 -> 2831 bytes www/analytics/libs/jquery/images/up_arrow.png | Bin 0 -> 2881 bytes www/analytics/libs/jquery/jquery-ui.js | 7 + www/analytics/libs/jquery/jquery.browser.js | 4 + www/analytics/libs/jquery/jquery.history.js | 181 + www/analytics/libs/jquery/jquery.js | 4 + .../libs/jquery/jquery.jscrollpane.js | 1341 + .../libs/jquery/jquery.mousewheel.js | 117 + .../libs/jquery/jquery.placeholder.js | 157 + www/analytics/libs/jquery/jquery.scrollTo.js | 7 + .../libs/jquery/jquery.smartbanner.js | 197 + www/analytics/libs/jquery/jquery.truncate.js | 60 + www/analytics/libs/jquery/mwheelIntent.js | 76 + .../jquery/stylesheets/jquery.jscrollpane.css | 119 + .../jquery/stylesheets/jquery.smartbanner.css | 27 + .../libs/jquery/stylesheets/scroll.less | 140 + .../base/images/ui-anim_basic_16x16.gif | Bin 0 -> 1553 bytes .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../base/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../base/images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../base/images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../base/images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../base/images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes .../libs/jquery/themes/base/jquery-ui.css | 10 + www/analytics/libs/pChart2.1.3/GPLv3.txt | 675 + www/analytics/libs/pChart2.1.3/change.log | 282 + .../libs/pChart2.1.3/class/pData.class.php | 787 + .../libs/pChart2.1.3/class/pDraw.class.php | 6203 +++ .../libs/pChart2.1.3/class/pImage.class.php | 482 + .../libs/pChart2.1.3/class/pPie.class.php | 1500 + www/analytics/libs/pChart2.1.3/readme.txt | 140 + www/analytics/libs/sparkline/CHANGES | 23 + www/analytics/libs/sparkline/DESIGN | 28 + www/analytics/libs/sparkline/LICENSE-BSD.txt | 29 + www/analytics/libs/sparkline/README | 46 + www/analytics/libs/sparkline/gpl-2.0.txt | 339 + www/analytics/libs/sparkline/lib/Object.php | 159 + .../libs/sparkline/lib/Sparkline.php | 494 + .../libs/sparkline/lib/Sparkline_Bar.php | 196 + .../libs/sparkline/lib/Sparkline_Line.php | 286 + www/analytics/libs/tcpdf/2dbarcodes.php | 172 + www/analytics/libs/tcpdf/LICENSE.TXT | 858 + www/analytics/libs/tcpdf/README.TXT | 111 + www/analytics/libs/tcpdf/barcodes.php | 1965 + www/analytics/libs/tcpdf/composer.json | 40 + www/analytics/libs/tcpdf/config/lang/eng.php | 47 + .../libs/tcpdf/config/tcpdf_config.php | 219 + .../libs/tcpdf/config/tcpdf_config_alt.php | 234 + .../libs/tcpdf/fonts/almohanad.ctg.z | Bin 0 -> 2780 bytes www/analytics/libs/tcpdf/fonts/almohanad.php | 102 + www/analytics/libs/tcpdf/fonts/almohanad.z | Bin 0 -> 121292 bytes .../libs/tcpdf/fonts/dejavusans.ctg.z | Bin 0 -> 10120 bytes www/analytics/libs/tcpdf/fonts/dejavusans.php | 15 + www/analytics/libs/tcpdf/fonts/dejavusans.z | Bin 0 -> 361229 bytes www/analytics/libs/tcpdf/fonts/helvetica.php | 13 + www/analytics/libs/tcpdf/fonts/helveticab.php | 12 + .../libs/tcpdf/fonts/helveticabi.php | 12 + www/analytics/libs/tcpdf/fonts/helveticai.php | 12 + .../libs/tcpdf/fonts/hysmyeongjostdmedium.php | 48 + .../libs/tcpdf/fonts/kozgopromedium.php | 65 + .../libs/tcpdf/fonts/kozminproregular.php | 63 + .../libs/tcpdf/fonts/msungstdlight.php | 38 + .../libs/tcpdf/fonts/stsongstdlight.php | 39 + www/analytics/libs/tcpdf/fonts/symbol.php | 12 + www/analytics/libs/tcpdf/fonts/times.php | 12 + www/analytics/libs/tcpdf/fonts/timesb.php | 12 + www/analytics/libs/tcpdf/fonts/timesbi.php | 12 + www/analytics/libs/tcpdf/fonts/timesi.php | 12 + www/analytics/libs/tcpdf/gpl.txt | 674 + www/analytics/libs/tcpdf/htmlcolors.php | 199 + www/analytics/libs/tcpdf/include/sRGB.icc | Bin 0 -> 3048 bytes .../libs/tcpdf/include/tcpdf_colors.php | 462 + .../libs/tcpdf/include/tcpdf_filters.php | 481 + .../libs/tcpdf/include/tcpdf_font_data.php | 18447 +++++++++ .../libs/tcpdf/include/tcpdf_fonts.php | 2582 ++ .../libs/tcpdf/include/tcpdf_images.php | 355 + .../libs/tcpdf/include/tcpdf_static.php | 2837 ++ www/analytics/libs/tcpdf/lgpl-3.0.txt | 165 + www/analytics/libs/tcpdf/pdf417.php | 991 + www/analytics/libs/tcpdf/qrcode.php | 2866 ++ www/analytics/libs/tcpdf/spotcolors.php | 57 + www/analytics/libs/tcpdf/tcpdf.crt | 40 + www/analytics/libs/tcpdf/tcpdf.fdf | Bin 0 -> 1286 bytes www/analytics/libs/tcpdf/tcpdf.p12 | Bin 0 -> 1749 bytes www/analytics/libs/tcpdf/tcpdf.php | 24144 ++++++++++++ www/analytics/libs/tcpdf/tcpdf_autoconfig.php | 233 + www/analytics/libs/tcpdf/tcpdf_import.php | 104 + www/analytics/libs/tcpdf/tcpdf_parser.php | 798 + www/analytics/libs/tcpdf/unicode_data.php | 18371 +++++++++ www/analytics/libs/upgradephp/README | 14 + www/analytics/libs/upgradephp/upgrade.php | 676 + www/analytics/misc/How to install Piwik.html | 7 + www/analytics/misc/cron/archive.php | 51 + www/analytics/misc/cron/archive.sh | 99 + www/analytics/misc/cron/updatetoken.php | 47 + www/analytics/misc/gpl-3.0.txt | 674 + www/analytics/misc/log-analytics/README.md | 259 + .../misc/log-analytics/import_logs.py | 1765 + .../misc/others/ExamplePiwikTracker.php | 17 + .../misc/others/api_internal_call.php | 32 + www/analytics/misc/others/api_rest_call.php | 30 + .../misc/others/cli-script-bootstrap.php | 39 + www/analytics/misc/others/download-count.txt | 13 + www/analytics/misc/others/geoipUpdateRows.php | 233 + www/analytics/misc/others/iframeWidget.htm | 13 + .../misc/others/iframeWidget_localhost.php | 63 + .../phpstorm-codestyles/Piwik_codestyle.xml | 159 + .../misc/others/phpstorm-codestyles/README.md | 21 + www/analytics/misc/others/stress.sh | 5 + ...kies_GenerateHundredsWebsitesAndVisits.php | 27 + .../test_generateLotsVisitsWebsites.php | 154 + .../others/tracker_simpleImageTracker.php | 30 + .../uninstall-delete-piwik-directory.php | 26 + .../others/widget_example_lastvisits.html | 11 + .../misc/proxy-hide-piwik-url/README.md | 55 + .../misc/proxy-hide-piwik-url/piwik.php | 73 + www/analytics/misc/user/.gitkeep | 0 www/analytics/misc/user/.htaccess | 33 + www/analytics/misc/user/index.html | 1 + www/analytics/piwik.js | 31 + www/analytics/piwik.php | 135 + www/analytics/plugins/.htaccess | 33 + www/analytics/plugins/API/API.php | 723 + www/analytics/plugins/API/Controller.php | 128 + www/analytics/plugins/API/ProcessedReport.php | 718 + www/analytics/plugins/API/RowEvolution.php | 529 + .../plugins/API/stylesheets/listAllAPI.less | 48 + .../plugins/API/templates/listAllAPI.twig | 32 + www/analytics/plugins/Actions/API.php | 596 + www/analytics/plugins/Actions/Actions.php | 937 + www/analytics/plugins/Actions/Archiver.php | 548 + .../plugins/Actions/ArchivingHelper.php | 612 + www/analytics/plugins/Actions/Controller.php | 151 + .../Actions/javascripts/actionsDataTable.js | 328 + .../Actions/stylesheets/dataTableActions.less | 4 + .../Actions/templates/indexSiteSearch.twig | 17 + www/analytics/plugins/Annotations/API.php | 371 + .../plugins/Annotations/AnnotationList.php | 455 + .../plugins/Annotations/Annotations.php | 44 + .../plugins/Annotations/Controller.php | 215 + .../Annotations/javascripts/annotations.js | 599 + .../Annotations/stylesheets/annotations.less | 209 + .../Annotations/templates/_annotation.twig | 45 + .../templates/_annotationList.twig | 29 + .../templates/getAnnotationManager.twig | 27 + .../templates/getEvolutionIcons.twig | 14 + .../Annotations/templates/saveAnnotation.twig | 1 + www/analytics/plugins/CoreAdminHome/API.php | 209 + .../plugins/CoreAdminHome/Controller.php | 351 + .../plugins/CoreAdminHome/CoreAdminHome.php | 129 + .../plugins/CoreAdminHome/CustomLogo.php | 203 + .../javascripts/generalSettings.js | 142 + .../javascripts/jsTrackingGenerator.js | 310 + .../javascripts/pluginSettings.js | 82 + .../stylesheets/generalSettings.less | 176 + .../stylesheets/jsTrackingGenerator.css | 79 + .../CoreAdminHome/stylesheets/menu.less | 78 + .../stylesheets/pluginSettings.less | 40 + .../CoreAdminHome/templates/_menu.twig | 23 + .../templates/generalSettings.twig | 324 + .../CoreAdminHome/templates/optOut.twig | 31 + .../templates/pluginSettings.twig | 173 + .../templates/trackingCodeGenerator.twig | 272 + .../CoreConsole/Commands/CodeCoverage.php | 90 + .../CoreConsole/Commands/CoreArchiver.php | 55 + .../CoreConsole/Commands/GenerateApi.php | 58 + .../CoreConsole/Commands/GenerateCommand.php | 89 + .../Commands/GenerateController.php | 58 + .../CoreConsole/Commands/GeneratePlugin.php | 223 + .../Commands/GeneratePluginBase.php | 143 + .../CoreConsole/Commands/GenerateSettings.php | 58 + .../CoreConsole/Commands/GenerateTest.php | 189 + .../Commands/GenerateVisualizationPlugin.php | 96 + .../CoreConsole/Commands/GitCommit.php | 142 + .../plugins/CoreConsole/Commands/GitPull.php | 55 + .../plugins/CoreConsole/Commands/GitPush.php | 43 + .../CoreConsole/Commands/ManagePlugin.php | 68 + .../CoreConsole/Commands/ManageTestFiles.php | 60 + .../plugins/CoreConsole/Commands/RunTests.php | 87 + .../CoreConsole/Commands/RunUITests.php | 70 + .../CoreConsole/Commands/SetupFixture.php | 156 + .../Commands/SyncUITestScreenshots.php | 81 + .../plugins/CoreConsole/Commands/WatchLog.php | 33 + www/analytics/plugins/CoreHome/Controller.php | 242 + www/analytics/plugins/CoreHome/CoreHome.php | 201 + .../DataTableRowAction/MultiRowEvolution.php | 71 + .../DataTableRowAction/RowEvolution.php | 342 + .../CoreHome/angularjs/anchorLinkFix.js | 108 + .../common/directives/autocomplete-matched.js | 42 + .../directives/autocomplete-matched_spec.js | 43 + .../angularjs/common/directives/dialog.js | 41 + .../angularjs/common/directives/directive.js | 8 + .../directives/focus-anywhere-but-here.js | 40 + .../angularjs/common/directives/focusif.js | 27 + .../common/directives/ignore-click.js | 21 + .../angularjs/common/directives/onenter.js | 27 + .../angularjs/common/filters/evolution.js | 44 + .../angularjs/common/filters/filter.js | 7 + .../angularjs/common/filters/startfrom.js | 13 + .../common/filters/startfrom_spec.js | 40 + .../angularjs/common/filters/translate.js | 19 + .../angularjs/common/services/piwik-api.js | 186 + .../angularjs/common/services/piwik.js | 13 + .../angularjs/common/services/piwik_spec.js | 37 + .../angularjs/common/services/service.js | 8 + .../enrichedheadline-directive.js | 66 + .../enrichedheadline/enrichedheadline.html | 29 + .../enrichedheadline/enrichedheadline.less | 44 + .../angularjs/enrichedheadline/help.png | Bin 0 -> 350 bytes .../plugins/CoreHome/angularjs/piwikApp.js | 16 + .../CoreHome/angularjs/piwikAppConfig.js | 9 + .../siteselector/siteselector-controller.js | 49 + .../siteselector/siteselector-directive.js | 80 + .../siteselector/siteselector-model.js | 75 + .../angularjs/siteselector/siteselector.html | 61 + .../angularjs/siteselector/siteselector.less | 177 + .../plugins/CoreHome/images/bg_header.jpg | Bin 0 -> 9097 bytes .../plugins/CoreHome/images/bullet1.gif | Bin 0 -> 52 bytes .../plugins/CoreHome/images/bullet2.gif | Bin 0 -> 52 bytes .../plugins/CoreHome/images/favicon.ico | Bin 0 -> 17947 bytes .../plugins/CoreHome/images/googleplay.png | Bin 0 -> 16550 bytes .../plugins/CoreHome/images/more.png | Bin 0 -> 1045 bytes .../plugins/CoreHome/images/more_date.gif | Bin 0 -> 56 bytes .../plugins/CoreHome/images/more_period.gif | Bin 0 -> 53 bytes .../plugins/CoreHome/images/promo_splash.png | Bin 0 -> 12070 bytes .../plugins/CoreHome/images/reset_search.png | Bin 0 -> 1021 bytes .../plugins/CoreHome/images/search.png | Bin 0 -> 136 bytes .../plugins/CoreHome/javascripts/broadcast.js | 644 + .../plugins/CoreHome/javascripts/calendar.js | 545 + .../CoreHome/javascripts/color_manager.js | 225 + .../plugins/CoreHome/javascripts/corehome.js | 160 + .../plugins/CoreHome/javascripts/dataTable.js | 1767 + .../javascripts/dataTable_rowactions.js | 386 + .../plugins/CoreHome/javascripts/donate.js | 142 + .../plugins/CoreHome/javascripts/menu.js | 110 + .../plugins/CoreHome/javascripts/menu_init.js | 19 + .../CoreHome/javascripts/notification.js | 198 + .../javascripts/notification_parser.js | 31 + .../plugins/CoreHome/javascripts/popover.js | 254 + .../plugins/CoreHome/javascripts/promo.js | 12 + .../plugins/CoreHome/javascripts/require.js | 39 + .../plugins/CoreHome/javascripts/sparkline.js | 83 + .../CoreHome/javascripts/top_controls.js | 27 + .../plugins/CoreHome/javascripts/uiControl.js | 113 + .../plugins/CoreHome/stylesheets/_donate.less | 125 + .../plugins/CoreHome/stylesheets/cloud.less | 55 + .../CoreHome/stylesheets/color_manager.css | 3 + .../CoreHome/stylesheets/coreHome.less | 260 + .../CoreHome/stylesheets/dataTable.less | 10 + .../stylesheets/dataTable/_dataTable.less | 613 + .../dataTable/_limitSelection.less | 68 + .../dataTable/_reportDocumentation.less | 61 + .../stylesheets/dataTable/_rowActions.less | 36 + .../stylesheets/dataTable/_subDataTable.less | 46 + .../dataTable/_tableConfiguration.less | 82 + .../CoreHome/stylesheets/jqplotColors.less | 150 + .../stylesheets/jquery.ui.autocomplete.css | 70 + .../plugins/CoreHome/stylesheets/menu.less | 131 + .../CoreHome/stylesheets/notification.less | 93 + .../plugins/CoreHome/stylesheets/promo.less | 72 + .../CoreHome/stylesheets/sparklineColors.less | 30 + .../ReportRenderer/_htmlReportBody.twig | 80 + .../ReportRenderer/_htmlReportFooter.twig | 2 + .../ReportRenderer/_htmlReportHeader.twig | 36 + .../_reportsByDimension.twig | 29 + .../CoreHome/templates/_dataTable.twig | 40 + .../CoreHome/templates/_dataTableCell.twig | 49 + .../CoreHome/templates/_dataTableFooter.twig | 140 + .../CoreHome/templates/_dataTableHead.twig | 17 + .../CoreHome/templates/_dataTableJS.twig | 5 + .../plugins/CoreHome/templates/_donate.twig | 63 + .../CoreHome/templates/_headerMessage.twig | 47 + .../CoreHome/templates/_indexContent.twig | 20 + .../templates/_javaScriptDisabled.twig | 3 + .../plugins/CoreHome/templates/_logo.twig | 10 + .../plugins/CoreHome/templates/_menu.twig | 23 + .../CoreHome/templates/_notifications.twig | 9 + .../CoreHome/templates/_periodSelect.twig | 37 + .../CoreHome/templates/_singleReport.twig | 2 + .../CoreHome/templates/_siteSelectHeader.twig | 5 + .../plugins/CoreHome/templates/_topBar.twig | 5 + .../CoreHome/templates/_topBarHelloMenu.twig | 25 + .../CoreHome/templates/_topBarTopMenu.twig | 13 + .../CoreHome/templates/_topScreen.twig | 4 + .../CoreHome/templates/_uiControl.twig | 6 + .../templates/_warningInvalidHost.twig | 21 + .../CoreHome/templates/checkForUpdates.twig | 1 + .../templates/getDefaultIndexView.twig | 14 + .../CoreHome/templates/getDonateForm.twig | 1 + .../getMultiRowEvolutionPopover.twig | 40 + .../CoreHome/templates/getPromoVideo.twig | 37 + .../templates/getRowEvolutionPopover.twig | 39 + .../plugins/CorePluginsAdmin/Controller.php | 481 + .../CorePluginsAdmin/CorePluginsAdmin.php | 137 + .../plugins/CorePluginsAdmin/Marketplace.php | 197 + .../CorePluginsAdmin/MarketplaceApiClient.php | 202 + .../MarketplaceApiException.php | 17 + .../CorePluginsAdmin/PluginInstaller.php | 294 + .../PluginInstallerException.php | 17 + .../CorePluginsAdmin/UpdateCommunication.php | 210 + .../CorePluginsAdmin/images/plugins.png | Bin 0 -> 14076 bytes .../images/rating_important.png | Bin 0 -> 673 bytes .../CorePluginsAdmin/images/themes.png | Bin 0 -> 79517 bytes .../javascripts/pluginDetail.js | 88 + .../javascripts/pluginExtend.js | 31 + .../javascripts/pluginOverview.js | 37 + .../CorePluginsAdmin/javascripts/plugins.js | 93 + .../stylesheets/marketplace.less | 367 + .../stylesheets/plugins_admin.less | 54 + .../templates/browsePlugins.twig | 50 + .../templates/browsePluginsActions.twig | 12 + .../templates/browseThemes.twig | 45 + .../CorePluginsAdmin/templates/extend.twig | 70 + .../templates/installPlugin.twig | 41 + .../CorePluginsAdmin/templates/macros.twig | 256 + .../templates/pluginDetails.twig | 204 + .../templates/pluginMetadata.twig | 9 + .../templates/pluginOverview.twig | 30 + .../CorePluginsAdmin/templates/plugins.twig | 31 + .../CorePluginsAdmin/templates/safemode.twig | 114 + .../templates/themeOverview.twig | 30 + .../CorePluginsAdmin/templates/themes.twig | 33 + .../templates/updatePlugin.twig | 41 + .../templates/uploadPlugin.twig | 44 + .../plugins/CoreUpdater/Commands/Update.php | 62 + .../plugins/CoreUpdater/Controller.php | 432 + .../plugins/CoreUpdater/CoreUpdater.php | 160 + .../CoreUpdater/NoUpdatesFoundException.php | 13 + .../CoreUpdater/UpdateCommunication.php | 157 + .../CoreUpdater/javascripts/updateLayout.js | 8 + .../CoreUpdater/stylesheets/updateLayout.css | 38 + .../plugins/CoreUpdater/templates/layout.twig | 36 + .../templates/newVersionAvailable.twig | 42 + .../templates/oneClickResults.twig | 26 + .../templates/runUpdaterAndExit_done.twig | 78 + .../templates/runUpdaterAndExit_done_cli.twig | 55 + .../templates/runUpdaterAndExit_welcome.twig | 100 + .../runUpdaterAndExit_welcome_cli.twig | 48 + .../CoreVisualizations/CoreVisualizations.php | 71 + .../JqplotDataGenerator.php | 160 + .../JqplotDataGenerator/Chart.php | 119 + .../JqplotDataGenerator/Evolution.php | 188 + .../Visualizations/Cloud.php | 195 + .../Visualizations/Cloud/Config.php | 35 + .../Visualizations/Graph.php | 157 + .../Visualizations/Graph/Config.php | 122 + .../Visualizations/HtmlTable.php | 77 + .../Visualizations/HtmlTable/AllColumns.php | 66 + .../Visualizations/HtmlTable/Config.php | 119 + .../HtmlTable/RequestConfig.php | 54 + .../Visualizations/JqplotGraph.php | 48 + .../Visualizations/JqplotGraph/Bar.php | 43 + .../Visualizations/JqplotGraph/Config.php | 65 + .../Visualizations/JqplotGraph/Evolution.php | 200 + .../JqplotGraph/Evolution/Config.php | 41 + .../Visualizations/JqplotGraph/Pie.php | 58 + .../Visualizations/Sparkline.php | 128 + .../CoreVisualizations/javascripts/jqplot.js | 1100 + .../javascripts/jqplotBarGraph.js | 80 + .../javascripts/jqplotEvolutionGraph.js | 135 + .../javascripts/jqplotPieGraph.js | 81 + .../javascripts/seriesPicker.js | 366 + .../stylesheets/dataTableVisualizations.less | 28 + .../CoreVisualizations/stylesheets/jqplot.css | 259 + .../templates/_dataTableViz_htmlTable.twig | 50 + .../templates/_dataTableViz_jqplotGraph.twig | 3 + .../templates/_dataTableViz_tagCloud.twig | 18 + www/analytics/plugins/CustomVariables/API.php | 109 + .../plugins/CustomVariables/Archiver.php | 220 + .../plugins/CustomVariables/Commands/Info.php | 69 + .../Commands/SetNumberOfCustomVariables.php | 210 + .../plugins/CustomVariables/Controller.php | 36 + .../CustomVariables/CustomVariables.php | 215 + .../plugins/CustomVariables/Model.php | 186 + www/analytics/plugins/DBStats/.gitignore | 1 + www/analytics/plugins/DBStats/API.php | 283 + www/analytics/plugins/DBStats/Controller.php | 160 + www/analytics/plugins/DBStats/DBStats.php | 386 + .../DBStats/MySQLMetadataDataAccess.php | 70 + .../plugins/DBStats/MySQLMetadataProvider.php | 356 + www/analytics/plugins/DBStats/lang/am.json | 10 + www/analytics/plugins/DBStats/lang/ar.json | 17 + www/analytics/plugins/DBStats/lang/be.json | 13 + www/analytics/plugins/DBStats/lang/bg.json | 21 + www/analytics/plugins/DBStats/lang/bn.json | 5 + www/analytics/plugins/DBStats/lang/bs.json | 8 + www/analytics/plugins/DBStats/lang/ca.json | 21 + www/analytics/plugins/DBStats/lang/cs.json | 20 + www/analytics/plugins/DBStats/lang/da.json | 21 + www/analytics/plugins/DBStats/lang/de.json | 21 + www/analytics/plugins/DBStats/lang/el.json | 21 + www/analytics/plugins/DBStats/lang/en.json | 21 + www/analytics/plugins/DBStats/lang/es.json | 21 + www/analytics/plugins/DBStats/lang/et.json | 21 + www/analytics/plugins/DBStats/lang/eu.json | 12 + www/analytics/plugins/DBStats/lang/fa.json | 21 + www/analytics/plugins/DBStats/lang/fi.json | 21 + www/analytics/plugins/DBStats/lang/fr.json | 21 + www/analytics/plugins/DBStats/lang/he.json | 13 + www/analytics/plugins/DBStats/lang/hi.json | 21 + www/analytics/plugins/DBStats/lang/hu.json | 13 + www/analytics/plugins/DBStats/lang/id.json | 21 + www/analytics/plugins/DBStats/lang/is.json | 12 + www/analytics/plugins/DBStats/lang/it.json | 21 + www/analytics/plugins/DBStats/lang/ja.json | 21 + www/analytics/plugins/DBStats/lang/ka.json | 13 + www/analytics/plugins/DBStats/lang/ko.json | 21 + www/analytics/plugins/DBStats/lang/lt.json | 13 + www/analytics/plugins/DBStats/lang/lv.json | 13 + www/analytics/plugins/DBStats/lang/nb.json | 16 + www/analytics/plugins/DBStats/lang/nl.json | 21 + www/analytics/plugins/DBStats/lang/nn.json | 21 + www/analytics/plugins/DBStats/lang/pl.json | 13 + www/analytics/plugins/DBStats/lang/pt-br.json | 21 + www/analytics/plugins/DBStats/lang/pt.json | 13 + www/analytics/plugins/DBStats/lang/ro.json | 20 + www/analytics/plugins/DBStats/lang/ru.json | 21 + www/analytics/plugins/DBStats/lang/sk.json | 13 + www/analytics/plugins/DBStats/lang/sl.json | 14 + www/analytics/plugins/DBStats/lang/sq.json | 13 + www/analytics/plugins/DBStats/lang/sr.json | 21 + www/analytics/plugins/DBStats/lang/sv.json | 21 + www/analytics/plugins/DBStats/lang/ta.json | 15 + www/analytics/plugins/DBStats/lang/te.json | 6 + www/analytics/plugins/DBStats/lang/th.json | 14 + www/analytics/plugins/DBStats/lang/tr.json | 16 + www/analytics/plugins/DBStats/lang/uk.json | 13 + www/analytics/plugins/DBStats/lang/vi.json | 21 + www/analytics/plugins/DBStats/lang/zh-cn.json | 21 + www/analytics/plugins/DBStats/lang/zh-tw.json | 14 + .../DBStats/stylesheets/dbStatsTable.less | 16 + .../plugins/DBStats/templates/index.twig | 128 + www/analytics/plugins/Dashboard/API.php | 147 + .../plugins/Dashboard/Controller.php | 345 + www/analytics/plugins/Dashboard/Dashboard.php | 278 + .../Dashboard/DashboardManagerControl.php | 53 + .../DashboardSettingsControlBase.php | 30 + .../Dashboard/javascripts/dashboard.js | 306 + .../Dashboard/javascripts/dashboardObject.js | 577 + .../Dashboard/javascripts/dashboardWidget.js | 331 + .../Dashboard/javascripts/widgetMenu.js | 421 + .../Dashboard/stylesheets/dashboard.less | 540 + .../Dashboard/stylesheets/standalone.css | 72 + .../templates/_dashboardSettings.twig | 22 + .../plugins/Dashboard/templates/_header.twig | 16 + .../templates/_widgetFactoryTemplate.twig | 22 + .../Dashboard/templates/embeddedIndex.twig | 98 + .../plugins/Dashboard/templates/index.twig | 20 + .../plugins/DevicesDetection/API.php | 153 + .../plugins/DevicesDetection/Archiver.php | 67 + .../plugins/DevicesDetection/Controller.php | 172 + .../DevicesDetection/DevicesDetection.php | 380 + .../plugins/DevicesDetection/Updates/1.14.php | 37 + .../plugins/DevicesDetection/functions.php | 220 + .../DevicesDetection/images/brand/Acer.ico | Bin 0 -> 673 bytes .../DevicesDetection/images/brand/Alcatel.ico | Bin 0 -> 577 bytes .../DevicesDetection/images/brand/Apple.ico | Bin 0 -> 1179 bytes .../DevicesDetection/images/brand/Archos.ico | Bin 0 -> 205 bytes .../DevicesDetection/images/brand/Asus.ico | Bin 0 -> 1016 bytes .../images/brand/Audiovox.ico | Bin 0 -> 807 bytes .../DevicesDetection/images/brand/Avvio.ico | Bin 0 -> 964 bytes .../images/brand/BangOlufsen.ico | Bin 0 -> 3692 bytes .../DevicesDetection/images/brand/Becker.ico | Bin 0 -> 519 bytes .../DevicesDetection/images/brand/Beetel.ico | Bin 0 -> 1645 bytes .../DevicesDetection/images/brand/BenQ.ico | Bin 0 -> 846 bytes .../DevicesDetection/images/brand/Cat.ico | Bin 0 -> 809 bytes .../DevicesDetection/images/brand/CnM.ico | Bin 0 -> 421 bytes .../DevicesDetection/images/brand/Compal.ico | Bin 0 -> 432 bytes .../DevicesDetection/images/brand/CreNova.ico | Bin 0 -> 3142 bytes .../DevicesDetection/images/brand/Cricket.ico | Bin 0 -> 1483 bytes .../DevicesDetection/images/brand/DMM.ico | Bin 0 -> 3623 bytes .../DevicesDetection/images/brand/Dell.ico | Bin 0 -> 886 bytes .../DevicesDetection/images/brand/Denver.ico | Bin 0 -> 552 bytes .../DevicesDetection/images/brand/DoCoMo.ico | Bin 0 -> 636 bytes .../images/brand/Ericsson.ico | Bin 0 -> 684 bytes .../DevicesDetection/images/brand/Fly.ico | Bin 0 -> 572 bytes .../DevicesDetection/images/brand/Gemini.ico | Bin 0 -> 323 bytes .../DevicesDetection/images/brand/Google.ico | Bin 0 -> 863 bytes .../images/brand/Gradiente.ico | Bin 0 -> 1012 bytes .../DevicesDetection/images/brand/Grundig.ico | Bin 0 -> 3029 bytes .../DevicesDetection/images/brand/HP.ico | Bin 0 -> 936 bytes .../DevicesDetection/images/brand/HTC.ico | Bin 0 -> 1161 bytes .../DevicesDetection/images/brand/Haier.ico | Bin 0 -> 957 bytes .../DevicesDetection/images/brand/Huawei.ico | Bin 0 -> 1022 bytes .../DevicesDetection/images/brand/Humax.ico | Bin 0 -> 3010 bytes .../DevicesDetection/images/brand/INQ.ico | Bin 0 -> 1059 bytes .../DevicesDetection/images/brand/Ikea.ico | Bin 0 -> 3291 bytes .../DevicesDetection/images/brand/Intek.ico | Bin 0 -> 3121 bytes .../DevicesDetection/images/brand/Inverto.ico | Bin 0 -> 3292 bytes .../DevicesDetection/images/brand/Jolla.ico | Bin 0 -> 494 bytes .../DevicesDetection/images/brand/KDDI.ico | Bin 0 -> 473 bytes .../DevicesDetection/images/brand/Karbonn.ico | Bin 0 -> 1042 bytes .../DevicesDetection/images/brand/Kindle.ico | Bin 0 -> 720 bytes .../DevicesDetection/images/brand/Kyocera.ico | Bin 0 -> 639 bytes .../DevicesDetection/images/brand/LG.ico | Bin 0 -> 1510 bytes .../DevicesDetection/images/brand/LGUPlus.ico | Bin 0 -> 1081 bytes .../DevicesDetection/images/brand/Lanix.ico | Bin 0 -> 437 bytes .../DevicesDetection/images/brand/Lenovo.ico | Bin 0 -> 237 bytes .../DevicesDetection/images/brand/Loewe.ico | Bin 0 -> 2938 bytes .../images/brand/Manta_Multimedia.ico | Bin 0 -> 800 bytes .../images/brand/MediaTek.ico | Bin 0 -> 2976 bytes .../DevicesDetection/images/brand/Medion.ico | Bin 0 -> 3161 bytes .../DevicesDetection/images/brand/Metz.ico | Bin 0 -> 3244 bytes .../images/brand/MicroMax.ico | Bin 0 -> 1531 bytes .../images/brand/Microsoft.ico | Bin 0 -> 285 bytes .../DevicesDetection/images/brand/Mio.ico | Bin 0 -> 753 bytes .../images/brand/Mitsubishi.ico | Bin 0 -> 342 bytes .../images/brand/Motorola.ico | Bin 0 -> 465 bytes .../DevicesDetection/images/brand/MyPhone.ico | Bin 0 -> 933 bytes .../DevicesDetection/images/brand/NEC.ico | Bin 0 -> 450 bytes .../DevicesDetection/images/brand/NGM.ico | Bin 0 -> 1298 bytes .../DevicesDetection/images/brand/Nexian.ico | Bin 0 -> 2041 bytes .../images/brand/Nintendo.ico | Bin 0 -> 740 bytes .../DevicesDetection/images/brand/Nokia.ico | Bin 0 -> 1283 bytes .../DevicesDetection/images/brand/O2.ico | Bin 0 -> 768 bytes .../DevicesDetection/images/brand/OPPO.ico | Bin 0 -> 870 bytes .../DevicesDetection/images/brand/Onda.ico | Bin 0 -> 732 bytes .../DevicesDetection/images/brand/Orange.ico | Bin 0 -> 461 bytes .../DevicesDetection/images/brand/PEAQ.ico | Bin 0 -> 3060 bytes .../images/brand/Panasonic.ico | Bin 0 -> 3649 bytes .../DevicesDetection/images/brand/Pantech.ico | Bin 0 -> 605 bytes .../DevicesDetection/images/brand/Philips.ico | Bin 0 -> 3749 bytes .../images/brand/Polaroid.ico | Bin 0 -> 737 bytes .../DevicesDetection/images/brand/PolyPad.ico | Bin 0 -> 1381 bytes .../DevicesDetection/images/brand/RIM.ico | Bin 0 -> 705 bytes .../DevicesDetection/images/brand/Sagem.ico | Bin 0 -> 694 bytes .../DevicesDetection/images/brand/Samsung.ico | Bin 0 -> 3095 bytes .../DevicesDetection/images/brand/Sanyo.ico | Bin 0 -> 639 bytes .../DevicesDetection/images/brand/Sega.ico | Bin 0 -> 706 bytes .../images/brand/Selevision.ico | Bin 0 -> 3497 bytes .../DevicesDetection/images/brand/Sharp.ico | Bin 0 -> 403 bytes .../DevicesDetection/images/brand/Siemens.ico | Bin 0 -> 395 bytes .../DevicesDetection/images/brand/Smart.ico | Bin 0 -> 3419 bytes .../images/brand/Softbank.ico | Bin 0 -> 381 bytes .../DevicesDetection/images/brand/Sony.ico | Bin 0 -> 3525 bytes .../images/brand/Sony_Ericsson.ico | Bin 0 -> 628 bytes .../DevicesDetection/images/brand/Spice.ico | Bin 0 -> 556 bytes .../images/brand/T-Mobile.ico | Bin 0 -> 499 bytes .../DevicesDetection/images/brand/TCL.ico | Bin 0 -> 2927 bytes .../images/brand/TechniSat.ico | Bin 0 -> 3347 bytes .../images/brand/TechnoTrend.ico | Bin 0 -> 3500 bytes .../images/brand/Telefunken.ico | Bin 0 -> 3651 bytes .../DevicesDetection/images/brand/Telit.ico | Bin 0 -> 527 bytes .../DevicesDetection/images/brand/Thomson.ico | Bin 0 -> 2974 bytes .../DevicesDetection/images/brand/TiPhone.ico | Bin 0 -> 1179 bytes .../DevicesDetection/images/brand/Toshiba.ico | Bin 0 -> 248 bytes .../DevicesDetection/images/brand/Vertu.ico | Bin 0 -> 387 bytes .../DevicesDetection/images/brand/Vestel.ico | Bin 0 -> 3096 bytes .../images/brand/Videocon.ico | Bin 0 -> 617 bytes .../images/brand/Videoweb.ico | Bin 0 -> 3129 bytes .../images/brand/ViewSonic.ico | Bin 0 -> 605 bytes .../DevicesDetection/images/brand/Voxtel.ico | Bin 0 -> 222 bytes .../DevicesDetection/images/brand/Xiaomi.ico | Bin 0 -> 492 bytes .../DevicesDetection/images/brand/Yuandao.ico | Bin 0 -> 639 bytes .../DevicesDetection/images/brand/ZTE.ico | Bin 0 -> 555 bytes .../DevicesDetection/images/brand/Zonda.ico | Bin 0 -> 371 bytes .../DevicesDetection/images/brand/eTouch.ico | Bin 0 -> 889 bytes .../images/brand/i-mobile.ico | Bin 0 -> 615 bytes .../DevicesDetection/images/brand/unknown.ico | Bin 0 -> 1077 bytes .../images/screens/camera.png | Bin 0 -> 644 bytes .../images/screens/carbrowser.png | Bin 0 -> 3218 bytes .../images/screens/computer.png | Bin 0 -> 550 bytes .../images/screens/console.gif | Bin 0 -> 617 bytes .../DevicesDetection/images/screens/dual.gif | Bin 0 -> 1082 bytes .../images/screens/mobile.gif | Bin 0 -> 324 bytes .../images/screens/normal.gif | Bin 0 -> 1088 bytes .../images/screens/smartphone.png | Bin 0 -> 547 bytes .../images/screens/tablet.png | Bin 0 -> 602 bytes .../DevicesDetection/images/screens/tv.png | Bin 0 -> 644 bytes .../images/screens/unknown.gif | Bin 0 -> 80 bytes .../DevicesDetection/images/screens/wide.gif | Bin 0 -> 1025 bytes .../plugins/DevicesDetection/lang/bg.json | 27 + .../plugins/DevicesDetection/lang/cs.json | 11 + .../plugins/DevicesDetection/lang/da.json | 29 + .../plugins/DevicesDetection/lang/de.json | 29 + .../plugins/DevicesDetection/lang/el.json | 29 + .../plugins/DevicesDetection/lang/en.json | 29 + .../plugins/DevicesDetection/lang/es.json | 29 + .../plugins/DevicesDetection/lang/et.json | 28 + .../plugins/DevicesDetection/lang/fa.json | 28 + .../plugins/DevicesDetection/lang/fi.json | 29 + .../plugins/DevicesDetection/lang/fr.json | 29 + .../plugins/DevicesDetection/lang/it.json | 29 + .../plugins/DevicesDetection/lang/ja.json | 29 + .../plugins/DevicesDetection/lang/nb.json | 13 + .../plugins/DevicesDetection/lang/nl.json | 27 + .../plugins/DevicesDetection/lang/pt-br.json | 24 + .../plugins/DevicesDetection/lang/ro.json | 25 + .../plugins/DevicesDetection/lang/ru.json | 18 + .../plugins/DevicesDetection/lang/sr.json | 16 + .../plugins/DevicesDetection/lang/sv.json | 29 + .../DevicesDetection/templates/detection.twig | 97 + .../DevicesDetection/templates/index.twig | 15 + .../DevicesDetection/templates/list.twig | 7 + www/analytics/plugins/Events/API.php | 204 + www/analytics/plugins/Events/Archiver.php | 260 + www/analytics/plugins/Events/Controller.php | 115 + www/analytics/plugins/Events/Events.php | 306 + www/analytics/plugins/Events/lang/bg.json | 10 + www/analytics/plugins/Events/lang/da.json | 10 + www/analytics/plugins/Events/lang/de.json | 21 + www/analytics/plugins/Events/lang/el.json | 10 + www/analytics/plugins/Events/lang/en.json | 31 + www/analytics/plugins/Events/lang/es.json | 21 + www/analytics/plugins/Events/lang/et.json | 10 + www/analytics/plugins/Events/lang/fa.json | 10 + www/analytics/plugins/Events/lang/fi.json | 10 + www/analytics/plugins/Events/lang/fr.json | 10 + www/analytics/plugins/Events/lang/it.json | 21 + www/analytics/plugins/Events/lang/ja.json | 10 + www/analytics/plugins/Events/lang/nl.json | 10 + www/analytics/plugins/Events/lang/pt-br.json | 9 + www/analytics/plugins/Events/lang/ro.json | 21 + www/analytics/plugins/Events/lang/sr.json | 13 + www/analytics/plugins/Events/lang/sv.json | 10 + www/analytics/plugins/Events/lang/ta.json | 9 + www/analytics/plugins/Events/lang/vi.json | 9 + www/analytics/plugins/Events/lang/zh-cn.json | 9 + www/analytics/plugins/Events/plugin.json | 6 + .../plugins/Events/templates/index.twig | 2 + www/analytics/plugins/ExampleAPI/API.php | 159 + .../plugins/ExampleAPI/ExampleAPI.php | 18 + www/analytics/plugins/ExampleAPI/plugin.json | 15 + .../ExampleCommand/Commands/HelloWorld.php | 40 + .../plugins/ExampleCommand/plugin.json | 6 + .../plugins/ExamplePlugin/.gitignore | 1 + .../plugins/ExamplePlugin/.travis.yml | 42 + www/analytics/plugins/ExamplePlugin/API.php | 36 + .../plugins/ExamplePlugin/Controller.php | 27 + .../plugins/ExamplePlugin/ExamplePlugin.php | 29 + www/analytics/plugins/ExamplePlugin/README.md | 18 + .../ExamplePlugin/javascripts/plugin.js | 20 + .../plugins/ExamplePlugin/plugin.json | 13 + .../ExamplePlugin/screenshots/.gitkeep | 0 .../ExamplePlugin/templates/index.twig | 4 + .../plugins/ExampleRssWidget/Controller.php | 53 + .../ExampleRssWidget/ExampleRssWidget.php | 39 + .../plugins/ExampleRssWidget/RssRenderer.php | 84 + .../plugins/ExampleRssWidget/plugin.json | 15 + .../ExampleRssWidget/stylesheets/rss.less | 33 + .../ExampleSettingsPlugin/Settings.php | 157 + .../plugins/ExampleSettingsPlugin/plugin.json | 6 + www/analytics/plugins/ExampleTheme/README.md | 21 + .../plugins/ExampleTheme/plugin.json | 7 + .../ExampleTheme/stylesheets/theme.less | 0 www/analytics/plugins/ExampleUI/API.php | 102 + .../plugins/ExampleUI/Controller.php | 196 + www/analytics/plugins/ExampleUI/ExampleUI.php | 55 + .../ExampleUI/images/icons-planet/LICENSE | 3 + .../ExampleUI/images/icons-planet/earth.png | Bin 0 -> 11823 bytes .../ExampleUI/images/icons-planet/jupiter.png | Bin 0 -> 10686 bytes .../ExampleUI/images/icons-planet/mars.png | Bin 0 -> 9837 bytes .../ExampleUI/images/icons-planet/mercury.png | Bin 0 -> 10322 bytes .../ExampleUI/images/icons-planet/neptune.png | Bin 0 -> 9770 bytes .../ExampleUI/images/icons-planet/saturn.png | Bin 0 -> 10561 bytes .../ExampleUI/images/icons-planet/uranus.png | Bin 0 -> 10358 bytes .../ExampleUI/images/icons-planet/venus.png | Bin 0 -> 10557 bytes www/analytics/plugins/ExampleUI/plugin.json | 15 + .../ExampleUI/templates/evolutiongraph.twig | 3 + .../ExampleUI/templates/notifications.twig | 9 + .../ExampleUI/templates/sparklines.twig | 9 + .../ExampleVisualization.php | 29 + .../plugins/ExampleVisualization/README.md | 18 + .../ExampleVisualization/SimpleTable.php | 71 + .../ExampleVisualization/images/table.png | Bin 0 -> 151 bytes .../plugins/ExampleVisualization/plugin.json | 16 + .../templates/simpleTable.twig | 26 + www/analytics/plugins/Feedback/API.php | 108 + www/analytics/plugins/Feedback/Controller.php | 34 + www/analytics/plugins/Feedback/Feedback.php | 70 + .../angularjs/ratefeature/icon_license | 7 + .../ratefeature/ratefeature-controller.js | 23 + .../ratefeature/ratefeature-directive.js | 22 + .../ratefeature/ratefeature-model.js | 22 + .../angularjs/ratefeature/ratefeature.html | 38 + .../angularjs/ratefeature/ratefeature.less | 30 + .../angularjs/ratefeature/thumbs-down.png | Bin 0 -> 2188 bytes .../angularjs/ratefeature/thumbs-up.png | Bin 0 -> 2202 bytes .../plugins/Feedback/images/facebook.png | Bin 0 -> 302 bytes .../plugins/Feedback/images/github.png | Bin 0 -> 361 bytes .../plugins/Feedback/images/linkedin.png | Bin 0 -> 336 bytes .../plugins/Feedback/images/newsletter.png | Bin 0 -> 444 bytes .../plugins/Feedback/images/twitter.png | Bin 0 -> 376 bytes .../Feedback/stylesheets/feedback.less | 115 + .../plugins/Feedback/templates/index.twig | 106 + www/analytics/plugins/Goals/API.php | 567 + www/analytics/plugins/Goals/Archiver.php | 418 + www/analytics/plugins/Goals/Controller.php | 494 + www/analytics/plugins/Goals/Goals.php | 680 + .../plugins/Goals/Visualizations/Goals.php | 258 + .../plugins/Goals/javascripts/goalsForm.js | 173 + .../plugins/Goals/stylesheets/goals.css | 27 + .../plugins/Goals/templates/_addEditGoal.twig | 81 + .../plugins/Goals/templates/_formAddGoal.twig | 97 + .../Goals/templates/_listGoalEdit.twig | 64 + .../Goals/templates/_listTopDimension.twig | 16 + .../templates/_titleAndEvolutionGraph.twig | 81 + .../plugins/Goals/templates/addNewGoal.twig | 11 + .../Goals/templates/getGoalReportView.twig | 66 + .../Goals/templates/getOverviewView.twig | 50 + www/analytics/plugins/ImageGraph/API.php | 548 + .../plugins/ImageGraph/Controller.php | 76 + .../plugins/ImageGraph/ImageGraph.php | 161 + .../plugins/ImageGraph/StaticGraph.php | 355 + .../ImageGraph/StaticGraph/Evolution.php | 30 + .../ImageGraph/StaticGraph/Exception.php | 78 + .../ImageGraph/StaticGraph/GridGraph.php | 485 + .../ImageGraph/StaticGraph/HorizontalBar.php | 186 + .../plugins/ImageGraph/StaticGraph/Pie.php | 27 + .../plugins/ImageGraph/StaticGraph/Pie3D.php | 27 + .../ImageGraph/StaticGraph/PieGraph.php | 128 + .../ImageGraph/StaticGraph/VerticalBar.php | 35 + .../plugins/ImageGraph/fonts/tahoma.ttf | Bin 0 -> 94740 bytes .../plugins/ImageGraph/templates/index.twig | 6 + .../ImageGraph/templates/testAllSizes.twig | 55 + www/analytics/plugins/Insights/API.php | 350 + www/analytics/plugins/Insights/Controller.php | 84 + .../DataTable/Filter/ExcludeLowValue.php | 56 + .../Insights/DataTable/Filter/Insight.php | 119 + .../Insights/DataTable/Filter/Limit.php | 54 + .../Insights/DataTable/Filter/MinGrowth.php | 51 + .../Insights/DataTable/Filter/OrderBy.php | 92 + .../plugins/Insights/InsightReport.php | 288 + www/analytics/plugins/Insights/Insights.php | 51 + www/analytics/plugins/Insights/Model.php | 120 + .../Insights/Visualizations/Insight.php | 121 + .../Visualizations/Insight/RequestConfig.php | 45 + .../plugins/Insights/images/idea.png | Bin 0 -> 364 bytes .../Insights/javascripts/insightsDataTable.js | 118 + www/analytics/plugins/Insights/plugin.json | 15 + .../stylesheets/insightVisualization.less | 49 + .../templates/cannotDisplayReport.twig | 3 + .../Insights/templates/insightControls.twig | 65 + .../templates/insightVisualization.twig | 34 + .../templates/insightsOverviewWidget.twig | 5 + .../moversAndShakersOverviewWidget.twig | 6 + .../Insights/templates/overviewWidget.twig | 38 + .../Insights/templates/table_header.twig | 13 + .../plugins/Insights/templates/table_row.twig | 29 + .../plugins/Installation/Controller.php | 1122 + .../Installation/FormDatabaseSetup.php | 315 + .../Installation/FormFirstWebsiteSetup.php | 89 + .../plugins/Installation/FormGeneralSetup.php | 105 + .../plugins/Installation/Installation.php | 122 + .../Installation/ServerFilesGenerator.php | 132 + www/analytics/plugins/Installation/View.php | 51 + .../Installation/javascripts/installation.js | 8 + .../Installation/stylesheets/installation.css | 250 + .../stylesheets/systemCheckPage.less | 45 + .../Installation/templates/_allSteps.twig | 11 + .../templates/_integrityDetails.twig | 40 + .../templates/_systemCheckLegend.twig | 15 + .../templates/_systemCheckSection.twig | 329 + .../Installation/templates/databaseCheck.twig | 36 + .../Installation/templates/databaseSetup.twig | 18 + .../Installation/templates/finished.twig | 24 + .../templates/firstWebsiteSetup.twig | 27 + .../Installation/templates/generalSetup.twig | 18 + .../Installation/templates/layout.twig | 62 + .../Installation/templates/reuseTables.twig | 81 + .../Installation/templates/systemCheck.twig | 21 + .../templates/systemCheckPage.twig | 20 + .../templates/tablesCreation.twig | 61 + .../Installation/templates/trackingCode.twig | 17 + .../Installation/templates/welcome.twig | 45 + .../plugins/LanguagesManager/API.php | 270 + .../LanguagesManager/Commands/CreatePull.php | 220 + .../Commands/FetchFromOTrance.php | 172 + .../Commands/LanguageCodes.php | 41 + .../Commands/LanguageNames.php | 41 + .../Commands/PluginsWithTranslations.php | 39 + .../Commands/SetTranslations.php | 105 + .../LanguagesManager/Commands/Update.php | 162 + .../plugins/LanguagesManager/Controller.php | 37 + .../LanguagesManager/LanguagesManager.php | 213 + .../javascripts/languageSelector.js | 72 + .../templates/getLanguagesSelector.twig | 17 + www/analytics/plugins/LeftMenu/plugin.json | 5 + .../plugins/LeftMenu/stylesheets/theme.less | 139 + www/analytics/plugins/Live/API.php | 699 + www/analytics/plugins/Live/Controller.php | 253 + www/analytics/plugins/Live/Live.php | 77 + www/analytics/plugins/Live/Visitor.php | 992 + www/analytics/plugins/Live/VisitorLog.php | 107 + .../plugins/Live/images/avatar_frame.png | Bin 0 -> 5375 bytes www/analytics/plugins/Live/images/file0.png | Bin 0 -> 593 bytes www/analytics/plugins/Live/images/file1.png | Bin 0 -> 637 bytes www/analytics/plugins/Live/images/file2.png | Bin 0 -> 642 bytes www/analytics/plugins/Live/images/file3.png | Bin 0 -> 674 bytes www/analytics/plugins/Live/images/file4.png | Bin 0 -> 611 bytes www/analytics/plugins/Live/images/file5.png | Bin 0 -> 668 bytes www/analytics/plugins/Live/images/file6.png | Bin 0 -> 659 bytes www/analytics/plugins/Live/images/file7.png | Bin 0 -> 681 bytes www/analytics/plugins/Live/images/file8.png | Bin 0 -> 642 bytes www/analytics/plugins/Live/images/file9.png | Bin 0 -> 569 bytes .../plugins/Live/images/paperclip.png | Bin 0 -> 10924 bytes www/analytics/plugins/Live/images/pause.gif | Bin 0 -> 669 bytes .../plugins/Live/images/pause_disabled.gif | Bin 0 -> 619 bytes www/analytics/plugins/Live/images/play.gif | Bin 0 -> 666 bytes .../plugins/Live/images/play_disabled.gif | Bin 0 -> 407 bytes .../plugins/Live/images/returningVisitor.gif | Bin 0 -> 995 bytes .../plugins/Live/images/unknown_avatar.jpg | Bin 0 -> 13984 bytes .../Live/images/visitorProfileLaunch.png | Bin 0 -> 661 bytes .../images/visitor_profile_background.jpg | Bin 0 -> 11060 bytes .../Live/images/visitor_profile_close.png | Bin 0 -> 4734 bytes .../Live/images/visitor_profile_gradient.png | Bin 0 -> 2840 bytes .../plugins/Live/javascripts/live.js | 288 + .../plugins/Live/javascripts/visitorLog.js | 89 + .../Live/javascripts/visitorProfile.js | 287 + .../plugins/Live/stylesheets/live.less | 220 + .../Live/stylesheets/visitor_profile.less | 547 + .../plugins/Live/templates/_actionsList.twig | 121 + .../templates/_dataTableViz_visitorLog.twig | 202 + .../Live/templates/_totalVisitors.twig | 29 + .../Live/templates/ajaxTotalVisitors.twig | 1 + .../Live/templates/getLastVisitsStart.twig | 144 + .../templates/getSimpleLastVisitCount.twig | 21 + .../Live/templates/getSingleVisitSummary.twig | 62 + .../plugins/Live/templates/getVisitList.twig | 17 + .../templates/getVisitorProfilePopup.twig | 149 + .../plugins/Live/templates/index.twig | 49 + .../Live/templates/indexVisitorLog.twig | 3 + www/analytics/plugins/Login/Auth.php | 137 + www/analytics/plugins/Login/Controller.php | 462 + www/analytics/plugins/Login/FormLogin.php | 44 + .../plugins/Login/FormResetPassword.php | 40 + www/analytics/plugins/Login/Login.php | 154 + .../plugins/Login/javascripts/login.js | 100 + .../plugins/Login/stylesheets/login.css | 197 + .../plugins/Login/templates/login.twig | 160 + .../Login/templates/resetPassword.twig | 12 + www/analytics/plugins/MobileMessaging/API.php | 432 + .../plugins/MobileMessaging/APIException.php | 19 + .../plugins/MobileMessaging/Controller.php | 78 + .../MobileMessaging/CountryCallingCodes.php | 270 + .../plugins/MobileMessaging/GSMCharset.php | 158 + .../MobileMessaging/MobileMessaging.php | 257 + .../ReportRendererException.php | 71 + .../MobileMessaging/ReportRenderer/Sms.php | 131 + .../plugins/MobileMessaging/SMSProvider.php | 174 + .../MobileMessaging/SMSProvider/Clockwork.php | 108 + .../SMSProvider/StubbedProvider.php | 34 + .../MobileMessaging/images/Clockwork.png | Bin 0 -> 3585 bytes .../plugins/MobileMessaging/images/phone.png | Bin 0 -> 568 bytes .../javascripts/MobileMessagingSettings.js | 266 + .../stylesheets/MobileMessagingSettings.less | 13 + .../MobileMessaging/templates/SMSReport.twig | 48 + .../MobileMessaging/templates/index.twig | 200 + .../reportParametersScheduledReports.twig | 61 + www/analytics/plugins/Morpheus/images/add.png | Bin 0 -> 1261 bytes .../plugins/Morpheus/images/annotations.png | Bin 0 -> 1069 bytes .../Morpheus/images/annotations_starred.png | Bin 0 -> 248 bytes .../plugins/Morpheus/images/bullet.png | Bin 0 -> 963 bytes .../plugins/Morpheus/images/calendar.gif | Bin 0 -> 1260 bytes .../plugins/Morpheus/images/chart_bar.png | Bin 0 -> 968 bytes .../Morpheus/images/chart_line_edit.png | Bin 0 -> 421 bytes .../plugins/Morpheus/images/chart_pie.png | Bin 0 -> 1223 bytes .../plugins/Morpheus/images/cities.png | Bin 0 -> 1038 bytes .../plugins/Morpheus/images/close.png | Bin 0 -> 1122 bytes .../Morpheus/images/configure-highlight.png | Bin 0 -> 356 bytes .../plugins/Morpheus/images/configure.png | Bin 0 -> 1210 bytes .../Morpheus/images/datepicker_arr_l.png | Bin 0 -> 963 bytes .../Morpheus/images/datepicker_arr_r.png | Bin 0 -> 968 bytes .../plugins/Morpheus/images/export.png | Bin 0 -> 1182 bytes .../plugins/Morpheus/images/forms-sprite.png | Bin 0 -> 1758 bytes .../plugins/Morpheus/images/goal.png | Bin 0 -> 1042 bytes .../plugins/Morpheus/images/help.png | Bin 0 -> 1297 bytes .../plugins/Morpheus/images/ico_delete.png | Bin 0 -> 1306 bytes .../plugins/Morpheus/images/ico_edit.png | Bin 0 -> 1202 bytes .../plugins/Morpheus/images/icon-calendar.gif | Bin 0 -> 1260 bytes .../plugins/Morpheus/images/image.png | Bin 0 -> 1139 bytes .../plugins/Morpheus/images/info.png | Bin 0 -> 1278 bytes .../plugins/Morpheus/images/link.gif | Bin 0 -> 1147 bytes .../plugins/Morpheus/images/loading-blue.gif | Bin 0 -> 723 bytes .../plugins/Morpheus/images/logo-header.png | Bin 0 -> 2215 bytes .../plugins/Morpheus/images/logo.png | Bin 0 -> 3902 bytes .../plugins/Morpheus/images/logo.svg | 25 + .../plugins/Morpheus/images/maximise.png | Bin 0 -> 1053 bytes .../plugins/Morpheus/images/minimise.png | Bin 0 -> 968 bytes .../plugins/Morpheus/images/pause.gif | Bin 0 -> 1142 bytes .../Morpheus/images/pause_disabled.gif | Bin 0 -> 1141 bytes .../plugins/Morpheus/images/play.gif | Bin 0 -> 1184 bytes .../plugins/Morpheus/images/play_disabled.gif | Bin 0 -> 1155 bytes .../plugins/Morpheus/images/refresh.png | Bin 0 -> 1312 bytes .../plugins/Morpheus/images/regions.png | Bin 0 -> 1265 bytes .../plugins/Morpheus/images/search_ico.png | Bin 0 -> 1227 bytes .../plugins/Morpheus/images/segment-users.png | Bin 0 -> 1270 bytes .../Morpheus/images/sort_subtable_desc.png | Bin 0 -> 980 bytes .../plugins/Morpheus/images/sortasc.png | Bin 0 -> 964 bytes .../plugins/Morpheus/images/sortasc_dark.png | Bin 0 -> 92 bytes .../plugins/Morpheus/images/sortdesc.png | Bin 0 -> 980 bytes .../plugins/Morpheus/images/sortdesc_dark.png | Bin 0 -> 98 bytes .../plugins/Morpheus/images/table.png | Bin 0 -> 1056 bytes .../plugins/Morpheus/images/table_more.png | Bin 0 -> 1157 bytes .../plugins/Morpheus/images/tagcloud.png | Bin 0 -> 1098 bytes .../Morpheus/images/zoom-out-disabled.png | Bin 0 -> 1297 bytes .../plugins/Morpheus/images/zoom-out.png | Bin 0 -> 1300 bytes .../Morpheus/javascripts/jquery.icheck.min.js | 8 + .../plugins/Morpheus/javascripts/morpheus.js | 25 + www/analytics/plugins/Morpheus/plugin.json | 7 + .../plugins/Morpheus/stylesheets/admin.less | 118 + .../plugins/Morpheus/stylesheets/charts.less | 158 + .../plugins/Morpheus/stylesheets/colors.less | 58 + .../Morpheus/stylesheets/components.less | 362 + .../plugins/Morpheus/stylesheets/forms.less | 300 + .../plugins/Morpheus/stylesheets/map.less | 71 + .../plugins/Morpheus/stylesheets/mixins.less | 80 + .../plugins/Morpheus/stylesheets/popups.less | 46 + .../plugins/Morpheus/stylesheets/theme.less | 910 + .../plugins/Morpheus/stylesheets/tooltip.less | 30 + .../Morpheus/stylesheets/typography.less | 124 + www/analytics/plugins/MultiSites/API.php | 496 + .../plugins/MultiSites/Controller.php | 87 + .../plugins/MultiSites/MultiSites.php | 116 + .../dashboard/dashboard-controller.js | 34 + .../dashboard/dashboard-directive.js | 40 + .../angularjs/dashboard/dashboard-filter.js | 63 + .../angularjs/dashboard/dashboard-model.js | 273 + .../angularjs/dashboard/dashboard.html | 128 + .../angularjs/dashboard/dashboard.less | 185 + .../angularjs/site/site-directive.js | 55 + .../MultiSites/angularjs/site/site.html | 39 + .../plugins/MultiSites/images/arrow_asc.gif | Bin 0 -> 120 bytes .../plugins/MultiSites/images/arrow_desc.gif | Bin 0 -> 130 bytes .../plugins/MultiSites/images/arrow_down.png | Bin 0 -> 234 bytes .../MultiSites/images/arrow_down_green.png | Bin 0 -> 221 bytes .../plugins/MultiSites/images/arrow_up.png | Bin 0 -> 222 bytes .../MultiSites/images/arrow_up_red.png | Bin 0 -> 248 bytes .../plugins/MultiSites/images/door_in.png | Bin 0 -> 693 bytes .../plugins/MultiSites/images/link.gif | Bin 0 -> 75 bytes .../MultiSites/images/loading-blue.gif | Bin 0 -> 1849 bytes .../plugins/MultiSites/images/stop.png | Bin 0 -> 307 bytes .../MultiSites/templates/getSitesInfo.twig | 23 + www/analytics/plugins/Overlay/API.php | 136 + www/analytics/plugins/Overlay/Controller.php | 236 + www/analytics/plugins/Overlay/Overlay.php | 49 + .../plugins/Overlay/client/client.css | 138 + .../plugins/Overlay/client/client.js | 261 + .../plugins/Overlay/client/close.png | Bin 0 -> 655 bytes .../plugins/Overlay/client/followingpages.js | 544 + .../plugins/Overlay/client/linktags.eps | 5251 +++ .../plugins/Overlay/client/linktags.png | Bin 0 -> 6489 bytes .../plugins/Overlay/client/linktags.psd | Bin 0 -> 38518 bytes .../Overlay/client/linktags_lessshadow.png | Bin 0 -> 6353 bytes .../Overlay/client/linktags_noshadow.png | Bin 0 -> 5355 bytes .../plugins/Overlay/client/loading.gif | Bin 0 -> 723 bytes .../plugins/Overlay/client/translations.js | 30 + .../plugins/Overlay/client/urlnormalizer.js | 198 + www/analytics/plugins/Overlay/images/info.png | Bin 0 -> 778 bytes .../plugins/Overlay/images/overlay_icon.png | Bin 0 -> 359 bytes .../Overlay/images/overlay_icon_hover.png | Bin 0 -> 360 bytes .../Overlay/javascripts/Overlay_Helper.js | 31 + .../Overlay/javascripts/Piwik_Overlay.js | 252 + .../plugins/Overlay/javascripts/rowaction.js | 65 + .../plugins/Overlay/stylesheets/overlay.css | 159 + .../stylesheets/showErrorWrongDomain.css | 17 + .../plugins/Overlay/templates/index.twig | 74 + .../Overlay/templates/index_noframe.twig | 21 + .../Overlay/templates/notifyParentIframe.twig | 14 + .../Overlay/templates/renderSidebar.twig | 22 + .../templates/showErrorWrongDomain.twig | 15 + .../plugins/PrivacyManager/Config.php | 108 + .../plugins/PrivacyManager/Controller.php | 312 + .../DoNotTrackHeaderChecker.php | 87 + .../plugins/PrivacyManager/IPAnonymizer.php | 96 + .../plugins/PrivacyManager/LogDataPurger.php | 334 + .../plugins/PrivacyManager/PrivacyManager.php | 469 + .../plugins/PrivacyManager/ReportsPurger.php | 380 + .../javascripts/privacySettings.js | 206 + .../templates/getDatabaseSize.twig | 7 + .../templates/privacySettings.twig | 315 + www/analytics/plugins/Provider/API.php | 40 + www/analytics/plugins/Provider/Archiver.php | 29 + www/analytics/plugins/Provider/Controller.php | 27 + www/analytics/plugins/Provider/Provider.php | 236 + www/analytics/plugins/Provider/functions.php | 80 + www/analytics/plugins/Proxy/Controller.php | 130 + www/analytics/plugins/Proxy/Proxy.php | 35 + www/analytics/plugins/Referrers/API.php | 530 + www/analytics/plugins/Referrers/Archiver.php | 269 + .../plugins/Referrers/Controller.php | 533 + www/analytics/plugins/Referrers/Referrers.php | 546 + www/analytics/plugins/Referrers/functions.php | 283 + .../Referrers/images/searchEngines/1.cz.png | Bin 0 -> 736 bytes .../images/searchEngines/abcsok.no.png | Bin 0 -> 734 bytes .../images/searchEngines/alexa.com.png | Bin 0 -> 878 bytes .../Referrers/images/searchEngines/all.by.png | Bin 0 -> 736 bytes .../images/searchEngines/apollo.lv.png | Bin 0 -> 664 bytes .../images/searchEngines/apollo7.de.png | Bin 0 -> 477 bytes .../images/searchEngines/arama.com.png | Bin 0 -> 736 bytes .../searchEngines/ariadna.elmundo.es.png | Bin 0 -> 272 bytes .../searchEngines/arianna.libero.it.png | Bin 0 -> 763 bytes .../images/searchEngines/ask.com.png | Bin 0 -> 587 bytes .../images/searchEngines/bg.setooz.com.png | Bin 0 -> 493 bytes .../images/searchEngines/bing.com.png | Bin 0 -> 590 bytes .../images/searchEngines/blekko.com.png | Bin 0 -> 174 bytes .../searchEngines/blogs.icerocket.com.png | Bin 0 -> 461 bytes .../searchEngines/blogsearch.google.com.png | Bin 0 -> 545 bytes .../images/searchEngines/busca.orange.es.png | Bin 0 -> 430 bytes .../images/searchEngines/busca.uol.com.br.png | Bin 0 -> 701 bytes .../searchEngines/buscador.terra.es.png | Bin 0 -> 869 bytes .../cgi.search.biglobe.ne.jp.png | Bin 0 -> 716 bytes .../images/searchEngines/claro-search.com.png | Bin 0 -> 564 bytes .../searchEngines/daemon-search.com.png | Bin 0 -> 718 bytes .../images/searchEngines/digg.com.png | Bin 0 -> 465 bytes .../searchEngines/dir.gigablast.com.png | Bin 0 -> 846 bytes .../images/searchEngines/dmoz.org.png | Bin 0 -> 732 bytes .../images/searchEngines/duckduckgo.com.png | Bin 0 -> 900 bytes .../images/searchEngines/ecosia.org.png | Bin 0 -> 667 bytes .../searchEngines/encrypted.google.com.png | Bin 0 -> 545 bytes .../Referrers/images/searchEngines/eo.st.png | Bin 0 -> 445 bytes .../images/searchEngines/forestle.org.png | Bin 0 -> 814 bytes .../images/searchEngines/fr.dir.com.png | Bin 0 -> 735 bytes .../images/searchEngines/fr.wedoo.com.png | Bin 0 -> 490 bytes .../images/searchEngines/friendfeed.com.png | Bin 0 -> 524 bytes .../searchEngines/gais.cs.ccu.edu.tw.png | Bin 0 -> 736 bytes .../images/searchEngines/geona.net.png | Bin 0 -> 3072 bytes .../images/searchEngines/go.mail.ru.png | Bin 0 -> 409 bytes .../images/searchEngines/google.com.png | Bin 0 -> 545 bytes .../googlesyndicatedsearch.com.png | Bin 0 -> 545 bytes .../images/searchEngines/holmes.ge.png | Bin 0 -> 774 bytes .../searchEngines/images.google.com.png | Bin 0 -> 545 bytes .../searchEngines/images.search.yahoo.com.png | Bin 0 -> 538 bytes .../images/searchEngines/images.yandex.ru.png | Bin 0 -> 497 bytes .../images/searchEngines/infospace.com.png | Bin 0 -> 940 bytes .../images/searchEngines/iwon.ask.com.png | Bin 0 -> 587 bytes .../images/searchEngines/ixquick.com.png | Bin 0 -> 613 bytes .../images/searchEngines/junglekey.com.png | Bin 0 -> 580 bytes .../images/searchEngines/jyxo.1188.cz.png | Bin 0 -> 401 bytes .../searchEngines/ko.search.need2find.com.png | Bin 0 -> 736 bytes .../Referrers/images/searchEngines/lo.st.png | Bin 0 -> 828 bytes .../images/searchEngines/maps.google.com.png | Bin 0 -> 1132 bytes .../meta.rrzn.uni-hannover.de.png | Bin 0 -> 281 bytes .../images/searchEngines/meta.ua.png | Bin 0 -> 873 bytes .../images/searchEngines/metager2.de.png | Bin 0 -> 556 bytes .../images/searchEngines/news.google.com.png | Bin 0 -> 545 bytes .../images/searchEngines/nigma.ru.png | Bin 0 -> 673 bytes .../images/searchEngines/nova.rambler.ru.png | Bin 0 -> 765 bytes .../images/searchEngines/online.no.png | Bin 0 -> 591 bytes .../images/searchEngines/otsing.delfi.ee.png | Bin 0 -> 543 bytes .../images/searchEngines/p.zhongsou.com.png | Bin 0 -> 869 bytes .../images/searchEngines/pesquisa.clix.pt.png | Bin 0 -> 838 bytes .../images/searchEngines/pesquisa.sapo.pt.png | Bin 0 -> 718 bytes .../images/searchEngines/plusnetwork.com.png | Bin 0 -> 719 bytes .../images/searchEngines/poisk.ru.png | Bin 0 -> 275 bytes .../searchEngines/recherche.francite.com.png | Bin 0 -> 706 bytes .../searchEngines/rechercher.aliceadsl.fr.png | Bin 0 -> 755 bytes .../searchEngines/req.hit-parade.com.png | Bin 0 -> 275 bytes .../searchEngines/ricerca.virgilio.it.png | Bin 0 -> 333 bytes .../images/searchEngines/rpmfind.net.png | Bin 0 -> 867 bytes .../searchEngines/s1.metacrawler.de.png | Bin 0 -> 368 bytes .../searchEngines/scholar.google.com.png | Bin 0 -> 545 bytes .../images/searchEngines/scour.com.png | Bin 0 -> 706 bytes .../images/searchEngines/search.aol.com.png | Bin 0 -> 713 bytes .../searchEngines/search.babylon.com.png | Bin 0 -> 930 bytes .../searchEngines/search.bluewin.ch.png | Bin 0 -> 349 bytes .../searchEngines/search.centrum.cz.png | Bin 0 -> 599 bytes .../searchEngines/search.comcast.net.png | Bin 0 -> 839 bytes .../searchEngines/search.conduit.com.png | Bin 0 -> 617 bytes .../images/searchEngines/search.daum.net.png | Bin 0 -> 800 bytes .../searchEngines/search.earthlink.net.png | Bin 0 -> 564 bytes .../images/searchEngines/search.excite.it.png | Bin 0 -> 323 bytes .../images/searchEngines/search.free.fr.png | Bin 0 -> 881 bytes .../searchEngines/search.freecause.com.png | Bin 0 -> 951 bytes .../images/searchEngines/search.goo.ne.jp.png | Bin 0 -> 730 bytes .../images/searchEngines/search.imesh.com.png | Bin 0 -> 644 bytes .../searchEngines/search.ke.voila.fr.png | Bin 0 -> 331 bytes .../images/searchEngines/search.lycos.com.png | Bin 0 -> 367 bytes .../images/searchEngines/search.nate.com.png | Bin 0 -> 670 bytes .../images/searchEngines/search.naver.com.png | Bin 0 -> 317 bytes .../images/searchEngines/search.nifty.com.png | Bin 0 -> 565 bytes .../searchEngines/search.peoplepc.com.png | Bin 0 -> 832 bytes .../images/searchEngines/search.qip.ru.png | Bin 0 -> 556 bytes .../images/searchEngines/search.rr.com.png | Bin 0 -> 794 bytes .../images/searchEngines/search.seznam.cz.png | Bin 0 -> 553 bytes .../search.smartaddressbar.com.png | Bin 0 -> 624 bytes .../images/searchEngines/search.snap.do.png | Bin 0 -> 570 bytes .../searchEngines/search.softonic.com.png | Bin 0 -> 716 bytes .../searchEngines/search.tiscali.it.png | Bin 0 -> 548 bytes .../searchEngines/search.winamp.com.png | Bin 0 -> 753 bytes .../images/searchEngines/search.www.ee.png | Bin 0 -> 625 bytes .../images/searchEngines/search.yahoo.com.png | Bin 0 -> 522 bytes .../images/searchEngines/search.yam.com.png | Bin 0 -> 186 bytes .../images/searchEngines/search.yippy.com.png | Bin 0 -> 654 bytes .../images/searchEngines/searchalot.com.png | Bin 0 -> 369 bytes .../searchEngines/searchatlas.centrum.cz.png | Bin 0 -> 716 bytes .../searchservice.myspace.com.png | Bin 0 -> 610 bytes .../images/searchEngines/sm.aport.ru.png | Bin 0 -> 469 bytes .../images/searchEngines/smart.delfi.lv.png | Bin 0 -> 543 bytes .../images/searchEngines/so.360.cn.png | Bin 0 -> 480 bytes .../images/searchEngines/start.iplay.com.png | Bin 0 -> 293 bytes .../startgoogle.startpagina.nl.png | Bin 0 -> 801 bytes .../images/searchEngines/suche.freenet.de.png | Bin 0 -> 719 bytes .../images/searchEngines/suche.info.png | Bin 0 -> 888 bytes .../searchEngines/suche.t-online.de.png | Bin 0 -> 470 bytes .../images/searchEngines/suche.web.de.png | Bin 0 -> 350 bytes .../images/searchEngines/surfcanyon.com.png | Bin 0 -> 686 bytes .../images/searchEngines/szukaj.onet.pl.png | Bin 0 -> 796 bytes .../images/searchEngines/szukaj.wp.pl.png | Bin 0 -> 672 bytes .../images/searchEngines/technorati.com.png | Bin 0 -> 567 bytes .../searchEngines/translate.google.com.png | Bin 0 -> 545 bytes .../images/searchEngines/video.google.com.png | Bin 0 -> 545 bytes .../images/searchEngines/web.canoe.ca.png | Bin 0 -> 721 bytes .../images/searchEngines/web.volny.cz.png | Bin 0 -> 619 bytes .../images/searchEngines/websearch.cs.com.png | Bin 0 -> 806 bytes .../searchEngines/websearch.rakuten.co.jp.png | Bin 0 -> 513 bytes .../searchEngines/www.123people.com.png | Bin 0 -> 724 bytes .../images/searchEngines/www.1881.no.png | Bin 0 -> 528 bytes .../images/searchEngines/www.abacho.de.png | Bin 0 -> 545 bytes .../images/searchEngines/www.acoon.de.png | Bin 0 -> 736 bytes .../images/searchEngines/www.allesklar.de.png | Bin 0 -> 328 bytes .../searchEngines/www.alltheweb.com.png | Bin 0 -> 458 bytes .../searchEngines/www.altavista.com.png | Bin 0 -> 627 bytes .../images/searchEngines/www.arcor.de.png | Bin 0 -> 924 bytes .../images/searchEngines/www.baidu.com.png | Bin 0 -> 725 bytes .../searchEngines/www.blogdigger.com.png | Bin 0 -> 863 bytes .../searchEngines/www.blogpulse.com.png | Bin 0 -> 725 bytes .../images/searchEngines/www.charter.net.png | Bin 0 -> 861 bytes .../images/searchEngines/www.crawler.com.png | Bin 0 -> 392 bytes .../images/searchEngines/www.cuil.com.png | Bin 0 -> 708 bytes .../searchEngines/www.dasoertliche.de.png | Bin 0 -> 767 bytes .../images/searchEngines/www.eniro.se.png | Bin 0 -> 758 bytes .../images/searchEngines/www.eurip.com.png | Bin 0 -> 736 bytes .../images/searchEngines/www.euroseek.com.png | Bin 0 -> 841 bytes .../searchEngines/www.everyclick.com.png | Bin 0 -> 843 bytes .../images/searchEngines/www.exalead.fr.png | Bin 0 -> 880 bytes .../images/searchEngines/www.facebook.com.png | Bin 0 -> 349 bytes .../www.fastbrowsersearch.com.png | Bin 0 -> 965 bytes .../images/searchEngines/www.fireball.de.png | Bin 0 -> 275 bytes .../searchEngines/www.firstsfind.com.png | Bin 0 -> 736 bytes .../images/searchEngines/www.fixsuche.de.png | Bin 0 -> 975 bytes .../images/searchEngines/www.flix.de.png | Bin 0 -> 518 bytes .../searchEngines/www.gigablast.com.png | Bin 0 -> 846 bytes .../searchEngines/www.gnadenmeer.de.png | Bin 0 -> 895 bytes .../images/searchEngines/www.gomeo.com.png | Bin 0 -> 432 bytes .../searchEngines/www.google.interia.pl.png | Bin 0 -> 690 bytes .../images/searchEngines/www.goyellow.de.png | Bin 0 -> 778 bytes .../images/searchEngines/www.gulesider.no.png | Bin 0 -> 575 bytes .../images/searchEngines/www.highbeam.com.png | Bin 0 -> 705 bytes .../images/searchEngines/www.hooseek.com.png | Bin 0 -> 548 bytes .../images/searchEngines/www.hotbot.com.png | Bin 0 -> 275 bytes .../images/searchEngines/www.icq.com.png | Bin 0 -> 692 bytes .../images/searchEngines/www.ilse.nl.png | Bin 0 -> 854 bytes .../searchEngines/www.jungle-spider.de.png | Bin 0 -> 867 bytes .../images/searchEngines/www.kataweb.it.png | Bin 0 -> 273 bytes .../images/searchEngines/www.kvasir.no.png | Bin 0 -> 395 bytes .../images/searchEngines/www.latne.lv.png | Bin 0 -> 756 bytes .../searchEngines/www.looksmart.com.png | Bin 0 -> 423 bytes .../images/searchEngines/www.maailm.com.png | Bin 0 -> 736 bytes .../images/searchEngines/www.mamma.com.png | Bin 0 -> 931 bytes .../searchEngines/www.meinestadt.de.png | Bin 0 -> 545 bytes .../searchEngines/www.mister-wong.com.png | Bin 0 -> 1065 bytes .../searchEngines/www.monstercrawler.com.png | Bin 0 -> 992 bytes .../images/searchEngines/www.mozbot.fr.png | Bin 0 -> 539 bytes .../images/searchEngines/www.mysearch.com.png | Bin 0 -> 754 bytes .../images/searchEngines/www.najdi.si.png | Bin 0 -> 746 bytes .../images/searchEngines/www.neti.ee.png | Bin 0 -> 874 bytes .../images/searchEngines/www.paperball.de.png | Bin 0 -> 275 bytes .../searchEngines/www.picsearch.com.png | Bin 0 -> 661 bytes .../images/searchEngines/www.plazoo.com.png | Bin 0 -> 471 bytes .../images/searchEngines/www.qualigo.at.png | Bin 0 -> 627 bytes .../images/searchEngines/www.search.ch.png | Bin 0 -> 344 bytes .../images/searchEngines/www.search.com.png | Bin 0 -> 517 bytes .../searchEngines/www.searchcanvas.com.png | Bin 0 -> 867 bytes .../searchEngines/www.searchy.co.uk.png | Bin 0 -> 656 bytes .../images/searchEngines/www.sharelook.fr.png | Bin 0 -> 433 bytes .../images/searchEngines/www.skynet.be.png | Bin 0 -> 855 bytes .../images/searchEngines/www.sogou.com.png | Bin 0 -> 636 bytes .../images/searchEngines/www.soso.com.png | Bin 0 -> 895 bytes .../searchEngines/www.startsiden.no.png | Bin 0 -> 285 bytes .../searchEngines/www.suchmaschine.com.png | Bin 0 -> 605 bytes .../images/searchEngines/www.suchnase.de.png | Bin 0 -> 289 bytes .../images/searchEngines/www.talimba.com.png | Bin 0 -> 735 bytes .../searchEngines/www.talktalk.co.uk.png | Bin 0 -> 457 bytes .../images/searchEngines/www.teoma.com.png | Bin 0 -> 564 bytes .../images/searchEngines/www.tixuma.de.png | Bin 0 -> 933 bytes .../images/searchEngines/www.toile.com.png | Bin 0 -> 868 bytes .../searchEngines/www.toolbarhome.com.png | Bin 0 -> 617 bytes .../images/searchEngines/www.trouvez.com.png | Bin 0 -> 498 bytes .../searchEngines/www.trovarapido.com.png | Bin 0 -> 540 bytes .../searchEngines/www.trusted-search.com.png | Bin 0 -> 736 bytes .../images/searchEngines/www.twingly.com.png | Bin 0 -> 459 bytes .../images/searchEngines/www.url.org.png | Bin 0 -> 584 bytes .../images/searchEngines/www.vinden.nl.png | Bin 0 -> 550 bytes .../images/searchEngines/www.vindex.nl.png | Bin 0 -> 627 bytes .../searchEngines/www.walhello.info.png | Bin 0 -> 811 bytes .../images/searchEngines/www.web.nl.png | Bin 0 -> 736 bytes .../images/searchEngines/www.weborama.fr.png | Bin 0 -> 978 bytes .../searchEngines/www.websearch.com.png | Bin 0 -> 830 bytes .../images/searchEngines/www.witch.de.png | Bin 0 -> 384 bytes .../searchEngines/www.x-recherche.com.png | Bin 0 -> 546 bytes .../images/searchEngines/www.yasni.de.png | Bin 0 -> 747 bytes .../images/searchEngines/www.yatedo.com.png | Bin 0 -> 647 bytes .../images/searchEngines/www.yougoo.fr.png | Bin 0 -> 731 bytes .../images/searchEngines/www.zapmeta.com.png | Bin 0 -> 220 bytes .../images/searchEngines/www.zoeken.nl.png | Bin 0 -> 598 bytes .../images/searchEngines/www.zoznam.sk.png | Bin 0 -> 349 bytes .../searchEngines/www1.dastelefonbuch.de.png | Bin 0 -> 556 bytes .../searchEngines/www2.austronaut.at.png | Bin 0 -> 498 bytes .../images/searchEngines/www2.inbox.com.png | Bin 0 -> 569 bytes .../images/searchEngines/www3.zoek.nl.png | Bin 0 -> 1038 bytes .../Referrers/images/searchEngines/xx.gif | Bin 0 -> 55 bytes .../Referrers/images/searchEngines/xx.png | Bin 0 -> 265 bytes .../images/searchEngines/yandex.ru.png | Bin 0 -> 497 bytes .../images/searchEngines/yellowmap.de.png | Bin 0 -> 750 bytes .../images/searchEngines/zoohoo.cz.png | Bin 0 -> 305 bytes .../Referrers/images/socials/badoo.com.png | Bin 0 -> 1080 bytes .../Referrers/images/socials/bebo.com.png | Bin 0 -> 978 bytes .../images/socials/blackplanet.com.png | Bin 0 -> 432 bytes .../Referrers/images/socials/buzznet.com.png | Bin 0 -> 462 bytes .../images/socials/classmates.com.png | Bin 0 -> 861 bytes .../Referrers/images/socials/douban.com.png | Bin 0 -> 530 bytes .../Referrers/images/socials/facebook.com.png | Bin 0 -> 300 bytes .../Referrers/images/socials/flickr.com.png | Bin 0 -> 1120 bytes .../Referrers/images/socials/flixster.com.png | Bin 0 -> 908 bytes .../Referrers/images/socials/fotolog.com.png | Bin 0 -> 184 bytes .../images/socials/foursquare.com.png | Bin 0 -> 1026 bytes .../images/socials/friendsreunited.com.png | Bin 0 -> 1113 bytes .../images/socials/friendster.com.png | Bin 0 -> 589 bytes .../images/socials/gaiaonline.com.png | Bin 0 -> 1593 bytes .../Referrers/images/socials/geni.com.png | Bin 0 -> 947 bytes .../Referrers/images/socials/github.com.png | Bin 0 -> 399 bytes .../Referrers/images/socials/habbo.com.png | Bin 0 -> 1090 bytes .../Referrers/images/socials/hi5.com.png | Bin 0 -> 282 bytes .../Referrers/images/socials/hyves.nl.png | Bin 0 -> 1183 bytes .../Referrers/images/socials/identi.ca.png | Bin 0 -> 1166 bytes .../Referrers/images/socials/last.fm.png | Bin 0 -> 1265 bytes .../Referrers/images/socials/linkedin.com.png | Bin 0 -> 694 bytes .../images/socials/livejournal.ru.png | Bin 0 -> 984 bytes .../images/socials/login.live.com.png | Bin 0 -> 1581 bytes .../images/socials/login.tagged.com.png | Bin 0 -> 286 bytes .../Referrers/images/socials/meinvz.net.png | Bin 0 -> 554 bytes .../Referrers/images/socials/mixi.jp.png | Bin 0 -> 592 bytes .../Referrers/images/socials/moikrug.ru.png | Bin 0 -> 1206 bytes .../Referrers/images/socials/multiply.com.png | Bin 0 -> 586 bytes .../Referrers/images/socials/my.mail.ru.png | Bin 0 -> 750 bytes .../images/socials/myheritage.com.png | Bin 0 -> 1138 bytes .../Referrers/images/socials/mylife.ru.png | Bin 0 -> 465 bytes .../Referrers/images/socials/myspace.com.png | Bin 0 -> 280 bytes .../images/socials/myyearbook.com.png | Bin 0 -> 741 bytes .../Referrers/images/socials/netlog.com.png | Bin 0 -> 636 bytes .../images/socials/news.ycombinator.com.png | Bin 0 -> 1166 bytes .../Referrers/images/socials/nk.pl.png | Bin 0 -> 628 bytes .../images/socials/odnoklassniki.ru.png | Bin 0 -> 583 bytes .../Referrers/images/socials/orkut.com.png | Bin 0 -> 496 bytes .../images/socials/pinterest.com.png | Bin 0 -> 3369 bytes .../Referrers/images/socials/plaxo.com.png | Bin 0 -> 754 bytes .../Referrers/images/socials/qzone.qq.com.png | Bin 0 -> 604 bytes .../Referrers/images/socials/reddit.com.png | Bin 0 -> 1166 bytes .../Referrers/images/socials/renren.com.png | Bin 0 -> 784 bytes .../images/socials/ru.netlog.com.png | Bin 0 -> 1252 bytes .../Referrers/images/socials/skyrock.com.png | Bin 0 -> 527 bytes .../Referrers/images/socials/sonico.com.png | Bin 0 -> 1292 bytes .../images/socials/sourceforge.net.png | Bin 0 -> 1166 bytes .../images/socials/stackoverflow.com.png | Bin 0 -> 1166 bytes .../Referrers/images/socials/studivz.net.png | Bin 0 -> 1222 bytes .../images/socials/stumbleupon.com.png | Bin 0 -> 584 bytes .../Referrers/images/socials/tagged.com.png | Bin 0 -> 282 bytes .../Referrers/images/socials/taringa.net.png | Bin 0 -> 716 bytes .../Referrers/images/socials/tuenti.com.png | Bin 0 -> 902 bytes .../Referrers/images/socials/tumblr.com.png | Bin 0 -> 443 bytes .../Referrers/images/socials/twitter.com.png | Bin 0 -> 892 bytes .../images/socials/url.google.com.png | Bin 0 -> 1231 bytes .../Referrers/images/socials/viadeo.com.png | Bin 0 -> 710 bytes .../Referrers/images/socials/vimeo.com.png | Bin 0 -> 704 bytes .../Referrers/images/socials/vk.com.png | Bin 0 -> 370 bytes .../Referrers/images/socials/vkontakte.ru.png | Bin 0 -> 576 bytes .../images/socials/vkrugudruzei.ru.png | Bin 0 -> 788 bytes .../Referrers/images/socials/wayn.com.png | Bin 0 -> 648 bytes .../Referrers/images/socials/weeworld.com.png | Bin 0 -> 492 bytes .../Referrers/images/socials/weibo.com.png | Bin 0 -> 1179 bytes .../Referrers/images/socials/xanga.com.png | Bin 0 -> 265 bytes .../Referrers/images/socials/xing.com.png | Bin 0 -> 675 bytes .../plugins/Referrers/images/socials/xx.png | Bin 0 -> 265 bytes .../Referrers/images/socials/youtube.com.png | Bin 0 -> 695 bytes .../getSearchEnginesAndKeywords.twig | 9 + .../plugins/Referrers/templates/index.twig | 118 + .../Referrers/templates/indexWebsites.twig | 9 + www/analytics/plugins/SEO/API.php | 95 + www/analytics/plugins/SEO/Controller.php | 47 + www/analytics/plugins/SEO/MajesticClient.php | 97 + www/analytics/plugins/SEO/RankChecker.php | 377 + www/analytics/plugins/SEO/SEO.php | 45 + .../plugins/SEO/images/majesticseo.png | Bin 0 -> 674 bytes www/analytics/plugins/SEO/images/whois.png | Bin 0 -> 928 bytes www/analytics/plugins/SEO/javascripts/rank.js | 31 + .../plugins/SEO/templates/getRank.twig | 53 + .../plugins/ScheduledReports/API.php | 958 + .../plugins/ScheduledReports/Controller.php | 92 + .../ScheduledReports/ScheduledReports.php | 642 + .../ScheduledReports/config/tcpdf_config.php | 245 + .../ScheduledReports/javascripts/pdf.js | 202 + .../templates/_addReport.twig | 181 + .../templates/_listReports.twig | 103 + .../ScheduledReports/templates/index.twig | 62 + .../reportParametersScheduledReports.twig | 78 + www/analytics/plugins/SegmentEditor/API.php | 329 + .../plugins/SegmentEditor/Controller.php | 20 + www/analytics/plugins/SegmentEditor/Model.php | 89 + .../plugins/SegmentEditor/SegmentEditor.php | 104 + .../SegmentEditor/SegmentSelectorControl.php | 130 + .../SegmentEditor/images/ajax-loader.gif | Bin 0 -> 847 bytes .../images/bg-inverted-corners.png | Bin 0 -> 968 bytes .../images/bg-segment-search.png | Bin 0 -> 1068 bytes .../SegmentEditor/images/bg-select.png | Bin 0 -> 1035 bytes .../plugins/SegmentEditor/images/close.png | Bin 0 -> 288 bytes .../SegmentEditor/images/close_btn.png | Bin 0 -> 928 bytes .../images/dashboard_h_bg_hover.png | Bin 0 -> 378 bytes .../SegmentEditor/images/icon-users.png | Bin 0 -> 1728 bytes .../SegmentEditor/images/reset_search.png | Bin 0 -> 1021 bytes .../SegmentEditor/images/search_btn.png | Bin 0 -> 2825 bytes .../SegmentEditor/images/segment-close.png | Bin 0 -> 1302 bytes .../SegmentEditor/images/segment-move.png | Bin 0 -> 1447 bytes .../SegmentEditor/javascripts/Segmentation.js | 1216 + .../stylesheets/segmentation.less | 705 + .../templates/_segmentSelector.twig | 161 + www/analytics/plugins/SitesManager/API.php | 1555 + .../plugins/SitesManager/Controller.php | 158 + .../plugins/SitesManager/SitesManager.php | 216 + .../SitesManager/javascripts/SitesManager.js | 473 + .../stylesheets/SitesManager.less | 69 + .../templates/_displayJavascriptCode.twig | 18 + .../templates/displayJavascriptCode.twig | 6 + .../plugins/SitesManager/templates/index.twig | 426 + www/analytics/plugins/Transitions/API.php | 605 + .../plugins/Transitions/Controller.php | 89 + .../plugins/Transitions/Transitions.php | 43 + .../Transitions/images/transitions_icon.png | Bin 0 -> 643 bytes .../images/transitions_icon_hover.png | Bin 0 -> 647 bytes .../Transitions/javascripts/transitions.js | 1553 + .../stylesheets/_transitionColors.less | 98 + .../Transitions/stylesheets/transitions.less | 198 + .../Transitions/templates/renderPopover.twig | 56 + www/analytics/plugins/UserCountry/API.php | 211 + .../plugins/UserCountry/Archiver.php | 179 + .../plugins/UserCountry/Controller.php | 403 + .../plugins/UserCountry/GeoIPAutoUpdater.php | 682 + .../plugins/UserCountry/LocationProvider.php | 459 + .../UserCountry/LocationProvider/Default.php | 113 + .../UserCountry/LocationProvider/GeoIp.php | 274 + .../LocationProvider/GeoIp/Pecl.php | 330 + .../LocationProvider/GeoIp/Php.php | 357 + .../LocationProvider/GeoIp/ServerBased.php | 282 + .../plugins/UserCountry/UserCountry.php | 500 + .../plugins/UserCountry/functions.php | 169 + .../plugins/UserCountry/images/flags/a1.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/a2.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/ac.png | Bin 0 -> 545 bytes .../plugins/UserCountry/images/flags/ad.png | Bin 0 -> 454 bytes .../plugins/UserCountry/images/flags/ae.png | Bin 0 -> 277 bytes .../plugins/UserCountry/images/flags/af.png | Bin 0 -> 420 bytes .../plugins/UserCountry/images/flags/ag.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/ai.png | Bin 0 -> 516 bytes .../plugins/UserCountry/images/flags/al.png | Bin 0 -> 434 bytes .../plugins/UserCountry/images/flags/am.png | Bin 0 -> 332 bytes .../plugins/UserCountry/images/flags/an.png | Bin 0 -> 365 bytes .../plugins/UserCountry/images/flags/ao.png | Bin 0 -> 395 bytes .../plugins/UserCountry/images/flags/ap.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/aq.png | Bin 0 -> 376 bytes .../plugins/UserCountry/images/flags/ar.png | Bin 0 -> 367 bytes .../plugins/UserCountry/images/flags/as.png | Bin 0 -> 540 bytes .../plugins/UserCountry/images/flags/at.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/au.png | Bin 0 -> 580 bytes .../plugins/UserCountry/images/flags/aw.png | Bin 0 -> 393 bytes .../plugins/UserCountry/images/flags/ax.png | Bin 0 -> 480 bytes .../plugins/UserCountry/images/flags/az.png | Bin 0 -> 423 bytes .../plugins/UserCountry/images/flags/ba.png | Bin 0 -> 471 bytes .../plugins/UserCountry/images/flags/bb.png | Bin 0 -> 403 bytes .../plugins/UserCountry/images/flags/bd.png | Bin 0 -> 372 bytes .../plugins/UserCountry/images/flags/be.png | Bin 0 -> 294 bytes .../plugins/UserCountry/images/flags/bf.png | Bin 0 -> 341 bytes .../plugins/UserCountry/images/flags/bg.png | Bin 0 -> 320 bytes .../plugins/UserCountry/images/flags/bh.png | Bin 0 -> 345 bytes .../plugins/UserCountry/images/flags/bi.png | Bin 0 -> 566 bytes .../plugins/UserCountry/images/flags/bj.png | Bin 0 -> 311 bytes .../plugins/UserCountry/images/flags/bl.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/bm.png | Bin 0 -> 499 bytes .../plugins/UserCountry/images/flags/bn.png | Bin 0 -> 502 bytes .../plugins/UserCountry/images/flags/bo.png | Bin 0 -> 341 bytes .../plugins/UserCountry/images/flags/bq.png | Bin 0 -> 310 bytes .../plugins/UserCountry/images/flags/br.png | Bin 0 -> 486 bytes .../plugins/UserCountry/images/flags/bs.png | Bin 0 -> 391 bytes .../plugins/UserCountry/images/flags/bt.png | Bin 0 -> 471 bytes .../plugins/UserCountry/images/flags/bu.png | Bin 0 -> 336 bytes .../plugins/UserCountry/images/flags/bv.png | Bin 0 -> 397 bytes .../plugins/UserCountry/images/flags/bw.png | Bin 0 -> 327 bytes .../plugins/UserCountry/images/flags/by.png | Bin 0 -> 382 bytes .../plugins/UserCountry/images/flags/bz.png | Bin 0 -> 476 bytes .../plugins/UserCountry/images/flags/ca.png | Bin 0 -> 471 bytes .../plugins/UserCountry/images/flags/cat.png | Bin 0 -> 353 bytes .../plugins/UserCountry/images/flags/cc.png | Bin 0 -> 496 bytes .../plugins/UserCountry/images/flags/cd.png | Bin 0 -> 477 bytes .../plugins/UserCountry/images/flags/cf.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/cg.png | Bin 0 -> 380 bytes .../plugins/UserCountry/images/flags/ch.png | Bin 0 -> 239 bytes .../plugins/UserCountry/images/flags/ci.png | Bin 0 -> 306 bytes .../plugins/UserCountry/images/flags/ck.png | Bin 0 -> 495 bytes .../plugins/UserCountry/images/flags/cl.png | Bin 0 -> 324 bytes .../plugins/UserCountry/images/flags/cm.png | Bin 0 -> 347 bytes .../plugins/UserCountry/images/flags/cn.png | Bin 0 -> 349 bytes .../plugins/UserCountry/images/flags/co.png | Bin 0 -> 330 bytes .../plugins/UserCountry/images/flags/cp.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/cr.png | Bin 0 -> 349 bytes .../plugins/UserCountry/images/flags/cs.png | Bin 0 -> 321 bytes .../plugins/UserCountry/images/flags/cu.png | Bin 0 -> 445 bytes .../plugins/UserCountry/images/flags/cv.png | Bin 0 -> 441 bytes .../plugins/UserCountry/images/flags/cw.png | Bin 0 -> 308 bytes .../plugins/UserCountry/images/flags/cx.png | Bin 0 -> 498 bytes .../plugins/UserCountry/images/flags/cy.png | Bin 0 -> 337 bytes .../plugins/UserCountry/images/flags/cz.png | Bin 0 -> 367 bytes .../plugins/UserCountry/images/flags/de.png | Bin 0 -> 364 bytes .../plugins/UserCountry/images/flags/dg.png | Bin 0 -> 658 bytes .../plugins/UserCountry/images/flags/dj.png | Bin 0 -> 430 bytes .../plugins/UserCountry/images/flags/dk.png | Bin 0 -> 352 bytes .../plugins/UserCountry/images/flags/dm.png | Bin 0 -> 508 bytes .../plugins/UserCountry/images/flags/do.png | Bin 0 -> 368 bytes .../plugins/UserCountry/images/flags/dz.png | Bin 0 -> 454 bytes .../plugins/UserCountry/images/flags/ea.png | Bin 0 -> 344 bytes .../plugins/UserCountry/images/flags/ec.png | Bin 0 -> 355 bytes .../plugins/UserCountry/images/flags/ee.png | Bin 0 -> 297 bytes .../plugins/UserCountry/images/flags/eg.png | Bin 0 -> 348 bytes .../plugins/UserCountry/images/flags/eh.png | Bin 0 -> 388 bytes .../plugins/UserCountry/images/flags/er.png | Bin 0 -> 497 bytes .../plugins/UserCountry/images/flags/es.png | Bin 0 -> 344 bytes .../plugins/UserCountry/images/flags/et.png | Bin 0 -> 445 bytes .../plugins/UserCountry/images/flags/eu.png | Bin 0 -> 418 bytes .../plugins/UserCountry/images/flags/fi.png | Bin 0 -> 368 bytes .../plugins/UserCountry/images/flags/fj.png | Bin 0 -> 517 bytes .../plugins/UserCountry/images/flags/fk.png | Bin 0 -> 526 bytes .../plugins/UserCountry/images/flags/fm.png | Bin 0 -> 409 bytes .../plugins/UserCountry/images/flags/fo.png | Bin 0 -> 377 bytes .../plugins/UserCountry/images/flags/fr.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/fx.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/ga.png | Bin 0 -> 342 bytes .../plugins/UserCountry/images/flags/gb.png | Bin 0 -> 545 bytes .../plugins/UserCountry/images/flags/gd.png | Bin 0 -> 461 bytes .../plugins/UserCountry/images/flags/ge.png | Bin 0 -> 493 bytes .../plugins/UserCountry/images/flags/gf.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/gg.png | Bin 0 -> 524 bytes .../plugins/UserCountry/images/flags/gh.png | Bin 0 -> 336 bytes .../plugins/UserCountry/images/flags/gi.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/gl.png | Bin 0 -> 351 bytes .../plugins/UserCountry/images/flags/gm.png | Bin 0 -> 363 bytes .../plugins/UserCountry/images/flags/gn.png | Bin 0 -> 319 bytes .../plugins/UserCountry/images/flags/gp.png | Bin 0 -> 353 bytes .../plugins/UserCountry/images/flags/gq.png | Bin 0 -> 405 bytes .../plugins/UserCountry/images/flags/gr.png | Bin 0 -> 391 bytes .../plugins/UserCountry/images/flags/gs.png | Bin 0 -> 522 bytes .../plugins/UserCountry/images/flags/gt.png | Bin 0 -> 333 bytes .../plugins/UserCountry/images/flags/gu.png | Bin 0 -> 384 bytes .../plugins/UserCountry/images/flags/gw.png | Bin 0 -> 346 bytes .../plugins/UserCountry/images/flags/gy.png | Bin 0 -> 521 bytes .../plugins/UserCountry/images/flags/hk.png | Bin 0 -> 393 bytes .../plugins/UserCountry/images/flags/hm.png | Bin 0 -> 580 bytes .../plugins/UserCountry/images/flags/hn.png | Bin 0 -> 411 bytes .../plugins/UserCountry/images/flags/hr.png | Bin 0 -> 386 bytes .../plugins/UserCountry/images/flags/ht.png | Bin 0 -> 327 bytes .../plugins/UserCountry/images/flags/hu.png | Bin 0 -> 293 bytes .../plugins/UserCountry/images/flags/ic.png | Bin 0 -> 378 bytes .../plugins/UserCountry/images/flags/id.png | Bin 0 -> 301 bytes .../plugins/UserCountry/images/flags/ie.png | Bin 0 -> 333 bytes .../plugins/UserCountry/images/flags/il.png | Bin 0 -> 326 bytes .../plugins/UserCountry/images/flags/im.png | Bin 0 -> 320 bytes .../plugins/UserCountry/images/flags/in.png | Bin 0 -> 377 bytes .../plugins/UserCountry/images/flags/io.png | Bin 0 -> 575 bytes .../plugins/UserCountry/images/flags/iq.png | Bin 0 -> 403 bytes .../plugins/UserCountry/images/flags/ir.png | Bin 0 -> 398 bytes .../plugins/UserCountry/images/flags/is.png | Bin 0 -> 410 bytes .../plugins/UserCountry/images/flags/it.png | Bin 0 -> 283 bytes .../plugins/UserCountry/images/flags/je.png | Bin 0 -> 475 bytes .../plugins/UserCountry/images/flags/jm.png | Bin 0 -> 508 bytes .../plugins/UserCountry/images/flags/jo.png | Bin 0 -> 353 bytes .../plugins/UserCountry/images/flags/jp.png | Bin 0 -> 307 bytes .../plugins/UserCountry/images/flags/ke.png | Bin 0 -> 435 bytes .../plugins/UserCountry/images/flags/kg.png | Bin 0 -> 354 bytes .../plugins/UserCountry/images/flags/kh.png | Bin 0 -> 422 bytes .../plugins/UserCountry/images/flags/ki.png | Bin 0 -> 551 bytes .../plugins/UserCountry/images/flags/km.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/kn.png | Bin 0 -> 480 bytes .../plugins/UserCountry/images/flags/kp.png | Bin 0 -> 424 bytes .../plugins/UserCountry/images/flags/kr.png | Bin 0 -> 507 bytes .../plugins/UserCountry/images/flags/kw.png | Bin 0 -> 351 bytes .../plugins/UserCountry/images/flags/ky.png | Bin 0 -> 532 bytes .../plugins/UserCountry/images/flags/kz.png | Bin 0 -> 459 bytes .../plugins/UserCountry/images/flags/la.png | Bin 0 -> 415 bytes .../plugins/UserCountry/images/flags/lb.png | Bin 0 -> 393 bytes .../plugins/UserCountry/images/flags/lc.png | Bin 0 -> 462 bytes .../plugins/UserCountry/images/flags/li.png | Bin 0 -> 399 bytes .../plugins/UserCountry/images/flags/lk.png | Bin 0 -> 464 bytes .../plugins/UserCountry/images/flags/lr.png | Bin 0 -> 365 bytes .../plugins/UserCountry/images/flags/ls.png | Bin 0 -> 500 bytes .../plugins/UserCountry/images/flags/lt.png | Bin 0 -> 345 bytes .../plugins/UserCountry/images/flags/lu.png | Bin 0 -> 338 bytes .../plugins/UserCountry/images/flags/lv.png | Bin 0 -> 339 bytes .../plugins/UserCountry/images/flags/ly.png | Bin 0 -> 277 bytes .../plugins/UserCountry/images/flags/ma.png | Bin 0 -> 293 bytes .../plugins/UserCountry/images/flags/mc.png | Bin 0 -> 254 bytes .../plugins/UserCountry/images/flags/md.png | Bin 0 -> 404 bytes .../plugins/UserCountry/images/flags/me.png | Bin 0 -> 394 bytes .../plugins/UserCountry/images/flags/mf.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/mg.png | Bin 0 -> 313 bytes .../plugins/UserCountry/images/flags/mh.png | Bin 0 -> 518 bytes .../plugins/UserCountry/images/flags/mk.png | Bin 0 -> 449 bytes .../plugins/UserCountry/images/flags/ml.png | Bin 0 -> 322 bytes .../plugins/UserCountry/images/flags/mm.png | Bin 0 -> 336 bytes .../plugins/UserCountry/images/flags/mn.png | Bin 0 -> 343 bytes .../plugins/UserCountry/images/flags/mo.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/mp.png | Bin 0 -> 481 bytes .../plugins/UserCountry/images/flags/mq.png | Bin 0 -> 541 bytes .../plugins/UserCountry/images/flags/mr.png | Bin 0 -> 408 bytes .../plugins/UserCountry/images/flags/ms.png | Bin 0 -> 497 bytes .../plugins/UserCountry/images/flags/mt.png | Bin 0 -> 296 bytes .../plugins/UserCountry/images/flags/mu.png | Bin 0 -> 360 bytes .../plugins/UserCountry/images/flags/mv.png | Bin 0 -> 391 bytes .../plugins/UserCountry/images/flags/mw.png | Bin 0 -> 365 bytes .../plugins/UserCountry/images/flags/mx.png | Bin 0 -> 424 bytes .../plugins/UserCountry/images/flags/my.png | Bin 0 -> 464 bytes .../plugins/UserCountry/images/flags/mz.png | Bin 0 -> 439 bytes .../plugins/UserCountry/images/flags/na.png | Bin 0 -> 559 bytes .../plugins/UserCountry/images/flags/nc.png | Bin 0 -> 470 bytes .../plugins/UserCountry/images/flags/ne.png | Bin 0 -> 393 bytes .../plugins/UserCountry/images/flags/nf.png | Bin 0 -> 474 bytes .../plugins/UserCountry/images/flags/ng.png | Bin 0 -> 341 bytes .../plugins/UserCountry/images/flags/ni.png | Bin 0 -> 372 bytes .../plugins/UserCountry/images/flags/nl.png | Bin 0 -> 310 bytes .../plugins/UserCountry/images/flags/no.png | Bin 0 -> 397 bytes .../plugins/UserCountry/images/flags/np.png | Bin 0 -> 349 bytes .../plugins/UserCountry/images/flags/nr.png | Bin 0 -> 391 bytes .../plugins/UserCountry/images/flags/nt.png | Bin 0 -> 198 bytes .../plugins/UserCountry/images/flags/nu.png | Bin 0 -> 468 bytes .../plugins/UserCountry/images/flags/nz.png | Bin 0 -> 529 bytes .../plugins/UserCountry/images/flags/o1.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/om.png | Bin 0 -> 339 bytes .../plugins/UserCountry/images/flags/pa.png | Bin 0 -> 390 bytes .../plugins/UserCountry/images/flags/pe.png | Bin 0 -> 264 bytes .../plugins/UserCountry/images/flags/pf.png | Bin 0 -> 379 bytes .../plugins/UserCountry/images/flags/pg.png | Bin 0 -> 438 bytes .../plugins/UserCountry/images/flags/ph.png | Bin 0 -> 416 bytes .../plugins/UserCountry/images/flags/pk.png | Bin 0 -> 448 bytes .../plugins/UserCountry/images/flags/pl.png | Bin 0 -> 243 bytes .../plugins/UserCountry/images/flags/pm.png | Bin 0 -> 572 bytes .../plugins/UserCountry/images/flags/pn.png | Bin 0 -> 547 bytes .../plugins/UserCountry/images/flags/pr.png | Bin 0 -> 445 bytes .../plugins/UserCountry/images/flags/ps.png | Bin 0 -> 348 bytes .../plugins/UserCountry/images/flags/pt.png | Bin 0 -> 407 bytes .../plugins/UserCountry/images/flags/pw.png | Bin 0 -> 424 bytes .../plugins/UserCountry/images/flags/py.png | Bin 0 -> 344 bytes .../plugins/UserCountry/images/flags/qa.png | Bin 0 -> 343 bytes .../plugins/UserCountry/images/flags/re.png | Bin 0 -> 369 bytes .../plugins/UserCountry/images/flags/ro.png | Bin 0 -> 333 bytes .../plugins/UserCountry/images/flags/rs.png | Bin 0 -> 376 bytes .../plugins/UserCountry/images/flags/ru.png | Bin 0 -> 299 bytes .../plugins/UserCountry/images/flags/rw.png | Bin 0 -> 382 bytes .../plugins/UserCountry/images/flags/sa.png | Bin 0 -> 428 bytes .../plugins/UserCountry/images/flags/sb.png | Bin 0 -> 520 bytes .../plugins/UserCountry/images/flags/sc.png | Bin 0 -> 481 bytes .../plugins/UserCountry/images/flags/sd.png | Bin 0 -> 364 bytes .../plugins/UserCountry/images/flags/se.png | Bin 0 -> 389 bytes .../plugins/UserCountry/images/flags/sf.png | Bin 0 -> 368 bytes .../plugins/UserCountry/images/flags/sg.png | Bin 0 -> 350 bytes .../plugins/UserCountry/images/flags/sh.png | Bin 0 -> 524 bytes .../plugins/UserCountry/images/flags/si.png | Bin 0 -> 383 bytes .../plugins/UserCountry/images/flags/sj.png | Bin 0 -> 397 bytes .../plugins/UserCountry/images/flags/sk.png | Bin 0 -> 439 bytes .../plugins/UserCountry/images/flags/sl.png | Bin 0 -> 321 bytes .../plugins/UserCountry/images/flags/sm.png | Bin 0 -> 396 bytes .../plugins/UserCountry/images/flags/sn.png | Bin 0 -> 356 bytes .../plugins/UserCountry/images/flags/so.png | Bin 0 -> 376 bytes .../plugins/UserCountry/images/flags/sr.png | Bin 0 -> 370 bytes .../plugins/UserCountry/images/flags/ss.png | Bin 0 -> 422 bytes .../plugins/UserCountry/images/flags/st.png | Bin 0 -> 429 bytes .../plugins/UserCountry/images/flags/su.png | Bin 0 -> 273 bytes .../plugins/UserCountry/images/flags/sv.png | Bin 0 -> 373 bytes .../plugins/UserCountry/images/flags/sx.png | Bin 0 -> 416 bytes .../plugins/UserCountry/images/flags/sy.png | Bin 0 -> 322 bytes .../plugins/UserCountry/images/flags/sz.png | Bin 0 -> 508 bytes .../plugins/UserCountry/images/flags/ta.png | Bin 0 -> 512 bytes .../plugins/UserCountry/images/flags/tc.png | Bin 0 -> 509 bytes .../plugins/UserCountry/images/flags/td.png | Bin 0 -> 378 bytes .../plugins/UserCountry/images/flags/tf.png | Bin 0 -> 399 bytes .../plugins/UserCountry/images/flags/tg.png | Bin 0 -> 410 bytes .../plugins/UserCountry/images/flags/th.png | Bin 0 -> 327 bytes .../plugins/UserCountry/images/flags/ti.png | Bin 0 -> 811 bytes .../plugins/UserCountry/images/flags/tj.png | Bin 0 -> 367 bytes .../plugins/UserCountry/images/flags/tk.png | Bin 0 -> 522 bytes .../plugins/UserCountry/images/flags/tl.png | Bin 0 -> 395 bytes .../plugins/UserCountry/images/flags/tm.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/tn.png | Bin 0 -> 367 bytes .../plugins/UserCountry/images/flags/to.png | Bin 0 -> 302 bytes .../plugins/UserCountry/images/flags/tp.png | Bin 0 -> 395 bytes .../plugins/UserCountry/images/flags/tr.png | Bin 0 -> 366 bytes .../plugins/UserCountry/images/flags/tt.png | Bin 0 -> 486 bytes .../plugins/UserCountry/images/flags/tv.png | Bin 0 -> 443 bytes .../plugins/UserCountry/images/flags/tw.png | Bin 0 -> 330 bytes .../plugins/UserCountry/images/flags/tz.png | Bin 0 -> 514 bytes .../plugins/UserCountry/images/flags/ua.png | Bin 0 -> 304 bytes .../plugins/UserCountry/images/flags/ug.png | Bin 0 -> 388 bytes .../plugins/UserCountry/images/flags/uk.png | Bin 0 -> 545 bytes .../plugins/UserCountry/images/flags/um.png | Bin 0 -> 455 bytes .../plugins/UserCountry/images/flags/us.png | Bin 0 -> 492 bytes .../plugins/UserCountry/images/flags/uy.png | Bin 0 -> 411 bytes .../plugins/UserCountry/images/flags/uz.png | Bin 0 -> 411 bytes .../plugins/UserCountry/images/flags/va.png | Bin 0 -> 419 bytes .../plugins/UserCountry/images/flags/vc.png | Bin 0 -> 412 bytes .../plugins/UserCountry/images/flags/ve.png | Bin 0 -> 412 bytes .../plugins/UserCountry/images/flags/vg.png | Bin 0 -> 510 bytes .../plugins/UserCountry/images/flags/vi.png | Bin 0 -> 523 bytes .../plugins/UserCountry/images/flags/vn.png | Bin 0 -> 324 bytes .../plugins/UserCountry/images/flags/vu.png | Bin 0 -> 450 bytes .../plugins/UserCountry/images/flags/wf.png | Bin 0 -> 438 bytes .../plugins/UserCountry/images/flags/ws.png | Bin 0 -> 352 bytes .../plugins/UserCountry/images/flags/xx.png | Bin 0 -> 290 bytes .../plugins/UserCountry/images/flags/ye.png | Bin 0 -> 302 bytes .../plugins/UserCountry/images/flags/yt.png | Bin 0 -> 456 bytes .../plugins/UserCountry/images/flags/yu.png | Bin 0 -> 321 bytes .../plugins/UserCountry/images/flags/za.png | Bin 0 -> 523 bytes .../plugins/UserCountry/images/flags/zm.png | Bin 0 -> 359 bytes .../plugins/UserCountry/images/flags/zr.png | Bin 0 -> 380 bytes .../plugins/UserCountry/images/flags/zw.png | Bin 0 -> 462 bytes .../UserCountry/javascripts/userCountry.js | 211 + .../UserCountry/stylesheets/userCountry.less | 74 + .../UserCountry/templates/_updaterManage.twig | 71 + .../templates/_updaterNextRunTime.twig | 9 + .../UserCountry/templates/adminIndex.twig | 135 + .../getGeoIpUpdaterManageScreen.twig | 1 + .../plugins/UserCountry/templates/index.twig | 26 + .../plugins/UserCountryMap/Controller.php | 266 + .../plugins/UserCountryMap/UserCountryMap.php | 81 + .../plugins/UserCountryMap/images/cities.png | Bin 0 -> 267 bytes .../images/realtimemap-loading.gif | Bin 0 -> 308 bytes .../plugins/UserCountryMap/images/regions.png | Bin 0 -> 296 bytes .../images/zoom-out-disabled.png | Bin 0 -> 270 bytes .../javascripts/realtime-map.js | 640 + .../javascripts/vendor/chroma.min.js | 33 + .../javascripts/vendor/jquery.qtip.min.js | 14 + .../javascripts/vendor/kartograph.min.js | 21 + .../javascripts/vendor/raphael.min.js | 10 + .../UserCountryMap/javascripts/visitor-map.js | 1366 + .../UserCountryMap/stylesheets/map.css | 84 + .../stylesheets/realtime-map.less | 146 + .../stylesheets/visitor-map.less | 222 + .../plugins/UserCountryMap/svg/AF.svg | 2 + .../plugins/UserCountryMap/svg/AFG.svg | 2 + .../plugins/UserCountryMap/svg/AGO.svg | 2 + .../plugins/UserCountryMap/svg/ALB.svg | 2 + .../plugins/UserCountryMap/svg/ARE.svg | 2 + .../plugins/UserCountryMap/svg/ARG.svg | 2 + .../plugins/UserCountryMap/svg/ARM.svg | 2 + .../plugins/UserCountryMap/svg/AS.svg | 1 + .../plugins/UserCountryMap/svg/AUS.svg | 2 + .../plugins/UserCountryMap/svg/AUT.svg | 2 + .../plugins/UserCountryMap/svg/AZE.svg | 2 + .../plugins/UserCountryMap/svg/BDI.svg | 2 + .../plugins/UserCountryMap/svg/BEL.svg | 1 + .../plugins/UserCountryMap/svg/BEN.svg | 2 + .../plugins/UserCountryMap/svg/BFA.svg | 2 + .../plugins/UserCountryMap/svg/BGD.svg | 1 + .../plugins/UserCountryMap/svg/BGR.svg | 2 + .../plugins/UserCountryMap/svg/BIH.svg | 2 + .../plugins/UserCountryMap/svg/BLR.svg | 2 + .../plugins/UserCountryMap/svg/BLZ.svg | 2 + .../plugins/UserCountryMap/svg/BOL.svg | 2 + .../plugins/UserCountryMap/svg/BRA.svg | 2 + .../plugins/UserCountryMap/svg/BRB.svg | 2 + .../plugins/UserCountryMap/svg/BRN.svg | 2 + .../plugins/UserCountryMap/svg/BTN.svg | 2 + .../plugins/UserCountryMap/svg/BWA.svg | 2 + .../plugins/UserCountryMap/svg/CAF.svg | 2 + .../plugins/UserCountryMap/svg/CAN.svg | 2 + .../plugins/UserCountryMap/svg/CHE.svg | 2 + .../plugins/UserCountryMap/svg/CHL.svg | 2 + .../plugins/UserCountryMap/svg/CHN.svg | 1 + .../plugins/UserCountryMap/svg/CIV.svg | 2 + .../plugins/UserCountryMap/svg/CMR.svg | 2 + .../plugins/UserCountryMap/svg/COD.svg | 2 + .../plugins/UserCountryMap/svg/COG.svg | 2 + .../plugins/UserCountryMap/svg/COL.svg | 2 + .../plugins/UserCountryMap/svg/CRI.svg | 2 + .../plugins/UserCountryMap/svg/CUB.svg | 2 + .../plugins/UserCountryMap/svg/CYP.svg | 2 + .../plugins/UserCountryMap/svg/CZE.svg | 1 + .../plugins/UserCountryMap/svg/DEU.svg | 1 + .../plugins/UserCountryMap/svg/DJI.svg | 2 + .../plugins/UserCountryMap/svg/DMA.svg | 2 + .../plugins/UserCountryMap/svg/DNK.svg | 1 + .../plugins/UserCountryMap/svg/DOM.svg | 2 + .../plugins/UserCountryMap/svg/DZA.svg | 2 + .../plugins/UserCountryMap/svg/ECU.svg | 2 + .../plugins/UserCountryMap/svg/EGY.svg | 2 + .../plugins/UserCountryMap/svg/ERI.svg | 2 + .../plugins/UserCountryMap/svg/ESP.svg | 2 + .../plugins/UserCountryMap/svg/EST.svg | 2 + .../plugins/UserCountryMap/svg/ETH.svg | 2 + .../plugins/UserCountryMap/svg/EU.svg | 2 + .../plugins/UserCountryMap/svg/FIN.svg | 2 + .../plugins/UserCountryMap/svg/FJI.svg | 2 + .../plugins/UserCountryMap/svg/FRA.svg | 1 + .../plugins/UserCountryMap/svg/FRO.svg | 2 + .../plugins/UserCountryMap/svg/GAB.svg | 2 + .../plugins/UserCountryMap/svg/GBR.svg | 1 + .../plugins/UserCountryMap/svg/GEO.svg | 2 + .../plugins/UserCountryMap/svg/GHA.svg | 2 + .../plugins/UserCountryMap/svg/GIN.svg | 2 + .../plugins/UserCountryMap/svg/GMB.svg | 2 + .../plugins/UserCountryMap/svg/GNB.svg | 2 + .../plugins/UserCountryMap/svg/GNQ.svg | 2 + .../plugins/UserCountryMap/svg/GRC.svg | 2 + .../plugins/UserCountryMap/svg/GRL.svg | 2 + .../plugins/UserCountryMap/svg/GTM.svg | 2 + .../plugins/UserCountryMap/svg/GUY.svg | 2 + .../plugins/UserCountryMap/svg/HND.svg | 2 + .../plugins/UserCountryMap/svg/HRV.svg | 2 + .../plugins/UserCountryMap/svg/HTI.svg | 2 + .../plugins/UserCountryMap/svg/HUN.svg | 2 + .../plugins/UserCountryMap/svg/IDN.svg | 2 + .../plugins/UserCountryMap/svg/IND.svg | 1 + .../plugins/UserCountryMap/svg/IRL.svg | 2 + .../plugins/UserCountryMap/svg/IRN.svg | 2 + .../plugins/UserCountryMap/svg/IRQ.svg | 2 + .../plugins/UserCountryMap/svg/ISL.svg | 2 + .../plugins/UserCountryMap/svg/ISR.svg | 2 + .../plugins/UserCountryMap/svg/ITA.svg | 2 + .../plugins/UserCountryMap/svg/JAM.svg | 2 + .../plugins/UserCountryMap/svg/JOR.svg | 2 + .../plugins/UserCountryMap/svg/JPN.svg | 1 + .../plugins/UserCountryMap/svg/KAZ.svg | 2 + .../plugins/UserCountryMap/svg/KEN.svg | 2 + .../plugins/UserCountryMap/svg/KGZ.svg | 2 + .../plugins/UserCountryMap/svg/KHM.svg | 2 + .../plugins/UserCountryMap/svg/KOR.svg | 2 + .../plugins/UserCountryMap/svg/KWT.svg | 2 + .../plugins/UserCountryMap/svg/LAO.svg | 2 + .../plugins/UserCountryMap/svg/LBN.svg | 2 + .../plugins/UserCountryMap/svg/LBR.svg | 2 + .../plugins/UserCountryMap/svg/LBY.svg | 2 + .../plugins/UserCountryMap/svg/LKA.svg | 2 + .../plugins/UserCountryMap/svg/LSO.svg | 2 + .../plugins/UserCountryMap/svg/LTU.svg | 2 + .../plugins/UserCountryMap/svg/LUX.svg | 2 + .../plugins/UserCountryMap/svg/LVA.svg | 2 + .../plugins/UserCountryMap/svg/MAR.svg | 2 + .../plugins/UserCountryMap/svg/MDA.svg | 2 + .../plugins/UserCountryMap/svg/MDG.svg | 2 + .../plugins/UserCountryMap/svg/MEX.svg | 2 + .../plugins/UserCountryMap/svg/MKD.svg | 2 + .../plugins/UserCountryMap/svg/MLI.svg | 2 + .../plugins/UserCountryMap/svg/MMR.svg | 1 + .../plugins/UserCountryMap/svg/MNE.svg | 2 + .../plugins/UserCountryMap/svg/MNG.svg | 2 + .../plugins/UserCountryMap/svg/MOZ.svg | 2 + .../plugins/UserCountryMap/svg/MRT.svg | 2 + .../plugins/UserCountryMap/svg/MWI.svg | 2 + .../plugins/UserCountryMap/svg/MYS.svg | 2 + .../plugins/UserCountryMap/svg/NA.svg | 2 + .../plugins/UserCountryMap/svg/NAM.svg | 2 + .../plugins/UserCountryMap/svg/NCL.svg | 2 + .../plugins/UserCountryMap/svg/NER.svg | 2 + .../plugins/UserCountryMap/svg/NFK.svg | 2 + .../plugins/UserCountryMap/svg/NGA.svg | 2 + .../plugins/UserCountryMap/svg/NIC.svg | 2 + .../plugins/UserCountryMap/svg/NLD.svg | 2 + .../plugins/UserCountryMap/svg/NOR.svg | 2 + .../plugins/UserCountryMap/svg/NPL.svg | 1 + .../plugins/UserCountryMap/svg/NZL.svg | 1 + .../plugins/UserCountryMap/svg/OC.svg | 2 + .../plugins/UserCountryMap/svg/OMN.svg | 2 + .../plugins/UserCountryMap/svg/PAK.svg | 1 + .../plugins/UserCountryMap/svg/PAN.svg | 2 + .../plugins/UserCountryMap/svg/PER.svg | 2 + .../plugins/UserCountryMap/svg/PHL.svg | 2 + .../plugins/UserCountryMap/svg/PNG.svg | 2 + .../plugins/UserCountryMap/svg/POL.svg | 1 + .../plugins/UserCountryMap/svg/PRK.svg | 2 + .../plugins/UserCountryMap/svg/PRT.svg | 2 + .../plugins/UserCountryMap/svg/PRY.svg | 2 + .../plugins/UserCountryMap/svg/QAT.svg | 2 + .../plugins/UserCountryMap/svg/ROU.svg | 2 + .../plugins/UserCountryMap/svg/RUS.svg | 2 + .../plugins/UserCountryMap/svg/RWA.svg | 2 + .../plugins/UserCountryMap/svg/SA.svg | 2 + .../plugins/UserCountryMap/svg/SAU.svg | 2 + .../plugins/UserCountryMap/svg/SDN.svg | 2 + .../plugins/UserCountryMap/svg/SDS.svg | 2 + .../plugins/UserCountryMap/svg/SEN.svg | 2 + .../plugins/UserCountryMap/svg/SLB.svg | 2 + .../plugins/UserCountryMap/svg/SLE.svg | 2 + .../plugins/UserCountryMap/svg/SLV.svg | 2 + .../plugins/UserCountryMap/svg/SOM.svg | 2 + .../plugins/UserCountryMap/svg/SRB.svg | 2 + .../plugins/UserCountryMap/svg/SUR.svg | 2 + .../plugins/UserCountryMap/svg/SVK.svg | 2 + .../plugins/UserCountryMap/svg/SVN.svg | 1 + .../plugins/UserCountryMap/svg/SWE.svg | 2 + .../plugins/UserCountryMap/svg/SWZ.svg | 2 + .../plugins/UserCountryMap/svg/SYR.svg | 2 + .../plugins/UserCountryMap/svg/TCD.svg | 2 + .../plugins/UserCountryMap/svg/TGO.svg | 2 + .../plugins/UserCountryMap/svg/THA.svg | 2 + .../plugins/UserCountryMap/svg/TIB.svg | 1 + .../plugins/UserCountryMap/svg/TJK.svg | 2 + .../plugins/UserCountryMap/svg/TKM.svg | 2 + .../plugins/UserCountryMap/svg/TLS.svg | 2 + .../plugins/UserCountryMap/svg/TTO.svg | 2 + .../plugins/UserCountryMap/svg/TUN.svg | 2 + .../plugins/UserCountryMap/svg/TUR.svg | 2 + .../plugins/UserCountryMap/svg/TWN.svg | 2 + .../plugins/UserCountryMap/svg/TZA.svg | 2 + .../plugins/UserCountryMap/svg/UGA.svg | 2 + .../plugins/UserCountryMap/svg/UKR.svg | 2 + .../plugins/UserCountryMap/svg/URY.svg | 2 + .../plugins/UserCountryMap/svg/USA.svg | 1 + .../plugins/UserCountryMap/svg/UZB.svg | 2 + .../plugins/UserCountryMap/svg/VEN.svg | 2 + .../plugins/UserCountryMap/svg/VNM.svg | 2 + .../plugins/UserCountryMap/svg/VUT.svg | 2 + .../plugins/UserCountryMap/svg/YEM.svg | 2 + .../plugins/UserCountryMap/svg/ZAF.svg | 2 + .../plugins/UserCountryMap/svg/ZMB.svg | 2 + .../plugins/UserCountryMap/svg/ZWE.svg | 2 + .../plugins/UserCountryMap/svg/tmp.svg | 2 + .../plugins/UserCountryMap/svg/world.svg | 1 + .../UserCountryMap/templates/realtimeMap.twig | 29 + .../UserCountryMap/templates/visitorMap.twig | 106 + www/analytics/plugins/UserSettings/API.php | 243 + .../plugins/UserSettings/Archiver.php | 171 + .../plugins/UserSettings/Controller.php | 89 + .../plugins/UserSettings/UserSettings.php | 465 + .../plugins/UserSettings/functions.php | 270 + .../UserSettings/images/browsers/AA.gif | Bin 0 -> 1092 bytes .../UserSettings/images/browsers/AB.gif | Bin 0 -> 1064 bytes .../UserSettings/images/browsers/AG.gif | Bin 0 -> 351 bytes .../UserSettings/images/browsers/AM.gif | Bin 0 -> 198 bytes .../UserSettings/images/browsers/AN.gif | Bin 0 -> 144 bytes .../UserSettings/images/browsers/AR.gif | Bin 0 -> 1057 bytes .../UserSettings/images/browsers/AV.gif | Bin 0 -> 151 bytes .../UserSettings/images/browsers/AW.gif | Bin 0 -> 574 bytes .../UserSettings/images/browsers/B2.gif | Bin 0 -> 1070 bytes .../UserSettings/images/browsers/BB.gif | Bin 0 -> 576 bytes .../UserSettings/images/browsers/BD.gif | Bin 0 -> 1051 bytes .../UserSettings/images/browsers/BE.gif | Bin 0 -> 1042 bytes .../UserSettings/images/browsers/BP.gif | Bin 0 -> 1070 bytes .../UserSettings/images/browsers/BX.gif | Bin 0 -> 522 bytes .../UserSettings/images/browsers/CA.gif | Bin 0 -> 573 bytes .../UserSettings/images/browsers/CD.gif | Bin 0 -> 1045 bytes .../UserSettings/images/browsers/CF.gif | Bin 0 -> 1074 bytes .../UserSettings/images/browsers/CH.gif | Bin 0 -> 1074 bytes .../UserSettings/images/browsers/CK.gif | Bin 0 -> 1024 bytes .../UserSettings/images/browsers/CM.gif | Bin 0 -> 1074 bytes .../UserSettings/images/browsers/CN.gif | Bin 0 -> 998 bytes .../UserSettings/images/browsers/CO.gif | Bin 0 -> 1042 bytes .../UserSettings/images/browsers/CP.gif | Bin 0 -> 998 bytes .../UserSettings/images/browsers/CS.gif | Bin 0 -> 549 bytes .../UserSettings/images/browsers/DF.gif | Bin 0 -> 545 bytes .../UserSettings/images/browsers/DI.gif | Bin 0 -> 1068 bytes .../UserSettings/images/browsers/EL.gif | Bin 0 -> 90 bytes .../UserSettings/images/browsers/EP.gif | Bin 0 -> 316 bytes .../UserSettings/images/browsers/ES.gif | Bin 0 -> 1013 bytes .../UserSettings/images/browsers/FB.gif | Bin 0 -> 254 bytes .../UserSettings/images/browsers/FD.gif | Bin 0 -> 1050 bytes .../UserSettings/images/browsers/FE.gif | Bin 0 -> 550 bytes .../UserSettings/images/browsers/FF.gif | Bin 0 -> 197 bytes .../UserSettings/images/browsers/FL.gif | Bin 0 -> 1034 bytes .../UserSettings/images/browsers/FN.gif | Bin 0 -> 1033 bytes .../UserSettings/images/browsers/GA.gif | Bin 0 -> 159 bytes .../UserSettings/images/browsers/GE.gif | Bin 0 -> 997 bytes .../UserSettings/images/browsers/HA.gif | Bin 0 -> 1009 bytes .../UserSettings/images/browsers/HJ.gif | Bin 0 -> 1022 bytes .../UserSettings/images/browsers/IA.gif | Bin 0 -> 391 bytes .../UserSettings/images/browsers/IB.gif | Bin 0 -> 168 bytes .../UserSettings/images/browsers/IC.gif | Bin 0 -> 131 bytes .../UserSettings/images/browsers/ID.gif | Bin 0 -> 1057 bytes .../UserSettings/images/browsers/IE.gif | Bin 0 -> 999 bytes .../UserSettings/images/browsers/IR.gif | Bin 0 -> 610 bytes .../UserSettings/images/browsers/IW.gif | Bin 0 -> 1066 bytes .../UserSettings/images/browsers/KI.gif | Bin 0 -> 1050 bytes .../UserSettings/images/browsers/KM.gif | Bin 0 -> 180 bytes .../UserSettings/images/browsers/KO.gif | Bin 0 -> 986 bytes .../UserSettings/images/browsers/KP.gif | Bin 0 -> 1037 bytes .../UserSettings/images/browsers/KZ.gif | Bin 0 -> 1061 bytes .../UserSettings/images/browsers/LI.gif | Bin 0 -> 104 bytes .../UserSettings/images/browsers/LS.gif | Bin 0 -> 1086 bytes .../UserSettings/images/browsers/LX.gif | Bin 0 -> 104 bytes .../UserSettings/images/browsers/MC.gif | Bin 0 -> 1023 bytes .../UserSettings/images/browsers/MI.gif | Bin 0 -> 1025 bytes .../UserSettings/images/browsers/MO.gif | Bin 0 -> 192 bytes .../UserSettings/images/browsers/MS.gif | Bin 0 -> 1094 bytes .../UserSettings/images/browsers/MX.gif | Bin 0 -> 985 bytes .../UserSettings/images/browsers/NB.gif | Bin 0 -> 977 bytes .../UserSettings/images/browsers/NF.gif | Bin 0 -> 612 bytes .../UserSettings/images/browsers/NL.gif | Bin 0 -> 1081 bytes .../UserSettings/images/browsers/NP.gif | Bin 0 -> 1020 bytes .../UserSettings/images/browsers/NS.gif | Bin 0 -> 98 bytes .../UserSettings/images/browsers/OB.gif | Bin 0 -> 1010 bytes .../UserSettings/images/browsers/ON.gif | Bin 0 -> 635 bytes .../UserSettings/images/browsers/OP.gif | Bin 0 -> 987 bytes .../UserSettings/images/browsers/OR.gif | Bin 0 -> 1024 bytes .../UserSettings/images/browsers/OV.gif | Bin 0 -> 978 bytes .../UserSettings/images/browsers/OW.gif | Bin 0 -> 197 bytes .../UserSettings/images/browsers/PL.gif | Bin 0 -> 1058 bytes .../UserSettings/images/browsers/PM.gif | Bin 0 -> 1082 bytes .../UserSettings/images/browsers/PO.gif | Bin 0 -> 1065 bytes .../UserSettings/images/browsers/PU.gif | Bin 0 -> 1094 bytes .../UserSettings/images/browsers/PW.gif | Bin 0 -> 1082 bytes .../UserSettings/images/browsers/PX.gif | Bin 0 -> 170 bytes .../UserSettings/images/browsers/RK.gif | Bin 0 -> 1035 bytes .../UserSettings/images/browsers/SA.gif | Bin 0 -> 1008 bytes .../UserSettings/images/browsers/SF.gif | Bin 0 -> 190 bytes .../UserSettings/images/browsers/SL.gif | Bin 0 -> 900 bytes .../UserSettings/images/browsers/SM.gif | Bin 0 -> 391 bytes .../UserSettings/images/browsers/TB.gif | Bin 0 -> 1014 bytes .../UserSettings/images/browsers/TI.gif | Bin 0 -> 595 bytes .../UserSettings/images/browsers/TZ.gif | Bin 0 -> 973 bytes .../UserSettings/images/browsers/UC.gif | Bin 0 -> 994 bytes .../UserSettings/images/browsers/UN.gif | Bin 0 -> 80 bytes .../UserSettings/images/browsers/UNK.gif | Bin 0 -> 80 bytes .../UserSettings/images/browsers/WE.gif | Bin 0 -> 1012 bytes .../UserSettings/images/browsers/WO.gif | Bin 0 -> 1065 bytes .../UserSettings/images/browsers/WP.gif | Bin 0 -> 982 bytes .../UserSettings/images/browsers/YA.gif | Bin 0 -> 1048 bytes .../plugins/UserSettings/images/os/3DS.gif | Bin 0 -> 1085 bytes .../plugins/UserSettings/images/os/AIX.gif | Bin 0 -> 176 bytes .../plugins/UserSettings/images/os/AMG.gif | Bin 0 -> 1001 bytes .../plugins/UserSettings/images/os/AMI.gif | Bin 0 -> 1055 bytes .../plugins/UserSettings/images/os/AND.gif | Bin 0 -> 144 bytes .../plugins/UserSettings/images/os/ARL.gif | Bin 0 -> 947 bytes .../plugins/UserSettings/images/os/BBX.gif | Bin 0 -> 590 bytes .../plugins/UserSettings/images/os/BEO.gif | Bin 0 -> 1035 bytes .../plugins/UserSettings/images/os/BLB.gif | Bin 0 -> 576 bytes .../plugins/UserSettings/images/os/BSD.gif | Bin 0 -> 1016 bytes .../plugins/UserSettings/images/os/BTR.gif | Bin 0 -> 946 bytes .../plugins/UserSettings/images/os/CES.gif | Bin 0 -> 1011 bytes .../plugins/UserSettings/images/os/COS.gif | Bin 0 -> 1074 bytes .../plugins/UserSettings/images/os/DFB.gif | Bin 0 -> 326 bytes .../plugins/UserSettings/images/os/DSI.gif | Bin 0 -> 1076 bytes .../plugins/UserSettings/images/os/FED.gif | Bin 0 -> 1022 bytes .../plugins/UserSettings/images/os/FOS.gif | Bin 0 -> 197 bytes .../plugins/UserSettings/images/os/GNT.gif | Bin 0 -> 1075 bytes .../plugins/UserSettings/images/os/GTV.gif | Bin 0 -> 1614 bytes .../plugins/UserSettings/images/os/HPX.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/IOS.gif | Bin 0 -> 591 bytes .../plugins/UserSettings/images/os/IPA.gif | Bin 0 -> 587 bytes .../plugins/UserSettings/images/os/IPD.gif | Bin 0 -> 351 bytes .../plugins/UserSettings/images/os/IPH.gif | Bin 0 -> 577 bytes .../plugins/UserSettings/images/os/IRI.gif | Bin 0 -> 152 bytes .../plugins/UserSettings/images/os/KBT.gif | Bin 0 -> 998 bytes .../plugins/UserSettings/images/os/KNO.gif | Bin 0 -> 985 bytes .../plugins/UserSettings/images/os/LBT.gif | Bin 0 -> 951 bytes .../plugins/UserSettings/images/os/LIN.gif | Bin 0 -> 170 bytes .../plugins/UserSettings/images/os/MAC.gif | Bin 0 -> 171 bytes .../plugins/UserSettings/images/os/MAE.gif | Bin 0 -> 137 bytes .../plugins/UserSettings/images/os/MDR.gif | Bin 0 -> 918 bytes .../plugins/UserSettings/images/os/MIN.gif | Bin 0 -> 1009 bytes .../plugins/UserSettings/images/os/NBS.gif | Bin 0 -> 168 bytes .../plugins/UserSettings/images/os/NDS.gif | Bin 0 -> 1061 bytes .../plugins/UserSettings/images/os/OBS.gif | Bin 0 -> 571 bytes .../plugins/UserSettings/images/os/OS2.gif | Bin 0 -> 162 bytes .../plugins/UserSettings/images/os/POS.gif | Bin 0 -> 1060 bytes .../plugins/UserSettings/images/os/PPY.gif | Bin 0 -> 1037 bytes .../plugins/UserSettings/images/os/PS3.gif | Bin 0 -> 628 bytes .../plugins/UserSettings/images/os/PSP.gif | Bin 0 -> 592 bytes .../plugins/UserSettings/images/os/PSV.gif | Bin 0 -> 200 bytes .../plugins/UserSettings/images/os/QNX.gif | Bin 0 -> 241 bytes .../plugins/UserSettings/images/os/RHT.gif | Bin 0 -> 952 bytes .../plugins/UserSettings/images/os/ROS.gif | Bin 0 -> 956 bytes .../plugins/UserSettings/images/os/SAF.gif | Bin 0 -> 242 bytes .../plugins/UserSettings/images/os/SBA.gif | Bin 0 -> 990 bytes .../plugins/UserSettings/images/os/SLW.gif | Bin 0 -> 883 bytes .../plugins/UserSettings/images/os/SOS.gif | Bin 0 -> 1036 bytes .../plugins/UserSettings/images/os/SSE.gif | Bin 0 -> 1066 bytes .../plugins/UserSettings/images/os/SYL.gif | Bin 0 -> 1017 bytes .../plugins/UserSettings/images/os/SYM.gif | Bin 0 -> 1042 bytes .../plugins/UserSettings/images/os/T64.gif | Bin 0 -> 220 bytes .../plugins/UserSettings/images/os/TIZ.gif | Bin 0 -> 958 bytes .../plugins/UserSettings/images/os/UBT.gif | Bin 0 -> 986 bytes .../plugins/UserSettings/images/os/UNK.gif | Bin 0 -> 80 bytes .../plugins/UserSettings/images/os/VMS.gif | Bin 0 -> 572 bytes .../plugins/UserSettings/images/os/W2K.gif | Bin 0 -> 185 bytes .../plugins/UserSettings/images/os/W61.gif | Bin 0 -> 1060 bytes .../plugins/UserSettings/images/os/W65.gif | Bin 0 -> 1060 bytes .../plugins/UserSettings/images/os/W75.gif | Bin 0 -> 1089 bytes .../plugins/UserSettings/images/os/W95.gif | Bin 0 -> 185 bytes .../plugins/UserSettings/images/os/W98.gif | Bin 0 -> 185 bytes .../plugins/UserSettings/images/os/WCE.gif | Bin 0 -> 185 bytes .../plugins/UserSettings/images/os/WI7.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/WI8.gif | Bin 0 -> 925 bytes .../plugins/UserSettings/images/os/WII.gif | Bin 0 -> 617 bytes .../plugins/UserSettings/images/os/WIN.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/WIU.gif | Bin 0 -> 310 bytes .../plugins/UserSettings/images/os/WME.gif | Bin 0 -> 1025 bytes .../plugins/UserSettings/images/os/WMO.gif | Bin 0 -> 1060 bytes .../plugins/UserSettings/images/os/WNT.gif | Bin 0 -> 185 bytes .../plugins/UserSettings/images/os/WOS.gif | Bin 0 -> 70 bytes .../plugins/UserSettings/images/os/WP7.gif | Bin 0 -> 1089 bytes .../plugins/UserSettings/images/os/WPH.gif | Bin 0 -> 1089 bytes .../plugins/UserSettings/images/os/WRT.gif | Bin 0 -> 925 bytes .../plugins/UserSettings/images/os/WS3.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/WVI.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/WXP.gif | Bin 0 -> 191 bytes .../plugins/UserSettings/images/os/XBT.gif | Bin 0 -> 968 bytes .../plugins/UserSettings/images/os/XBX.gif | Bin 0 -> 1043 bytes .../plugins/UserSettings/images/os/YNS.gif | Bin 0 -> 913 bytes .../UserSettings/images/plugins/cookie.gif | Bin 0 -> 211 bytes .../UserSettings/images/plugins/director.gif | Bin 0 -> 198 bytes .../UserSettings/images/plugins/flash.gif | Bin 0 -> 1018 bytes .../UserSettings/images/plugins/gears.gif | Bin 0 -> 558 bytes .../UserSettings/images/plugins/java.gif | Bin 0 -> 565 bytes .../UserSettings/images/plugins/pdf.gif | Bin 0 -> 1021 bytes .../UserSettings/images/plugins/quicktime.gif | Bin 0 -> 1003 bytes .../images/plugins/realplayer.gif | Bin 0 -> 1025 bytes .../images/plugins/silverlight.gif | Bin 0 -> 1012 bytes .../images/plugins/windowsmedia.gif | Bin 0 -> 1026 bytes .../UserSettings/images/screens/dual.gif | Bin 0 -> 1082 bytes .../UserSettings/images/screens/mobile.gif | Bin 0 -> 324 bytes .../UserSettings/images/screens/normal.gif | Bin 0 -> 1088 bytes .../UserSettings/images/screens/unknown.gif | Bin 0 -> 80 bytes .../UserSettings/images/screens/wide.gif | Bin 0 -> 1025 bytes .../plugins/UserSettings/templates/index.twig | 27 + www/analytics/plugins/UsersManager/API.php | 646 + .../plugins/UsersManager/Controller.php | 340 + .../UsersManager/LastSeenTimeLogger.php | 72 + www/analytics/plugins/UsersManager/Model.php | 274 + .../plugins/UsersManager/UsersManager.php | 154 + .../plugins/UsersManager/images/add.png | Bin 0 -> 1366 bytes .../plugins/UsersManager/images/no-access.png | Bin 0 -> 653 bytes .../plugins/UsersManager/images/ok.png | Bin 0 -> 851 bytes .../UsersManager/javascripts/usersManager.js | 302 + .../UsersManager/javascripts/usersSettings.js | 96 + .../stylesheets/usersManager.less | 19 + .../plugins/UsersManager/templates/index.twig | 210 + .../UsersManager/templates/userSettings.twig | 181 + www/analytics/plugins/VisitFrequency/API.php | 84 + .../plugins/VisitFrequency/Controller.php | 105 + .../plugins/VisitFrequency/VisitFrequency.php | 70 + .../VisitFrequency/templates/_sparklines.twig | 22 + .../templates/getSparklines.twig | 1 + .../VisitFrequency/templates/index.twig | 9 + www/analytics/plugins/VisitTime/API.php | 156 + www/analytics/plugins/VisitTime/Archiver.php | 86 + .../plugins/VisitTime/Controller.php | 41 + www/analytics/plugins/VisitTime/VisitTime.php | 234 + www/analytics/plugins/VisitTime/functions.php | 40 + .../plugins/VisitTime/templates/index.twig | 9 + www/analytics/plugins/VisitorInterest/API.php | 114 + .../plugins/VisitorInterest/Archiver.php | 154 + .../plugins/VisitorInterest/Controller.php | 59 + .../VisitorInterest/VisitorInterest.php | 243 + .../VisitorInterest/templates/index.twig | 11 + www/analytics/plugins/VisitsSummary/API.php | 158 + .../plugins/VisitsSummary/Controller.php | 187 + .../plugins/VisitsSummary/VisitsSummary.php | 80 + .../VisitsSummary/stylesheets/datatable.less | 6 + .../VisitsSummary/templates/_sparklines.twig | 69 + .../templates/getSparklines.twig | 1 + .../VisitsSummary/templates/index.twig | 16 + .../plugins/Widgetize/Controller.php | 64 + www/analytics/plugins/Widgetize/Widgetize.php | 65 + .../Widgetize/javascripts/widgetize.js | 84 + .../Widgetize/stylesheets/widgetize.less | 31 + .../plugins/Widgetize/templates/iframe.twig | 22 + .../Widgetize/templates/iframe_empty.twig | 1 + .../plugins/Widgetize/templates/index.twig | 69 + .../Widgetize/templates/testJsInclude1.twig | 22 + .../Widgetize/templates/testJsInclude2.twig | 27 + .../plugins/Zeitgeist/images/affix-arrow.png | Bin 0 -> 3179 bytes .../plugins/Zeitgeist/images/annotations.png | Bin 0 -> 1627 bytes .../Zeitgeist/images/annotations_starred.png | Bin 0 -> 1618 bytes .../plugins/Zeitgeist/images/arr_r.png | Bin 0 -> 195 bytes .../Zeitgeist/images/background-submit.png | Bin 0 -> 1347 bytes .../plugins/Zeitgeist/images/chart_bar.png | Bin 0 -> 170 bytes .../Zeitgeist/images/chart_line_edit.png | Bin 0 -> 993 bytes .../plugins/Zeitgeist/images/chart_pie.png | Bin 0 -> 355 bytes .../plugins/Zeitgeist/images/close.png | Bin 0 -> 1089 bytes .../Zeitgeist/images/collapsed_arrows.gif | Bin 0 -> 54 bytes .../Zeitgeist/images/configure-highlight.png | Bin 0 -> 933 bytes .../plugins/Zeitgeist/images/configure.png | Bin 0 -> 387 bytes .../Zeitgeist/images/dashboard_h_bg.png | Bin 0 -> 162 bytes .../Zeitgeist/images/dashboard_h_bg_hover.png | Bin 0 -> 333 bytes .../images/data_table_footer_active_item.png | Bin 0 -> 145 bytes .../Zeitgeist/images/datepicker_arr_l.png | Bin 0 -> 191 bytes .../Zeitgeist/images/datepicker_arr_r.png | Bin 0 -> 196 bytes .../plugins/Zeitgeist/images/delete.png | Bin 0 -> 2175 bytes .../plugins/Zeitgeist/images/download.png | Bin 0 -> 734 bytes .../images/ecommerceAbandonedCart.gif | Bin 0 -> 369 bytes .../Zeitgeist/images/ecommerceOrder.gif | Bin 0 -> 570 bytes .../plugins/Zeitgeist/images/email.png | Bin 0 -> 754 bytes .../plugins/Zeitgeist/images/error.png | Bin 0 -> 1150 bytes .../plugins/Zeitgeist/images/error_medium.png | Bin 0 -> 2622 bytes .../plugins/Zeitgeist/images/event.png | Bin 0 -> 164 bytes .../Zeitgeist/images/expanded_arrows.gif | Bin 0 -> 60 bytes .../plugins/Zeitgeist/images/export.png | Bin 0 -> 219 bytes .../plugins/Zeitgeist/images/feed.png | Bin 0 -> 691 bytes .../plugins/Zeitgeist/images/fullscreen.png | Bin 0 -> 346 bytes .../plugins/Zeitgeist/images/goal.png | Bin 0 -> 270 bytes .../plugins/Zeitgeist/images/help.png | Bin 0 -> 942 bytes .../plugins/Zeitgeist/images/html_icon.png | Bin 0 -> 3503 bytes .../plugins/Zeitgeist/images/ico_alert.png | Bin 0 -> 1112 bytes .../plugins/Zeitgeist/images/ico_delete.png | Bin 0 -> 231 bytes .../plugins/Zeitgeist/images/ico_edit.png | Bin 0 -> 255 bytes .../plugins/Zeitgeist/images/ico_info.png | Bin 0 -> 978 bytes .../Zeitgeist/images/icon-calendar.gif | Bin 0 -> 331 bytes .../plugins/Zeitgeist/images/image.png | Bin 0 -> 306 bytes .../plugins/Zeitgeist/images/inp_bg.png | Bin 0 -> 137 bytes .../plugins/Zeitgeist/images/li_dbl_gray.gif | Bin 0 -> 48 bytes .../plugins/Zeitgeist/images/link.gif | Bin 0 -> 75 bytes .../plugins/Zeitgeist/images/loading-blue.gif | Bin 0 -> 723 bytes .../plugins/Zeitgeist/images/login-sprite.png | Bin 0 -> 10200 bytes .../plugins/Zeitgeist/images/logo-header.png | Bin 0 -> 3682 bytes .../Zeitgeist/images/logo-marketplace.png | Bin 0 -> 2927 bytes .../plugins/Zeitgeist/images/logo.png | Bin 0 -> 11152 bytes .../plugins/Zeitgeist/images/logo.svg | 9 + .../plugins/Zeitgeist/images/maximise.png | Bin 0 -> 3182 bytes .../plugins/Zeitgeist/images/minimise.png | Bin 0 -> 2869 bytes .../plugins/Zeitgeist/images/minus.png | Bin 0 -> 176 bytes .../plugins/Zeitgeist/images/newtab.png | Bin 0 -> 509 bytes www/analytics/plugins/Zeitgeist/images/ok.png | Bin 0 -> 626 bytes .../Zeitgeist/images/paypal_subscribe.gif | Bin 0 -> 3080 bytes .../plugins/Zeitgeist/images/plus.png | Bin 0 -> 174 bytes .../plugins/Zeitgeist/images/plus_blue.png | Bin 0 -> 157 bytes .../plugins/Zeitgeist/images/refresh.png | Bin 0 -> 2978 bytes .../plugins/Zeitgeist/images/reload.png | Bin 0 -> 892 bytes .../Zeitgeist/images/row_evolution.png | Bin 0 -> 1934 bytes .../Zeitgeist/images/row_evolution_hover.png | Bin 0 -> 601 bytes .../plugins/Zeitgeist/images/search_bg.png | Bin 0 -> 384 bytes .../plugins/Zeitgeist/images/search_ico.png | Bin 0 -> 175 bytes .../Zeitgeist/images/sites_selection.png | Bin 0 -> 120 bytes .../plugins/Zeitgeist/images/smileyprog_0.png | Bin 0 -> 4045 bytes .../plugins/Zeitgeist/images/smileyprog_1.png | Bin 0 -> 4268 bytes .../plugins/Zeitgeist/images/smileyprog_2.png | Bin 0 -> 4292 bytes .../plugins/Zeitgeist/images/smileyprog_3.png | Bin 0 -> 4589 bytes .../plugins/Zeitgeist/images/smileyprog_4.png | Bin 0 -> 4733 bytes .../Zeitgeist/images/sort_subtable_asc.png | Bin 0 -> 173 bytes .../images/sort_subtable_asc_light.png | Bin 0 -> 2866 bytes .../Zeitgeist/images/sort_subtable_desc.png | Bin 0 -> 171 bytes .../images/sort_subtable_desc_light.png | Bin 0 -> 286 bytes .../plugins/Zeitgeist/images/sortasc.png | Bin 0 -> 173 bytes .../plugins/Zeitgeist/images/sortdesc.png | Bin 0 -> 171 bytes .../plugins/Zeitgeist/images/star.png | Bin 0 -> 757 bytes .../plugins/Zeitgeist/images/star_empty.png | Bin 0 -> 658 bytes .../Zeitgeist/images/success_medium.png | Bin 0 -> 1346 bytes .../plugins/Zeitgeist/images/table.png | Bin 0 -> 151 bytes .../plugins/Zeitgeist/images/table_more.png | Bin 0 -> 200 bytes .../plugins/Zeitgeist/images/tagcloud.png | Bin 0 -> 202 bytes .../plugins/Zeitgeist/images/video_play.png | Bin 0 -> 517 bytes .../plugins/Zeitgeist/images/warning.png | Bin 0 -> 571 bytes .../Zeitgeist/images/warning_medium.png | Bin 0 -> 1283 bytes .../Zeitgeist/images/warning_small.png | Bin 0 -> 1083 bytes .../plugins/Zeitgeist/images/zoom-out.png | Bin 0 -> 289 bytes .../Zeitgeist/javascripts/ajaxHelper.js | 450 + .../Zeitgeist/javascripts/piwikHelper.js | 464 + www/analytics/plugins/Zeitgeist/plugin.json | 5 + .../plugins/Zeitgeist/stylesheets/base.less | 28 + .../stylesheets/general/_default.less | 115 + .../Zeitgeist/stylesheets/general/_form.less | 126 + .../stylesheets/general/_jqueryUI.less | 235 + .../Zeitgeist/stylesheets/general/_misc.less | 41 + .../Zeitgeist/stylesheets/general/_utils.less | 30 + .../plugins/Zeitgeist/stylesheets/ieonly.css | 35 + .../plugins/Zeitgeist/stylesheets/rtl.css | 1 + .../stylesheets/simple_structure.css | 100 + .../Zeitgeist/stylesheets/ui/_dataTable.less | 3 + .../Zeitgeist/stylesheets/ui/_header.less | 59 + .../stylesheets/ui/_headerMessage.less | 67 + .../stylesheets/ui/_languageSelect.less | 39 + .../Zeitgeist/stylesheets/ui/_loading.less | 26 + .../stylesheets/ui/_periodSelect.less | 81 + .../Zeitgeist/stylesheets/ui/_siteSelect.less | 176 + .../Zeitgeist/templates/_iframeBuster.twig | 11 + .../Zeitgeist/templates/_jsCssIncludes.twig | 7 + .../templates/_jsGlobalVariables.twig | 39 + .../Zeitgeist/templates/_piwikTag.twig | 30 + .../Zeitgeist/templates/_sparklineFooter.twig | 5 + .../plugins/Zeitgeist/templates/admin.twig | 59 + .../Zeitgeist/templates/ajaxMacros.twig | 18 + .../Zeitgeist/templates/dashboard.twig | 50 + .../plugins/Zeitgeist/templates/empty.twig | 2 + .../Zeitgeist/templates/genericForm.twig | 36 + .../Zeitgeist/templates/javascriptCode.tpl | 15 + .../plugins/Zeitgeist/templates/macros.twig | 23 + .../templates/simpleLayoutFooter.tpl | 3 + .../templates/simpleLayoutHeader.tpl | 11 + www/analytics/robots.txt | 0 www/analytics/tests/README.md | 140 + www/analytics/tmp/.htaccess | 13 + www/analytics/vendor/.htaccess | 33 + www/analytics/vendor/autoload.php | 7 + www/analytics/vendor/composer/ClassLoader.php | 378 + .../vendor/composer/autoload_classmap.php | 14 + .../vendor/composer/autoload_files.php | 11 + .../vendor/composer/autoload_namespaces.php | 12 + .../vendor/composer/autoload_psr4.php | 9 + .../vendor/composer/autoload_real.php | 58 + www/analytics/vendor/composer/installed.json | 299 + www/analytics/vendor/leafo/lessphp/.gitignore | 8 + .../vendor/leafo/lessphp/.travis.yml | 5 + www/analytics/vendor/leafo/lessphp/LICENSE | 660 + www/analytics/vendor/leafo/lessphp/Makefile | 7 + www/analytics/vendor/leafo/lessphp/README.md | 96 + .../vendor/leafo/lessphp/composer.json | 25 + .../vendor/leafo/lessphp/docs/docs.md | 1400 + .../vendor/leafo/lessphp/lessc.inc.php | 3675 ++ www/analytics/vendor/leafo/lessphp/lessify | 23 + .../vendor/leafo/lessphp/lessify.inc.php | 447 + www/analytics/vendor/leafo/lessphp/package.sh | 34 + www/analytics/vendor/leafo/lessphp/plessc | 250 + .../vendor/mustangostang/spyc/COPYING | 21 + .../vendor/mustangostang/spyc/README | 159 + .../vendor/mustangostang/spyc/Spyc.php | 1045 + .../vendor/mustangostang/spyc/composer.json | 27 + .../mustangostang/spyc/examples/yaml-dump.php | 25 + .../mustangostang/spyc/examples/yaml-load.php | 21 + .../vendor/mustangostang/spyc/php4/5to4.php | 17 + .../vendor/mustangostang/spyc/php4/spyc.php4 | 1023 + .../vendor/mustangostang/spyc/php4/test.php4 | 162 + .../vendor/mustangostang/spyc/spyc.yaml | 206 + .../vendor/piwik/device-detector/.gitignore | 3 + .../vendor/piwik/device-detector/.travis.yml | 13 + .../piwik/device-detector/DeviceDetector.php | 967 + .../vendor/piwik/device-detector/README.md | 7 + .../piwik/device-detector/composer.json | 28 + .../device-detector/regexes/browsers.yml | 540 + .../piwik/device-detector/regexes/mobiles.yml | 1322 + .../piwik/device-detector/regexes/oss.yml | 494 + .../device-detector/regexes/televisions.yml | 242 + .../Symfony/Component/Console/.gitignore | 3 + .../Symfony/Component/Console/Application.php | 1101 + .../Symfony/Component/Console/CHANGELOG.md | 45 + .../Component/Console/Command/Command.php | 622 + .../Component/Console/Command/HelpCommand.php | 91 + .../Component/Console/Command/ListCommand.php | 95 + .../Component/Console/ConsoleEvents.php | 55 + .../Descriptor/ApplicationDescription.php | 153 + .../Console/Descriptor/Descriptor.php | 119 + .../Descriptor/DescriptorInterface.php | 31 + .../Console/Descriptor/JsonDescriptor.php | 165 + .../Console/Descriptor/MarkdownDescriptor.php | 139 + .../Console/Descriptor/TextDescriptor.php | 229 + .../Console/Descriptor/XmlDescriptor.php | 264 + .../Console/Event/ConsoleCommandEvent.php | 21 + .../Component/Console/Event/ConsoleEvent.php | 67 + .../Console/Event/ConsoleExceptionEvent.php | 67 + .../Console/Event/ConsoleTerminateEvent.php | 58 + .../Console/Formatter/OutputFormatter.php | 236 + .../Formatter/OutputFormatterInterface.php | 83 + .../Formatter/OutputFormatterStyle.php | 222 + .../OutputFormatterStyleInterface.php | 72 + .../Formatter/OutputFormatterStyleStack.php | 121 + .../Console/Helper/DescriptorHelper.php | 96 + .../Component/Console/Helper/DialogHelper.php | 473 + .../Console/Helper/FormatterHelper.php | 80 + .../Component/Console/Helper/Helper.php | 62 + .../Console/Helper/HelperInterface.php | 49 + .../Component/Console/Helper/HelperSet.php | 108 + .../Console/Helper/InputAwareHelper.php | 33 + .../Console/Helper/ProgressHelper.php | 452 + .../Component/Console/Helper/TableHelper.php | 520 + .../Component/Console/Input/ArgvInput.php | 351 + .../Component/Console/Input/ArrayInput.php | 209 + .../Symfony/Component/Console/Input/Input.php | 226 + .../Component/Console/Input/InputArgument.php | 132 + .../Console/Input/InputAwareInterface.php | 28 + .../Console/Input/InputDefinition.php | 458 + .../Console/Input/InputInterface.php | 152 + .../Component/Console/Input/InputOption.php | 212 + .../Component/Console/Input/StringInput.php | 85 + .../console/Symfony/Component/Console/LICENSE | 19 + .../Console/Output/BufferedOutput.php | 48 + .../Console/Output/ConsoleOutput.php | 113 + .../Console/Output/ConsoleOutputInterface.php | 35 + .../Component/Console/Output/NullOutput.php | 93 + .../Component/Console/Output/Output.php | 165 + .../Console/Output/OutputInterface.php | 113 + .../Component/Console/Output/StreamOutput.php | 107 + .../Symfony/Component/Console/README.md | 63 + .../Symfony/Component/Console/Shell.php | 228 + .../Console/Tester/ApplicationTester.php | 128 + .../Console/Tester/CommandTester.php | 132 + .../Symfony/Component/Console/composer.json | 37 + .../Component/Console/phpunit.xml.dist | 30 + .../vendor/tedivm/jshrink/.gitignore | 7 + .../vendor/tedivm/jshrink/.travis.yml | 5 + www/analytics/vendor/tedivm/jshrink/LICENSE | 24 + www/analytics/vendor/tedivm/jshrink/README.md | 21 + .../vendor/tedivm/jshrink/composer.json | 20 + .../tedivm/jshrink/src/JShrink/Minifier.php | 470 + www/analytics/vendor/twig/twig/.editorconfig | 18 + www/analytics/vendor/twig/twig/.gitignore | 2 + www/analytics/vendor/twig/twig/.travis.yml | 21 + www/analytics/vendor/twig/twig/CHANGELOG | 677 + www/analytics/vendor/twig/twig/LICENSE | 31 + www/analytics/vendor/twig/twig/README.rst | 15 + www/analytics/vendor/twig/twig/composer.json | 42 + .../vendor/twig/twig/ext/twig/.gitignore | 30 + .../vendor/twig/twig/ext/twig/LICENSE | 31 + .../vendor/twig/twig/ext/twig/config.m4 | 8 + .../vendor/twig/twig/ext/twig/config.w32 | 8 + .../vendor/twig/twig/ext/twig/php_twig.h | 31 + .../vendor/twig/twig/ext/twig/twig.c | 1101 + .../vendor/twig/twig/lib/Twig/Autoloader.php | 48 + .../vendor/twig/twig/lib/Twig/Compiler.php | 270 + .../twig/twig/lib/Twig/CompilerInterface.php | 35 + .../vendor/twig/twig/lib/Twig/Environment.php | 1254 + .../vendor/twig/twig/lib/Twig/Error.php | 248 + .../twig/twig/lib/Twig/Error/Loader.php | 31 + .../twig/twig/lib/Twig/Error/Runtime.php | 20 + .../twig/twig/lib/Twig/Error/Syntax.php | 20 + .../twig/lib/Twig/ExistsLoaderInterface.php | 28 + .../twig/twig/lib/Twig/ExpressionParser.php | 598 + .../vendor/twig/twig/lib/Twig/Extension.php | 93 + .../twig/twig/lib/Twig/Extension/Core.php | 1463 + .../twig/twig/lib/Twig/Extension/Debug.php | 71 + .../twig/twig/lib/Twig/Extension/Escaper.php | 107 + .../twig/lib/Twig/Extension/Optimizer.php | 35 + .../twig/twig/lib/Twig/Extension/Sandbox.php | 112 + .../twig/twig/lib/Twig/Extension/Staging.php | 113 + .../twig/lib/Twig/Extension/StringLoader.php | 64 + .../twig/twig/lib/Twig/ExtensionInterface.php | 83 + .../vendor/twig/twig/lib/Twig/Filter.php | 81 + .../twig/twig/lib/Twig/Filter/Function.php | 37 + .../twig/twig/lib/Twig/Filter/Method.php | 39 + .../vendor/twig/twig/lib/Twig/Filter/Node.php | 39 + .../twig/lib/Twig/FilterCallableInterface.php | 23 + .../twig/twig/lib/Twig/FilterInterface.php | 42 + .../vendor/twig/twig/lib/Twig/Function.php | 71 + .../twig/twig/lib/Twig/Function/Function.php | 38 + .../twig/twig/lib/Twig/Function/Method.php | 40 + .../twig/twig/lib/Twig/Function/Node.php | 39 + .../lib/Twig/FunctionCallableInterface.php | 23 + .../twig/twig/lib/Twig/FunctionInterface.php | 39 + .../vendor/twig/twig/lib/Twig/Lexer.php | 409 + .../twig/twig/lib/Twig/LexerInterface.php | 31 + .../twig/twig/lib/Twig/Loader/Array.php | 95 + .../twig/twig/lib/Twig/Loader/Chain.php | 138 + .../twig/twig/lib/Twig/Loader/Filesystem.php | 229 + .../twig/twig/lib/Twig/Loader/String.php | 59 + .../twig/twig/lib/Twig/LoaderInterface.php | 52 + .../vendor/twig/twig/lib/Twig/Markup.php | 37 + .../vendor/twig/twig/lib/Twig/Node.php | 226 + .../twig/twig/lib/Twig/Node/AutoEscape.php | 39 + .../vendor/twig/twig/lib/Twig/Node/Block.php | 44 + .../twig/lib/Twig/Node/BlockReference.php | 37 + .../vendor/twig/twig/lib/Twig/Node/Body.php | 19 + .../vendor/twig/twig/lib/Twig/Node/Do.php | 38 + .../vendor/twig/twig/lib/Twig/Node/Embed.php | 38 + .../twig/twig/lib/Twig/Node/Expression.php | 20 + .../twig/lib/Twig/Node/Expression/Array.php | 86 + .../lib/Twig/Node/Expression/AssignName.php | 28 + .../twig/lib/Twig/Node/Expression/Binary.php | 40 + .../lib/Twig/Node/Expression/Binary/Add.php | 18 + .../lib/Twig/Node/Expression/Binary/And.php | 18 + .../Node/Expression/Binary/BitwiseAnd.php | 18 + .../Twig/Node/Expression/Binary/BitwiseOr.php | 18 + .../Node/Expression/Binary/BitwiseXor.php | 18 + .../Twig/Node/Expression/Binary/Concat.php | 18 + .../lib/Twig/Node/Expression/Binary/Div.php | 18 + .../Twig/Node/Expression/Binary/EndsWith.php | 30 + .../lib/Twig/Node/Expression/Binary/Equal.php | 17 + .../Twig/Node/Expression/Binary/FloorDiv.php | 29 + .../Twig/Node/Expression/Binary/Greater.php | 17 + .../Node/Expression/Binary/GreaterEqual.php | 17 + .../lib/Twig/Node/Expression/Binary/In.php | 33 + .../lib/Twig/Node/Expression/Binary/Less.php | 17 + .../Twig/Node/Expression/Binary/LessEqual.php | 17 + .../Twig/Node/Expression/Binary/Matches.php | 28 + .../lib/Twig/Node/Expression/Binary/Mod.php | 18 + .../lib/Twig/Node/Expression/Binary/Mul.php | 18 + .../Twig/Node/Expression/Binary/NotEqual.php | 17 + .../lib/Twig/Node/Expression/Binary/NotIn.php | 33 + .../lib/Twig/Node/Expression/Binary/Or.php | 18 + .../lib/Twig/Node/Expression/Binary/Power.php | 33 + .../lib/Twig/Node/Expression/Binary/Range.php | 33 + .../Node/Expression/Binary/StartsWith.php | 28 + .../lib/Twig/Node/Expression/Binary/Sub.php | 18 + .../Twig/Node/Expression/BlockReference.php | 51 + .../twig/lib/Twig/Node/Expression/Call.php | 178 + .../lib/Twig/Node/Expression/Conditional.php | 31 + .../lib/Twig/Node/Expression/Constant.php | 23 + .../Node/Expression/ExtensionReference.php | 33 + .../twig/lib/Twig/Node/Expression/Filter.php | 36 + .../Twig/Node/Expression/Filter/Default.php | 43 + .../lib/Twig/Node/Expression/Function.php | 35 + .../twig/lib/Twig/Node/Expression/GetAttr.php | 53 + .../lib/Twig/Node/Expression/MethodCall.php | 41 + .../twig/lib/Twig/Node/Expression/Name.php | 88 + .../twig/lib/Twig/Node/Expression/Parent.php | 47 + .../lib/Twig/Node/Expression/TempName.php | 26 + .../twig/lib/Twig/Node/Expression/Test.php | 32 + .../Twig/Node/Expression/Test/Constant.php | 46 + .../lib/Twig/Node/Expression/Test/Defined.php | 54 + .../Twig/Node/Expression/Test/Divisibleby.php | 33 + .../lib/Twig/Node/Expression/Test/Even.php | 32 + .../lib/Twig/Node/Expression/Test/Null.php | 31 + .../lib/Twig/Node/Expression/Test/Odd.php | 32 + .../lib/Twig/Node/Expression/Test/Sameas.php | 29 + .../twig/lib/Twig/Node/Expression/Unary.php | 30 + .../lib/Twig/Node/Expression/Unary/Neg.php | 18 + .../lib/Twig/Node/Expression/Unary/Not.php | 18 + .../lib/Twig/Node/Expression/Unary/Pos.php | 18 + .../vendor/twig/twig/lib/Twig/Node/Flush.php | 36 + .../vendor/twig/twig/lib/Twig/Node/For.php | 112 + .../twig/twig/lib/Twig/Node/ForLoop.php | 55 + .../vendor/twig/twig/lib/Twig/Node/If.php | 66 + .../vendor/twig/twig/lib/Twig/Node/Import.php | 50 + .../twig/twig/lib/Twig/Node/Include.php | 99 + .../vendor/twig/twig/lib/Twig/Node/Macro.php | 96 + .../vendor/twig/twig/lib/Twig/Node/Module.php | 383 + .../vendor/twig/twig/lib/Twig/Node/Print.php | 39 + .../twig/twig/lib/Twig/Node/Sandbox.php | 47 + .../twig/lib/Twig/Node/SandboxedModule.php | 60 + .../twig/lib/Twig/Node/SandboxedPrint.php | 59 + .../vendor/twig/twig/lib/Twig/Node/Set.php | 101 + .../twig/twig/lib/Twig/Node/SetTemp.php | 35 + .../twig/twig/lib/Twig/Node/Spaceless.php | 40 + .../vendor/twig/twig/lib/Twig/Node/Text.php | 39 + .../twig/twig/lib/Twig/NodeInterface.php | 30 + .../twig/lib/Twig/NodeOutputInterface.php | 19 + .../twig/twig/lib/Twig/NodeTraverser.php | 88 + .../twig/lib/Twig/NodeVisitor/Escaper.php | 167 + .../twig/lib/Twig/NodeVisitor/Optimizer.php | 246 + .../lib/Twig/NodeVisitor/SafeAnalysis.php | 139 + .../twig/lib/Twig/NodeVisitor/Sandbox.php | 92 + .../twig/lib/Twig/NodeVisitorInterface.php | 47 + .../vendor/twig/twig/lib/Twig/Parser.php | 390 + .../twig/twig/lib/Twig/ParserInterface.php | 30 + .../twig/lib/Twig/Sandbox/SecurityError.php | 19 + .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 119 + .../Twig/Sandbox/SecurityPolicyInterface.php | 24 + .../twig/twig/lib/Twig/SimpleFilter.php | 94 + .../twig/twig/lib/Twig/SimpleFunction.php | 84 + .../vendor/twig/twig/lib/Twig/SimpleTest.php | 46 + .../vendor/twig/twig/lib/Twig/Template.php | 484 + .../twig/twig/lib/Twig/TemplateInterface.php | 47 + .../vendor/twig/twig/lib/Twig/Test.php | 34 + .../twig/twig/lib/Twig/Test/Function.php | 35 + .../lib/Twig/Test/IntegrationTestCase.php | 154 + .../vendor/twig/twig/lib/Twig/Test/Method.php | 37 + .../vendor/twig/twig/lib/Twig/Test/Node.php | 37 + .../twig/twig/lib/Twig/Test/NodeTestCase.php | 58 + .../twig/lib/Twig/TestCallableInterface.php | 21 + .../twig/twig/lib/Twig/TestInterface.php | 26 + .../vendor/twig/twig/lib/Twig/Token.php | 216 + .../vendor/twig/twig/lib/Twig/TokenParser.php | 33 + .../twig/lib/Twig/TokenParser/AutoEscape.php | 89 + .../twig/twig/lib/Twig/TokenParser/Block.php | 81 + .../twig/twig/lib/Twig/TokenParser/Do.php | 42 + .../twig/twig/lib/Twig/TokenParser/Embed.php | 66 + .../twig/lib/Twig/TokenParser/Extends.php | 52 + .../twig/twig/lib/Twig/TokenParser/Filter.php | 61 + .../twig/twig/lib/Twig/TokenParser/Flush.php | 42 + .../twig/twig/lib/Twig/TokenParser/For.php | 135 + .../twig/twig/lib/Twig/TokenParser/From.php | 70 + .../twig/twig/lib/Twig/TokenParser/If.php | 94 + .../twig/twig/lib/Twig/TokenParser/Import.php | 49 + .../twig/lib/Twig/TokenParser/Include.php | 75 + .../twig/twig/lib/Twig/TokenParser/Macro.php | 68 + .../twig/lib/Twig/TokenParser/Sandbox.php | 68 + .../twig/twig/lib/Twig/TokenParser/Set.php | 83 + .../twig/lib/Twig/TokenParser/Spaceless.php | 59 + .../twig/twig/lib/Twig/TokenParser/Use.php | 76 + .../twig/twig/lib/Twig/TokenParserBroker.php | 136 + .../lib/Twig/TokenParserBrokerInterface.php | 45 + .../twig/lib/Twig/TokenParserInterface.php | 43 + .../vendor/twig/twig/lib/Twig/TokenStream.php | 156 + .../vendor/twig/twig/phpunit.xml.dist | 25 + www/css/desktop.css | 475 + www/css/ol.css | 1 + www/error403.html | 14 + www/error404.html | 14 + www/error500.html | 14 + www/favicon.ico | Bin 0 -> 1150 bytes www/grafics/charactergroup.jpg | Bin 0 -> 1786 bytes www/grafics/lvlup.jpg | Bin 0 -> 4531 bytes www/grafics/paper.jpg | Bin 0 -> 3445 bytes www/grafics/questlab.jpg | Bin 0 -> 80563 bytes www/index.php | 51 + www/js/dnd.js | 54 + www/js/imagelightbox.min.js | 6 + www/js/jquery.nicescroll.min.js | 111 + www/js/misc.js | 52 + www/js/ol.js | 964 + 4209 files changed, 1186656 insertions(+) create mode 100644 .hgignore create mode 100644 .htaccess create mode 100644 agents/BottomlevelAgent.inc create mode 100644 agents/IntermediateAgent.inc create mode 100644 agents/ToplevelAgent.inc create mode 100644 agents/bottomlevel/MailreceiverAgent.inc create mode 100644 agents/bottomlevel/MenuAgent.inc create mode 100644 agents/bottomlevel/QuestgroupshierarchypathAgent.inc create mode 100644 agents/bottomlevel/SeminarybarAgent.inc create mode 100644 agents/bottomlevel/SeminarymenuAgent.inc create mode 100644 agents/bottomlevel/UserrolesAgent.inc create mode 100644 agents/bottomlevel/empty create mode 100644 agents/intermediate/AchievementsAgent.inc create mode 100644 agents/intermediate/CharactergroupsAgent.inc create mode 100644 agents/intermediate/CharactergroupsquestsAgent.inc create mode 100644 agents/intermediate/CharactersAgent.inc create mode 100644 agents/intermediate/CharactertypesAgent.inc create mode 100644 agents/intermediate/ErrorAgent.inc create mode 100644 agents/intermediate/IntroductionAgent.inc create mode 100644 agents/intermediate/LibraryAgent.inc create mode 100644 agents/intermediate/MailAgent.inc create mode 100644 agents/intermediate/MapAgent.inc create mode 100644 agents/intermediate/MediaAgent.inc create mode 100644 agents/intermediate/QuestgroupsAgent.inc create mode 100644 agents/intermediate/QuestgroupshierarchyAgent.inc create mode 100644 agents/intermediate/QuestsAgent.inc create mode 100644 agents/intermediate/SeminariesAgent.inc create mode 100644 agents/intermediate/UploadsAgent.inc create mode 100644 agents/intermediate/UsersAgent.inc create mode 100644 agents/intermediate/XplevelsAgent.inc create mode 100644 agents/intermediate/empty create mode 100644 agents/toplevel/AjaxAgent.inc create mode 100644 agents/toplevel/BinaryAgent.inc create mode 100644 agents/toplevel/FaultAgent.inc create mode 100644 agents/toplevel/HtmlAgent.inc create mode 100644 agents/toplevel/HtmlmailAgent.inc create mode 100644 agents/toplevel/TextmailAgent.inc create mode 100644 agents/toplevel/empty create mode 100644 apis/WebApi.inc create mode 100644 app/Controller.inc create mode 100644 app/Model.inc create mode 100644 app/TextFormatter.inc create mode 100644 app/Utils.inc create mode 100644 app/agents/QuesttypeAgent.inc create mode 100644 app/agents/ToplevelAgent.inc create mode 100644 app/apis/MailApi.inc create mode 100644 app/controllers/IntermediateController.inc create mode 100644 app/controllers/QuesttypeController.inc create mode 100644 app/controllers/SeminaryController.inc create mode 100644 app/empty create mode 100644 app/exceptions/FileCopyException.inc create mode 100644 app/exceptions/FileUploadException.inc create mode 100644 app/exceptions/MailingException.inc create mode 100644 app/exceptions/MaxFilesizeException.inc create mode 100644 app/exceptions/QuesttypeAgentNotFoundException.inc create mode 100644 app/exceptions/QuesttypeAgentNotValidException.inc create mode 100644 app/exceptions/QuesttypeControllerNotFoundException.inc create mode 100644 app/exceptions/QuesttypeControllerNotValidException.inc create mode 100644 app/exceptions/QuesttypeModelNotFoundException.inc create mode 100644 app/exceptions/QuesttypeModelNotValidException.inc create mode 100644 app/exceptions/SubmissionNotValidException.inc create mode 100644 app/exceptions/WrongFiletypeException.inc create mode 100644 app/lib/PHPMailer.inc create mode 100644 app/lib/PHPMailerAutoload.inc create mode 100644 app/lib/Password.inc create mode 100644 app/lib/SMTP.inc create mode 100644 app/models/QuesttypeModel.inc create mode 100644 app/requests/MailRequest.inc create mode 100644 app/responses/MailResponse.inc create mode 100644 app/views/QuesttypeView.inc create mode 100644 bootstrap.inc create mode 100644 configs/AppConfig.inc create mode 100644 configs/CoreConfig.inc create mode 100644 controllers/AchievementsController.inc create mode 100644 controllers/AjaxController.inc create mode 100644 controllers/BinaryController.inc create mode 100644 controllers/CharactergroupsController.inc create mode 100644 controllers/CharactergroupsquestsController.inc create mode 100644 controllers/CharactersController.inc create mode 100644 controllers/CharactertypesController.inc create mode 100644 controllers/ErrorController.inc create mode 100644 controllers/FaultController.inc create mode 100644 controllers/HtmlController.inc create mode 100644 controllers/HtmlmailController.inc create mode 100644 controllers/IntroductionController.inc create mode 100644 controllers/LibraryController.inc create mode 100644 controllers/MailController.inc create mode 100644 controllers/MailreceiverController.inc create mode 100644 controllers/MapController.inc create mode 100644 controllers/MediaController.inc create mode 100644 controllers/MenuController.inc create mode 100644 controllers/QuestgroupsController.inc create mode 100644 controllers/QuestgroupshierarchyController.inc create mode 100644 controllers/QuestgroupshierarchypathController.inc create mode 100644 controllers/QuestsController.inc create mode 100644 controllers/SeminariesController.inc create mode 100644 controllers/SeminarybarController.inc create mode 100644 controllers/SeminarymenuController.inc create mode 100644 controllers/TextmailController.inc create mode 100644 controllers/UploadsController.inc create mode 100644 controllers/UserrolesController.inc create mode 100644 controllers/UsersController.inc create mode 100644 controllers/XplevelsController.inc create mode 100644 controllers/components/AchievementComponent.inc create mode 100644 controllers/components/AuthComponent.inc create mode 100644 controllers/components/NotificationComponent.inc create mode 100644 controllers/components/QuesttypedataComponent.inc create mode 100644 controllers/components/ValidationComponent.inc create mode 100644 controllers/components/empty create mode 100644 controllers/empty create mode 100644 core/Agent.inc create mode 100644 core/Api.inc create mode 100644 core/Autoloader.inc create mode 100644 core/ClassLoader.inc create mode 100644 core/Component.inc create mode 100644 core/Config.inc create mode 100644 core/Controller.inc create mode 100644 core/Driver.inc create mode 100644 core/Exception.inc create mode 100644 core/Linker.inc create mode 100644 core/Logger.inc create mode 100644 core/Model.inc create mode 100644 core/Request.inc create mode 100644 core/Response.inc create mode 100644 core/View.inc create mode 100644 core/WebUtils.inc create mode 100644 db/create.sql create mode 100644 db/import.sql create mode 100644 db/procedures.sql create mode 100644 db/triggers.sql create mode 100644 doc/.htaccess create mode 100644 doc/classes/PHPMailer.html create mode 100644 doc/classes/SMTP.html create mode 100644 doc/classes/hhu.z.Controller.html create mode 100644 doc/classes/hhu.z.Model.html create mode 100644 doc/classes/hhu.z.TextFormatter.html create mode 100644 doc/classes/hhu.z.Utils.html create mode 100644 doc/classes/hhu.z.agents.QuesttypeAgent.html create mode 100644 doc/classes/hhu.z.agents.ToplevelAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.MailreceiverAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.MenuAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.QuestgroupshierarchypathAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.SeminarybarAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.SeminarymenuAgent.html create mode 100644 doc/classes/hhu.z.agents.bottomlevel.UserrolesAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.AchievementsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.CharactergroupsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.CharactergroupsquestsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.CharactersAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.CharactertypesAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.ErrorAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.IntroductionAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.LibraryAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.MailAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.MediaAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.QuestgroupsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.QuestgroupshierarchyAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.QuestsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.SeminariesAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.UploadsAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.UsersAgent.html create mode 100644 doc/classes/hhu.z.agents.intermediate.XplevelsAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.AjaxAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.BinaryAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.FaultAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.HtmlAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.HtmlmailAgent.html create mode 100644 doc/classes/hhu.z.agents.toplevel.TextmailAgent.html create mode 100644 doc/classes/hhu.z.apis.MailApi.html create mode 100644 doc/classes/hhu.z.controllers.AchievementsController.html create mode 100644 doc/classes/hhu.z.controllers.AjaxController.html create mode 100644 doc/classes/hhu.z.controllers.BinaryController.html create mode 100644 doc/classes/hhu.z.controllers.CharactergroupsController.html create mode 100644 doc/classes/hhu.z.controllers.CharactergroupsquestsController.html create mode 100644 doc/classes/hhu.z.controllers.CharactersController.html create mode 100644 doc/classes/hhu.z.controllers.CharactertypesController.html create mode 100644 doc/classes/hhu.z.controllers.ErrorController.html create mode 100644 doc/classes/hhu.z.controllers.FaultController.html create mode 100644 doc/classes/hhu.z.controllers.HtmlController.html create mode 100644 doc/classes/hhu.z.controllers.HtmlmailController.html create mode 100644 doc/classes/hhu.z.controllers.IntermediateController.html create mode 100644 doc/classes/hhu.z.controllers.IntroductionController.html create mode 100644 doc/classes/hhu.z.controllers.LibraryController.html create mode 100644 doc/classes/hhu.z.controllers.MailController.html create mode 100644 doc/classes/hhu.z.controllers.MailreceiverController.html create mode 100644 doc/classes/hhu.z.controllers.MediaController.html create mode 100644 doc/classes/hhu.z.controllers.MenuController.html create mode 100644 doc/classes/hhu.z.controllers.QuestgroupsController.html create mode 100644 doc/classes/hhu.z.controllers.QuestgroupshierarchyController.html create mode 100644 doc/classes/hhu.z.controllers.QuestgroupshierarchypathController.html create mode 100644 doc/classes/hhu.z.controllers.QuestsController.html create mode 100644 doc/classes/hhu.z.controllers.QuesttypeController.html create mode 100644 doc/classes/hhu.z.controllers.SeminariesController.html create mode 100644 doc/classes/hhu.z.controllers.SeminaryController.html create mode 100644 doc/classes/hhu.z.controllers.SeminarybarController.html create mode 100644 doc/classes/hhu.z.controllers.SeminarymenuController.html create mode 100644 doc/classes/hhu.z.controllers.TextmailController.html create mode 100644 doc/classes/hhu.z.controllers.UploadsController.html create mode 100644 doc/classes/hhu.z.controllers.UserrolesController.html create mode 100644 doc/classes/hhu.z.controllers.UsersController.html create mode 100644 doc/classes/hhu.z.controllers.XplevelsController.html create mode 100644 doc/classes/hhu.z.controllers.components.AchievementComponent.html create mode 100644 doc/classes/hhu.z.controllers.components.AuthComponent.html create mode 100644 doc/classes/hhu.z.controllers.components.NotificationComponent.html create mode 100644 doc/classes/hhu.z.controllers.components.ValidationComponent.html create mode 100644 doc/classes/hhu.z.exceptions.FileUploadException.html create mode 100644 doc/classes/hhu.z.exceptions.MailingException.html create mode 100644 doc/classes/hhu.z.exceptions.MaxFilesizeException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeAgentNotFoundException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeAgentNotValidException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeControllerNotFoundException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeControllerNotValidException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeModelNotFoundException.html create mode 100644 doc/classes/hhu.z.exceptions.QuesttypeModelNotValidException.html create mode 100644 doc/classes/hhu.z.exceptions.SubmissionNotValidException.html create mode 100644 doc/classes/hhu.z.exceptions.WrongFiletypeException.html create mode 100644 doc/classes/hhu.z.lib.PHPMailer.html create mode 100644 doc/classes/hhu.z.lib.PHPMailerAutoload.html create mode 100644 doc/classes/hhu.z.lib.Password.html create mode 100644 doc/classes/hhu.z.lib.SMTP.html create mode 100644 doc/classes/hhu.z.models.AchievementsModel.html create mode 100644 doc/classes/hhu.z.models.AvatarsModel.html create mode 100644 doc/classes/hhu.z.models.CharactergroupsModel.html create mode 100644 doc/classes/hhu.z.models.CharactergroupsquestsModel.html create mode 100644 doc/classes/hhu.z.models.CharacterrolesModel.html create mode 100644 doc/classes/hhu.z.models.CharactersModel.html create mode 100644 doc/classes/hhu.z.models.CharactertypesModel.html create mode 100644 doc/classes/hhu.z.models.MediaModel.html create mode 100644 doc/classes/hhu.z.models.QuestgroupsModel.html create mode 100644 doc/classes/hhu.z.models.QuestgroupshierarchyModel.html create mode 100644 doc/classes/hhu.z.models.QuestgrouptextsModel.html create mode 100644 doc/classes/hhu.z.models.QuestsModel.html create mode 100644 doc/classes/hhu.z.models.QuesttextsModel.html create mode 100644 doc/classes/hhu.z.models.QuesttopicsModel.html create mode 100644 doc/classes/hhu.z.models.QuesttypeModel.html create mode 100644 doc/classes/hhu.z.models.QuesttypesModel.html create mode 100644 doc/classes/hhu.z.models.SeminariesModel.html create mode 100644 doc/classes/hhu.z.models.SeminarycharacterfieldsModel.html create mode 100644 doc/classes/hhu.z.models.UploadsModel.html create mode 100644 doc/classes/hhu.z.models.UserrolesModel.html create mode 100644 doc/classes/hhu.z.models.UsersModel.html create mode 100644 doc/classes/hhu.z.models.XplevelsModel.html create mode 100644 doc/classes/hhu.z.questtypes.BossfightQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.BossfightQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.BossfightQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.ChoiceinputQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.ChoiceinputQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.ChoiceinputQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.CrosswordQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.CrosswordQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.CrosswordQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.DragndropQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.DragndropQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.DragndropQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.MultiplechoiceQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.MultiplechoiceQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.MultiplechoiceQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.SubmitQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.SubmitQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.SubmitQuesttypeModel.html create mode 100644 doc/classes/hhu.z.questtypes.TextinputQuesttypeAgent.html create mode 100644 doc/classes/hhu.z.questtypes.TextinputQuesttypeController.html create mode 100644 doc/classes/hhu.z.questtypes.TextinputQuesttypeModel.html create mode 100644 doc/classes/hhu.z.requests.MailRequest.html create mode 100644 doc/classes/hhu.z.responses.MailResponse.html create mode 100644 doc/classes/hhu.z.views.QuesttypeView.html create mode 100644 doc/classes/nre.agents.BottomlevelAgent.html create mode 100644 doc/classes/nre.agents.IntermediateAgent.html create mode 100644 doc/classes/nre.agents.ToplevelAgent.html create mode 100644 doc/classes/nre.apis.WebApi.html create mode 100644 doc/classes/nre.configs.AppConfig.html create mode 100644 doc/classes/nre.configs.CoreConfig.html create mode 100644 doc/classes/nre.core.Agent.html create mode 100644 doc/classes/nre.core.Api.html create mode 100644 doc/classes/nre.core.Autoloader.html create mode 100644 doc/classes/nre.core.ClassLoader.html create mode 100644 doc/classes/nre.core.Component.html create mode 100644 doc/classes/nre.core.Config.html create mode 100644 doc/classes/nre.core.Controller.html create mode 100644 doc/classes/nre.core.Driver.html create mode 100644 doc/classes/nre.core.Exception.html create mode 100644 doc/classes/nre.core.Linker.html create mode 100644 doc/classes/nre.core.Logger.html create mode 100644 doc/classes/nre.core.Model.html create mode 100644 doc/classes/nre.core.Request.html create mode 100644 doc/classes/nre.core.Response.html create mode 100644 doc/classes/nre.core.View.html create mode 100644 doc/classes/nre.core.WebUtils.html create mode 100644 doc/classes/nre.drivers.DatabaseDriver.html create mode 100644 doc/classes/nre.drivers.MysqliDriver.html create mode 100644 doc/classes/nre.exceptions.AccessDeniedException.html create mode 100644 doc/classes/nre.exceptions.ActionNotFoundException.html create mode 100644 doc/classes/nre.exceptions.AgentNotFoundException.html create mode 100644 doc/classes/nre.exceptions.AgentNotValidException.html create mode 100644 doc/classes/nre.exceptions.ClassNotFoundException.html create mode 100644 doc/classes/nre.exceptions.ClassNotValidException.html create mode 100644 doc/classes/nre.exceptions.ComponentNotFoundException.html create mode 100644 doc/classes/nre.exceptions.ComponentNotValidException.html create mode 100644 doc/classes/nre.exceptions.ControllerNotFoundException.html create mode 100644 doc/classes/nre.exceptions.ControllerNotValidException.html create mode 100644 doc/classes/nre.exceptions.DatamodelException.html create mode 100644 doc/classes/nre.exceptions.DriverNotFoundException.html create mode 100644 doc/classes/nre.exceptions.DriverNotValidException.html create mode 100644 doc/classes/nre.exceptions.FatalDatamodelException.html create mode 100644 doc/classes/nre.exceptions.IdNotFoundException.html create mode 100644 doc/classes/nre.exceptions.LayoutNotFoundException.html create mode 100644 doc/classes/nre.exceptions.LayoutNotValidException.html create mode 100644 doc/classes/nre.exceptions.ModelNotFoundException.html create mode 100644 doc/classes/nre.exceptions.ModelNotValidException.html create mode 100644 doc/classes/nre.exceptions.ParamsNotValidException.html create mode 100644 doc/classes/nre.exceptions.ServiceUnavailableException.html create mode 100644 doc/classes/nre.exceptions.ViewNotFoundException.html create mode 100644 doc/classes/nre.models.DatabaseModel.html create mode 100644 doc/classes/nre.requests.WebRequest.html create mode 100644 doc/classes/nre.responses.WebResponse.html create mode 100644 doc/classes/phpmailerException.html create mode 100644 doc/css/bootstrap-combined.no-icons.min.css create mode 100644 doc/css/font-awesome.min.css create mode 100644 doc/css/jquery.iviewer.css create mode 100644 doc/css/phpdocumentor-clean-icons/Read Me.txt create mode 100644 doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.dev.svg create mode 100644 doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.eot create mode 100644 doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.svg create mode 100644 doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.ttf create mode 100644 doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.woff create mode 100644 doc/css/phpdocumentor-clean-icons/lte-ie7.js create mode 100644 doc/css/phpdocumentor-clean-icons/style.css create mode 100644 doc/css/prism.css create mode 100644 doc/css/template.css create mode 100644 doc/empty create mode 100644 doc/files/agents.BottomlevelAgent.html create mode 100644 doc/files/agents.IntermediateAgent.html create mode 100644 doc/files/agents.ToplevelAgent.html create mode 100644 doc/files/agents.bottomlevel.MailreceiverAgent.html create mode 100644 doc/files/agents.bottomlevel.MenuAgent.html create mode 100644 doc/files/agents.bottomlevel.QuestgroupshierarchypathAgent.html create mode 100644 doc/files/agents.bottomlevel.SeminarybarAgent.html create mode 100644 doc/files/agents.bottomlevel.SeminarymenuAgent.html create mode 100644 doc/files/agents.bottomlevel.UserrolesAgent.html create mode 100644 doc/files/agents.intermediate.AchievementsAgent.html create mode 100644 doc/files/agents.intermediate.CharactergroupsAgent.html create mode 100644 doc/files/agents.intermediate.CharactergroupsquestsAgent.html create mode 100644 doc/files/agents.intermediate.CharactersAgent.html create mode 100644 doc/files/agents.intermediate.CharactertypesAgent.html create mode 100644 doc/files/agents.intermediate.ErrorAgent.html create mode 100644 doc/files/agents.intermediate.IntroductionAgent.html create mode 100644 doc/files/agents.intermediate.LibraryAgent.html create mode 100644 doc/files/agents.intermediate.MailAgent.html create mode 100644 doc/files/agents.intermediate.MediaAgent.html create mode 100644 doc/files/agents.intermediate.QuestgroupsAgent.html create mode 100644 doc/files/agents.intermediate.QuestgroupshierarchyAgent.html create mode 100644 doc/files/agents.intermediate.QuestsAgent.html create mode 100644 doc/files/agents.intermediate.SeminariesAgent.html create mode 100644 doc/files/agents.intermediate.UploadsAgent.html create mode 100644 doc/files/agents.intermediate.UsersAgent.html create mode 100644 doc/files/agents.intermediate.XplevelsAgent.html create mode 100644 doc/files/agents.toplevel.AjaxAgent.html create mode 100644 doc/files/agents.toplevel.BinaryAgent.html create mode 100644 doc/files/agents.toplevel.FaultAgent.html create mode 100644 doc/files/agents.toplevel.HtmlAgent.html create mode 100644 doc/files/agents.toplevel.HtmlmailAgent.html create mode 100644 doc/files/agents.toplevel.TextmailAgent.html create mode 100644 doc/files/agents/BottomlevelAgent.inc.txt create mode 100644 doc/files/agents/IntermediateAgent.inc.txt create mode 100644 doc/files/agents/ToplevelAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/MailreceiverAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/MenuAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/QuestgroupshierarchypathAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/SeminarybarAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/SeminarymenuAgent.inc.txt create mode 100644 doc/files/agents/bottomlevel/UserrolesAgent.inc.txt create mode 100644 doc/files/agents/intermediate/AchievementsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/CharactergroupsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/CharactergroupsquestsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/CharactersAgent.inc.txt create mode 100644 doc/files/agents/intermediate/CharactertypesAgent.inc.txt create mode 100644 doc/files/agents/intermediate/ErrorAgent.inc.txt create mode 100644 doc/files/agents/intermediate/IntroductionAgent.inc.txt create mode 100644 doc/files/agents/intermediate/LibraryAgent.inc.txt create mode 100644 doc/files/agents/intermediate/MailAgent.inc.txt create mode 100644 doc/files/agents/intermediate/MediaAgent.inc.txt create mode 100644 doc/files/agents/intermediate/QuestgroupsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/QuestgroupshierarchyAgent.inc.txt create mode 100644 doc/files/agents/intermediate/QuestsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/SeminariesAgent.inc.txt create mode 100644 doc/files/agents/intermediate/UploadsAgent.inc.txt create mode 100644 doc/files/agents/intermediate/UsersAgent.inc.txt create mode 100644 doc/files/agents/intermediate/XplevelsAgent.inc.txt create mode 100644 doc/files/agents/toplevel/AjaxAgent.inc.txt create mode 100644 doc/files/agents/toplevel/BinaryAgent.inc.txt create mode 100644 doc/files/agents/toplevel/FaultAgent.inc.txt create mode 100644 doc/files/agents/toplevel/HtmlAgent.inc.txt create mode 100644 doc/files/agents/toplevel/HtmlmailAgent.inc.txt create mode 100644 doc/files/agents/toplevel/TextmailAgent.inc.txt create mode 100644 doc/files/apis.WebApi.html create mode 100644 doc/files/apis/WebApi.inc.txt create mode 100644 doc/files/app.Controller.html create mode 100644 doc/files/app.Model.html create mode 100644 doc/files/app.TextFormatter.html create mode 100644 doc/files/app.Utils.html create mode 100644 doc/files/app.agents.QuesttypeAgent.html create mode 100644 doc/files/app.agents.ToplevelAgent.html create mode 100644 doc/files/app.apis.MailApi.html create mode 100644 doc/files/app.controllers.IntermediateController.html create mode 100644 doc/files/app.controllers.QuesttypeController.html create mode 100644 doc/files/app.controllers.SeminaryController.html create mode 100644 doc/files/app.exceptions.FileUploadException.html create mode 100644 doc/files/app.exceptions.MailingException.html create mode 100644 doc/files/app.exceptions.MaxFilesizeException.html create mode 100644 doc/files/app.exceptions.QuesttypeAgentNotFoundException.html create mode 100644 doc/files/app.exceptions.QuesttypeAgentNotValidException.html create mode 100644 doc/files/app.exceptions.QuesttypeControllerNotFoundException.html create mode 100644 doc/files/app.exceptions.QuesttypeControllerNotValidException.html create mode 100644 doc/files/app.exceptions.QuesttypeModelNotFoundException.html create mode 100644 doc/files/app.exceptions.QuesttypeModelNotValidException.html create mode 100644 doc/files/app.exceptions.SubmissionNotValidException.html create mode 100644 doc/files/app.exceptions.WrongFiletypeException.html create mode 100644 doc/files/app.lib.PHPMailer.html create mode 100644 doc/files/app.lib.PHPMailerAutoload.html create mode 100644 doc/files/app.lib.Password.html create mode 100644 doc/files/app.lib.SMTP.html create mode 100644 doc/files/app.models.QuesttypeModel.html create mode 100644 doc/files/app.requests.MailRequest.html create mode 100644 doc/files/app.responses.MailResponse.html create mode 100644 doc/files/app.views.QuesttypeView.html create mode 100644 doc/files/app/Controller.inc.txt create mode 100644 doc/files/app/Model.inc.txt create mode 100644 doc/files/app/TextFormatter.inc.txt create mode 100644 doc/files/app/Utils.inc.txt create mode 100644 doc/files/app/agents/QuesttypeAgent.inc.txt create mode 100644 doc/files/app/agents/ToplevelAgent.inc.txt create mode 100644 doc/files/app/apis/MailApi.inc.txt create mode 100644 doc/files/app/controllers/IntermediateController.inc.txt create mode 100644 doc/files/app/controllers/QuesttypeController.inc.txt create mode 100644 doc/files/app/controllers/SeminaryController.inc.txt create mode 100644 doc/files/app/exceptions/FileUploadException.inc.txt create mode 100644 doc/files/app/exceptions/MailingException.inc.txt create mode 100644 doc/files/app/exceptions/MaxFilesizeException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeAgentNotFoundException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeAgentNotValidException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeControllerNotFoundException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeControllerNotValidException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeModelNotFoundException.inc.txt create mode 100644 doc/files/app/exceptions/QuesttypeModelNotValidException.inc.txt create mode 100644 doc/files/app/exceptions/SubmissionNotValidException.inc.txt create mode 100644 doc/files/app/exceptions/WrongFiletypeException.inc.txt create mode 100644 doc/files/app/lib/PHPMailer.inc.txt create mode 100644 doc/files/app/lib/PHPMailerAutoload.inc.txt create mode 100644 doc/files/app/lib/Password.inc.txt create mode 100644 doc/files/app/lib/SMTP.inc.txt create mode 100644 doc/files/app/models/QuesttypeModel.inc.txt create mode 100644 doc/files/app/requests/MailRequest.inc.txt create mode 100644 doc/files/app/responses/MailResponse.inc.txt create mode 100644 doc/files/app/views/QuesttypeView.inc.txt create mode 100644 doc/files/bootstrap.html create mode 100644 doc/files/bootstrap.inc.txt create mode 100644 doc/files/configs.AppConfig.html create mode 100644 doc/files/configs.CoreConfig.html create mode 100644 doc/files/configs/AppConfig.inc.txt create mode 100644 doc/files/configs/CoreConfig.inc.txt create mode 100644 doc/files/controllers.AchievementsController.html create mode 100644 doc/files/controllers.AjaxController.html create mode 100644 doc/files/controllers.BinaryController.html create mode 100644 doc/files/controllers.CharactergroupsController.html create mode 100644 doc/files/controllers.CharactergroupsquestsController.html create mode 100644 doc/files/controllers.CharactersController.html create mode 100644 doc/files/controllers.CharactertypesController.html create mode 100644 doc/files/controllers.ErrorController.html create mode 100644 doc/files/controllers.FaultController.html create mode 100644 doc/files/controllers.HtmlController.html create mode 100644 doc/files/controllers.HtmlmailController.html create mode 100644 doc/files/controllers.IntroductionController.html create mode 100644 doc/files/controllers.LibraryController.html create mode 100644 doc/files/controllers.MailController.html create mode 100644 doc/files/controllers.MailreceiverController.html create mode 100644 doc/files/controllers.MediaController.html create mode 100644 doc/files/controllers.MenuController.html create mode 100644 doc/files/controllers.QuestgroupsController.html create mode 100644 doc/files/controllers.QuestgroupshierarchyController.html create mode 100644 doc/files/controllers.QuestgroupshierarchypathController.html create mode 100644 doc/files/controllers.QuestsController.html create mode 100644 doc/files/controllers.SeminariesController.html create mode 100644 doc/files/controllers.SeminarybarController.html create mode 100644 doc/files/controllers.SeminarymenuController.html create mode 100644 doc/files/controllers.TextmailController.html create mode 100644 doc/files/controllers.UploadsController.html create mode 100644 doc/files/controllers.UserrolesController.html create mode 100644 doc/files/controllers.UsersController.html create mode 100644 doc/files/controllers.XplevelsController.html create mode 100644 doc/files/controllers.components.AchievementComponent.html create mode 100644 doc/files/controllers.components.AuthComponent.html create mode 100644 doc/files/controllers.components.NotificationComponent.html create mode 100644 doc/files/controllers.components.ValidationComponent.html create mode 100644 doc/files/controllers/AchievementsController.inc.txt create mode 100644 doc/files/controllers/AjaxController.inc.txt create mode 100644 doc/files/controllers/BinaryController.inc.txt create mode 100644 doc/files/controllers/CharactergroupsController.inc.txt create mode 100644 doc/files/controllers/CharactergroupsquestsController.inc.txt create mode 100644 doc/files/controllers/CharactersController.inc.txt create mode 100644 doc/files/controllers/CharactertypesController.inc.txt create mode 100644 doc/files/controllers/ErrorController.inc.txt create mode 100644 doc/files/controllers/FaultController.inc.txt create mode 100644 doc/files/controllers/HtmlController.inc.txt create mode 100644 doc/files/controllers/HtmlmailController.inc.txt create mode 100644 doc/files/controllers/IntroductionController.inc.txt create mode 100644 doc/files/controllers/LibraryController.inc.txt create mode 100644 doc/files/controllers/MailController.inc.txt create mode 100644 doc/files/controllers/MailreceiverController.inc.txt create mode 100644 doc/files/controllers/MediaController.inc.txt create mode 100644 doc/files/controllers/MenuController.inc.txt create mode 100644 doc/files/controllers/QuestgroupsController.inc.txt create mode 100644 doc/files/controllers/QuestgroupshierarchyController.inc.txt create mode 100644 doc/files/controllers/QuestgroupshierarchypathController.inc.txt create mode 100644 doc/files/controllers/QuestsController.inc.txt create mode 100644 doc/files/controllers/SeminariesController.inc.txt create mode 100644 doc/files/controllers/SeminarybarController.inc.txt create mode 100644 doc/files/controllers/SeminarymenuController.inc.txt create mode 100644 doc/files/controllers/TextmailController.inc.txt create mode 100644 doc/files/controllers/UploadsController.inc.txt create mode 100644 doc/files/controllers/UserrolesController.inc.txt create mode 100644 doc/files/controllers/UsersController.inc.txt create mode 100644 doc/files/controllers/XplevelsController.inc.txt create mode 100644 doc/files/controllers/components/AchievementComponent.inc.txt create mode 100644 doc/files/controllers/components/AuthComponent.inc.txt create mode 100644 doc/files/controllers/components/NotificationComponent.inc.txt create mode 100644 doc/files/controllers/components/ValidationComponent.inc.txt create mode 100644 doc/files/core.Agent.html create mode 100644 doc/files/core.Api.html create mode 100644 doc/files/core.Autoloader.html create mode 100644 doc/files/core.ClassLoader.html create mode 100644 doc/files/core.Component.html create mode 100644 doc/files/core.Config.html create mode 100644 doc/files/core.Controller.html create mode 100644 doc/files/core.Driver.html create mode 100644 doc/files/core.Exception.html create mode 100644 doc/files/core.Linker.html create mode 100644 doc/files/core.Logger.html create mode 100644 doc/files/core.Model.html create mode 100644 doc/files/core.Request.html create mode 100644 doc/files/core.Response.html create mode 100644 doc/files/core.View.html create mode 100644 doc/files/core.WebUtils.html create mode 100644 doc/files/core/Agent.inc.txt create mode 100644 doc/files/core/Api.inc.txt create mode 100644 doc/files/core/Autoloader.inc.txt create mode 100644 doc/files/core/ClassLoader.inc.txt create mode 100644 doc/files/core/Component.inc.txt create mode 100644 doc/files/core/Config.inc.txt create mode 100644 doc/files/core/Controller.inc.txt create mode 100644 doc/files/core/Driver.inc.txt create mode 100644 doc/files/core/Exception.inc.txt create mode 100644 doc/files/core/Linker.inc.txt create mode 100644 doc/files/core/Logger.inc.txt create mode 100644 doc/files/core/Model.inc.txt create mode 100644 doc/files/core/Request.inc.txt create mode 100644 doc/files/core/Response.inc.txt create mode 100644 doc/files/core/View.inc.txt create mode 100644 doc/files/core/WebUtils.inc.txt create mode 100644 doc/files/drivers.DatabaseDriver.html create mode 100644 doc/files/drivers.MysqliDriver.html create mode 100644 doc/files/drivers/DatabaseDriver.inc.txt create mode 100644 doc/files/drivers/MysqliDriver.inc.txt create mode 100644 doc/files/exceptions.AccessDeniedException.html create mode 100644 doc/files/exceptions.ActionNotFoundException.html create mode 100644 doc/files/exceptions.AgentNotFoundException.html create mode 100644 doc/files/exceptions.AgentNotValidException.html create mode 100644 doc/files/exceptions.ClassNotFoundException.html create mode 100644 doc/files/exceptions.ClassNotValidException.html create mode 100644 doc/files/exceptions.ComponentNotFoundException.html create mode 100644 doc/files/exceptions.ComponentNotValidException.html create mode 100644 doc/files/exceptions.ControllerNotFoundException.html create mode 100644 doc/files/exceptions.ControllerNotValidException.html create mode 100644 doc/files/exceptions.DatamodelException.html create mode 100644 doc/files/exceptions.DriverNotFoundException.html create mode 100644 doc/files/exceptions.DriverNotValidException.html create mode 100644 doc/files/exceptions.FatalDatamodelException.html create mode 100644 doc/files/exceptions.IdNotFoundException.html create mode 100644 doc/files/exceptions.LayoutNotFoundException.html create mode 100644 doc/files/exceptions.LayoutNotValidException.html create mode 100644 doc/files/exceptions.ModelNotFoundException.html create mode 100644 doc/files/exceptions.ModelNotValidException.html create mode 100644 doc/files/exceptions.ParamsNotValidException.html create mode 100644 doc/files/exceptions.ServiceUnavailableException.html create mode 100644 doc/files/exceptions.ViewNotFoundException.html create mode 100644 doc/files/exceptions/AccessDeniedException.inc.txt create mode 100644 doc/files/exceptions/ActionNotFoundException.inc.txt create mode 100644 doc/files/exceptions/AgentNotFoundException.inc.txt create mode 100644 doc/files/exceptions/AgentNotValidException.inc.txt create mode 100644 doc/files/exceptions/ClassNotFoundException.inc.txt create mode 100644 doc/files/exceptions/ClassNotValidException.inc.txt create mode 100644 doc/files/exceptions/ComponentNotFoundException.inc.txt create mode 100644 doc/files/exceptions/ComponentNotValidException.inc.txt create mode 100644 doc/files/exceptions/ControllerNotFoundException.inc.txt create mode 100644 doc/files/exceptions/ControllerNotValidException.inc.txt create mode 100644 doc/files/exceptions/DatamodelException.inc.txt create mode 100644 doc/files/exceptions/DriverNotFoundException.inc.txt create mode 100644 doc/files/exceptions/DriverNotValidException.inc.txt create mode 100644 doc/files/exceptions/FatalDatamodelException.inc.txt create mode 100644 doc/files/exceptions/IdNotFoundException.inc.txt create mode 100644 doc/files/exceptions/LayoutNotFoundException.inc.txt create mode 100644 doc/files/exceptions/LayoutNotValidException.inc.txt create mode 100644 doc/files/exceptions/ModelNotFoundException.inc.txt create mode 100644 doc/files/exceptions/ModelNotValidException.inc.txt create mode 100644 doc/files/exceptions/ParamsNotValidException.inc.txt create mode 100644 doc/files/exceptions/ServiceUnavailableException.inc.txt create mode 100644 doc/files/exceptions/ViewNotFoundException.inc.txt create mode 100644 doc/files/models.AchievementsModel.html create mode 100644 doc/files/models.AvatarsModel.html create mode 100644 doc/files/models.CharactergroupsModel.html create mode 100644 doc/files/models.CharactergroupsquestsModel.html create mode 100644 doc/files/models.CharacterrolesModel.html create mode 100644 doc/files/models.CharactersModel.html create mode 100644 doc/files/models.CharactertypesModel.html create mode 100644 doc/files/models.DatabaseModel.html create mode 100644 doc/files/models.MediaModel.html create mode 100644 doc/files/models.QuestgroupsModel.html create mode 100644 doc/files/models.QuestgroupshierarchyModel.html create mode 100644 doc/files/models.QuestgrouptextsModel.html create mode 100644 doc/files/models.QuestsModel.html create mode 100644 doc/files/models.QuesttextsModel.html create mode 100644 doc/files/models.QuesttopicsModel.html create mode 100644 doc/files/models.QuesttypesModel.html create mode 100644 doc/files/models.SeminariesModel.html create mode 100644 doc/files/models.SeminarycharacterfieldsModel.html create mode 100644 doc/files/models.UploadsModel.html create mode 100644 doc/files/models.UserrolesModel.html create mode 100644 doc/files/models.UsersModel.html create mode 100644 doc/files/models.XplevelsModel.html create mode 100644 doc/files/models/AchievementsModel.inc.txt create mode 100644 doc/files/models/AvatarsModel.inc.txt create mode 100644 doc/files/models/CharactergroupsModel.inc.txt create mode 100644 doc/files/models/CharactergroupsquestsModel.inc.txt create mode 100644 doc/files/models/CharacterrolesModel.inc.txt create mode 100644 doc/files/models/CharactersModel.inc.txt create mode 100644 doc/files/models/CharactertypesModel.inc.txt create mode 100644 doc/files/models/DatabaseModel.inc.txt create mode 100644 doc/files/models/MediaModel.inc.txt create mode 100644 doc/files/models/QuestgroupsModel.inc.txt create mode 100644 doc/files/models/QuestgroupshierarchyModel.inc.txt create mode 100644 doc/files/models/QuestgrouptextsModel.inc.txt create mode 100644 doc/files/models/QuestsModel.inc.txt create mode 100644 doc/files/models/QuesttextsModel.inc.txt create mode 100644 doc/files/models/QuesttopicsModel.inc.txt create mode 100644 doc/files/models/QuesttypesModel.inc.txt create mode 100644 doc/files/models/SeminariesModel.inc.txt create mode 100644 doc/files/models/SeminarycharacterfieldsModel.inc.txt create mode 100644 doc/files/models/UploadsModel.inc.txt create mode 100644 doc/files/models/UserrolesModel.inc.txt create mode 100644 doc/files/models/UsersModel.inc.txt create mode 100644 doc/files/models/XplevelsModel.inc.txt create mode 100644 doc/files/questtypes.bossfight.BossfightQuesttypeAgent.html create mode 100644 doc/files/questtypes.bossfight.BossfightQuesttypeController.html create mode 100644 doc/files/questtypes.bossfight.BossfightQuesttypeModel.html create mode 100644 doc/files/questtypes.choiceinput.ChoiceinputQuesttypeAgent.html create mode 100644 doc/files/questtypes.choiceinput.ChoiceinputQuesttypeController.html create mode 100644 doc/files/questtypes.choiceinput.ChoiceinputQuesttypeModel.html create mode 100644 doc/files/questtypes.crossword.CrosswordQuesttypeAgent.html create mode 100644 doc/files/questtypes.crossword.CrosswordQuesttypeController.html create mode 100644 doc/files/questtypes.crossword.CrosswordQuesttypeModel.html create mode 100644 doc/files/questtypes.dragndrop.DragndropQuesttypeAgent.html create mode 100644 doc/files/questtypes.dragndrop.DragndropQuesttypeController.html create mode 100644 doc/files/questtypes.dragndrop.DragndropQuesttypeModel.html create mode 100644 doc/files/questtypes.multiplechoice.MultiplechoiceQuesttypeAgent.html create mode 100644 doc/files/questtypes.multiplechoice.MultiplechoiceQuesttypeController.html create mode 100644 doc/files/questtypes.multiplechoice.MultiplechoiceQuesttypeModel.html create mode 100644 doc/files/questtypes.submit.SubmitQuesttypeAgent.html create mode 100644 doc/files/questtypes.submit.SubmitQuesttypeController.html create mode 100644 doc/files/questtypes.submit.SubmitQuesttypeModel.html create mode 100644 doc/files/questtypes.textinput.TextinputQuesttypeAgent.html create mode 100644 doc/files/questtypes.textinput.TextinputQuesttypeController.html create mode 100644 doc/files/questtypes.textinput.TextinputQuesttypeModel.html create mode 100644 doc/files/questtypes/bossfight/BossfightQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/bossfight/BossfightQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/bossfight/BossfightQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/choiceinput/ChoiceinputQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/choiceinput/ChoiceinputQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/choiceinput/ChoiceinputQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/crossword/CrosswordQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/crossword/CrosswordQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/crossword/CrosswordQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/dragndrop/DragndropQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/dragndrop/DragndropQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/dragndrop/DragndropQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/multiplechoice/MultiplechoiceQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/multiplechoice/MultiplechoiceQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/submit/SubmitQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/submit/SubmitQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/submit/SubmitQuesttypeModel.inc.txt create mode 100644 doc/files/questtypes/textinput/TextinputQuesttypeAgent.inc.txt create mode 100644 doc/files/questtypes/textinput/TextinputQuesttypeController.inc.txt create mode 100644 doc/files/questtypes/textinput/TextinputQuesttypeModel.inc.txt create mode 100644 doc/files/requests.WebRequest.html create mode 100644 doc/files/requests/WebRequest.inc.txt create mode 100644 doc/files/responses.WebResponse.html create mode 100644 doc/files/responses/WebResponse.inc.txt create mode 100644 doc/files/www.index.html create mode 100644 doc/files/www/index.php.txt create mode 100644 doc/font/FontAwesome.otf create mode 100644 doc/font/fontawesome-webfont.eot create mode 100644 doc/font/fontawesome-webfont.svg create mode 100644 doc/font/fontawesome-webfont.ttf create mode 100644 doc/font/fontawesome-webfont.woff create mode 100644 doc/graphs/class.html create mode 100644 doc/graphs/classes.svg create mode 100644 doc/images/apple-touch-icon-114x114.png create mode 100644 doc/images/apple-touch-icon-72x72.png create mode 100644 doc/images/apple-touch-icon.png create mode 100644 doc/images/custom-icons.svg create mode 100644 doc/images/favicon.ico create mode 100644 doc/images/hierarchy-item.png create mode 100644 doc/images/icon-class-13x13.png create mode 100644 doc/images/icon-class.svg create mode 100644 doc/images/icon-interface-13x13.png create mode 100644 doc/images/icon-interface.svg create mode 100644 doc/images/icon-trait-13x13.png create mode 100644 doc/images/icon-trait.svg create mode 100644 doc/images/iviewer/grab.cur create mode 100644 doc/images/iviewer/hand.cur create mode 100644 doc/images/iviewer/iviewer.rotate_left.png create mode 100644 doc/images/iviewer/iviewer.rotate_right.png create mode 100644 doc/images/iviewer/iviewer.zoom_fit.png create mode 100644 doc/images/iviewer/iviewer.zoom_in.png create mode 100644 doc/images/iviewer/iviewer.zoom_out.png create mode 100644 doc/images/iviewer/iviewer.zoom_zero.png create mode 100644 doc/index.html create mode 100644 doc/js/bootstrap.min.js create mode 100644 doc/js/html5.js create mode 100644 doc/js/jquery-1.11.0.min.js create mode 100644 doc/js/jquery.dotdotdot-1.5.9.js create mode 100644 doc/js/jquery.dotdotdot-1.5.9.min.js create mode 100644 doc/js/jquery.iviewer.js create mode 100644 doc/js/jquery.iviewer.min.js create mode 100644 doc/js/jquery.mousewheel.js create mode 100644 doc/js/jquery.smooth-scroll.js create mode 100644 doc/js/prism.min.js create mode 100644 doc/js/ui/1.10.4/jquery-ui.min.js create mode 100644 doc/namespaces/default.html create mode 100644 doc/namespaces/hhu.html create mode 100644 doc/namespaces/hhu.z.agents.bottomlevel.html create mode 100644 doc/namespaces/hhu.z.agents.html create mode 100644 doc/namespaces/hhu.z.agents.intermediate.html create mode 100644 doc/namespaces/hhu.z.agents.toplevel.html create mode 100644 doc/namespaces/hhu.z.apis.html create mode 100644 doc/namespaces/hhu.z.controllers.components.html create mode 100644 doc/namespaces/hhu.z.controllers.html create mode 100644 doc/namespaces/hhu.z.exceptions.html create mode 100644 doc/namespaces/hhu.z.html create mode 100644 doc/namespaces/hhu.z.lib.html create mode 100644 doc/namespaces/hhu.z.models.html create mode 100644 doc/namespaces/hhu.z.questtypes.html create mode 100644 doc/namespaces/hhu.z.requests.html create mode 100644 doc/namespaces/hhu.z.responses.html create mode 100644 doc/namespaces/hhu.z.views.html create mode 100644 doc/namespaces/nre.agents.html create mode 100644 doc/namespaces/nre.apis.html create mode 100644 doc/namespaces/nre.configs.html create mode 100644 doc/namespaces/nre.core.html create mode 100644 doc/namespaces/nre.drivers.html create mode 100644 doc/namespaces/nre.exceptions.html create mode 100644 doc/namespaces/nre.html create mode 100644 doc/namespaces/nre.models.html create mode 100644 doc/namespaces/nre.requests.html create mode 100644 doc/namespaces/nre.responses.html create mode 100644 doc/reports/deprecated.html create mode 100644 doc/reports/errors.html create mode 100644 doc/reports/markers.html create mode 100644 drivers/DatabaseDriver.inc create mode 100644 drivers/MysqliDriver.inc create mode 100644 exceptions/AccessDeniedException.inc create mode 100644 exceptions/ActionNotFoundException.inc create mode 100644 exceptions/AgentNotFoundException.inc create mode 100644 exceptions/AgentNotValidException.inc create mode 100644 exceptions/ClassNotFoundException.inc create mode 100644 exceptions/ClassNotValidException.inc create mode 100644 exceptions/ComponentNotFoundException.inc create mode 100644 exceptions/ComponentNotValidException.inc create mode 100644 exceptions/ControllerNotFoundException.inc create mode 100644 exceptions/ControllerNotValidException.inc create mode 100644 exceptions/DatamodelException.inc create mode 100644 exceptions/DriverNotFoundException.inc create mode 100644 exceptions/DriverNotValidException.inc create mode 100644 exceptions/FatalDatamodelException.inc create mode 100644 exceptions/IdNotFoundException.inc create mode 100644 exceptions/LayoutNotFoundException.inc create mode 100644 exceptions/LayoutNotValidException.inc create mode 100644 exceptions/ModelNotFoundException.inc create mode 100644 exceptions/ModelNotValidException.inc create mode 100644 exceptions/ParamsNotValidException.inc create mode 100644 exceptions/ServiceUnavailableException.inc create mode 100644 exceptions/ViewNotFoundException.inc create mode 100644 locale/de_DE/LC_MESSAGES/The Legend of Z.mo create mode 100644 locale/de_DE/LC_MESSAGES/The Legend of Z.po create mode 100644 logs/empty create mode 100644 media/empty create mode 100644 models/AchievementsModel.inc create mode 100644 models/AvatarsModel.inc create mode 100644 models/CharactergroupsModel.inc create mode 100644 models/CharactergroupsquestsModel.inc create mode 100644 models/CharacterrolesModel.inc create mode 100644 models/CharactersModel.inc create mode 100644 models/CharactertypesModel.inc create mode 100644 models/DatabaseModel.inc create mode 100644 models/MapModel.inc create mode 100644 models/MediaModel.inc create mode 100644 models/QuestgroupsModel.inc create mode 100644 models/QuestgroupshierarchyModel.inc create mode 100644 models/QuestgrouptextsModel.inc create mode 100644 models/QuestsModel.inc create mode 100644 models/QuesttextsModel.inc create mode 100644 models/QuesttopicsModel.inc create mode 100644 models/QuesttypesModel.inc create mode 100644 models/SeminariesModel.inc create mode 100644 models/SeminarycharacterfieldsModel.inc create mode 100644 models/UploadsModel.inc create mode 100644 models/UserrolesModel.inc create mode 100644 models/UsersModel.inc create mode 100644 models/XplevelsModel.inc create mode 100644 phpdoc.dist.xml create mode 100644 questtypes/bossfight/BossfightQuesttypeAgent.inc create mode 100644 questtypes/bossfight/BossfightQuesttypeController.inc create mode 100644 questtypes/bossfight/BossfightQuesttypeModel.inc create mode 100644 questtypes/bossfight/html/edittask.tpl create mode 100644 questtypes/bossfight/html/quest.tpl create mode 100644 questtypes/bossfight/html/submission.tpl create mode 100644 questtypes/choiceinput/ChoiceinputQuesttypeAgent.inc create mode 100644 questtypes/choiceinput/ChoiceinputQuesttypeController.inc create mode 100644 questtypes/choiceinput/ChoiceinputQuesttypeModel.inc create mode 100644 questtypes/choiceinput/html/edittask.tpl create mode 100644 questtypes/choiceinput/html/quest.tpl create mode 100644 questtypes/choiceinput/html/submission.tpl create mode 100644 questtypes/crossword/CrosswordQuesttypeAgent.inc create mode 100644 questtypes/crossword/CrosswordQuesttypeController.inc create mode 100644 questtypes/crossword/CrosswordQuesttypeModel.inc create mode 100644 questtypes/crossword/html/edittask.tpl create mode 100644 questtypes/crossword/html/quest.tpl create mode 100644 questtypes/crossword/html/submission.tpl create mode 100644 questtypes/dragndrop/DragndropQuesttypeAgent.inc create mode 100644 questtypes/dragndrop/DragndropQuesttypeController.inc create mode 100644 questtypes/dragndrop/DragndropQuesttypeModel.inc create mode 100644 questtypes/dragndrop/html/edittask.tpl create mode 100644 questtypes/dragndrop/html/quest.tpl create mode 100644 questtypes/dragndrop/html/submission.tpl create mode 100644 questtypes/multiplechoice/MultiplechoiceQuesttypeAgent.inc create mode 100644 questtypes/multiplechoice/MultiplechoiceQuesttypeController.inc create mode 100644 questtypes/multiplechoice/MultiplechoiceQuesttypeModel.inc create mode 100644 questtypes/multiplechoice/html/edittask.tpl create mode 100644 questtypes/multiplechoice/html/quest.tpl create mode 100644 questtypes/multiplechoice/html/submission.tpl create mode 100644 questtypes/submit/SubmitQuesttypeAgent.inc create mode 100644 questtypes/submit/SubmitQuesttypeController.inc create mode 100644 questtypes/submit/SubmitQuesttypeModel.inc create mode 100644 questtypes/submit/html/edittask.tpl create mode 100644 questtypes/submit/html/quest.tpl create mode 100644 questtypes/submit/html/submission.tpl create mode 100644 questtypes/textinput/TextinputQuesttypeAgent.inc create mode 100644 questtypes/textinput/TextinputQuesttypeController.inc create mode 100644 questtypes/textinput/TextinputQuesttypeModel.inc create mode 100644 questtypes/textinput/html/edittask.tpl create mode 100644 questtypes/textinput/html/quest.tpl create mode 100644 questtypes/textinput/html/submission.tpl create mode 100644 requests/WebRequest.inc create mode 100644 responses/WebResponse.inc create mode 100644 seminarymedia/empty create mode 100644 seminaryuploads/empty create mode 100644 tmp/empty create mode 100644 uploads/empty create mode 100644 views/ajax/ajax.tpl create mode 100644 views/ajax/characters/index.tpl create mode 100644 views/ajax/quests/index.tpl create mode 100644 views/ajax/users/index.tpl create mode 100644 views/binary/binary.tpl create mode 100644 views/binary/error/index.tpl create mode 100644 views/binary/media/achievement.tpl create mode 100644 views/binary/media/avatar.tpl create mode 100644 views/binary/media/charactergroup.tpl create mode 100644 views/binary/media/charactergroupsquest.tpl create mode 100644 views/binary/media/index.tpl create mode 100644 views/binary/media/seminary.tpl create mode 100644 views/binary/media/seminarymap.tpl create mode 100644 views/binary/media/seminarymoodpic.tpl create mode 100644 views/binary/uploads/charactergroup.tpl create mode 100644 views/binary/uploads/seminary.tpl create mode 100644 views/error.tpl create mode 100644 views/fault/error/index.tpl create mode 100644 views/fault/fault.tpl create mode 100644 views/html/achievements/conditions.tpl create mode 100644 views/html/achievements/create.tpl create mode 100644 views/html/achievements/delete.tpl create mode 100644 views/html/achievements/edit.tpl create mode 100644 views/html/achievements/index.tpl create mode 100644 views/html/achievements/manage.tpl create mode 100644 views/html/achievements/movedown.tpl create mode 100644 views/html/achievements/moveup.tpl create mode 100644 views/html/charactergroups/creategroup.tpl create mode 100644 views/html/charactergroups/creategroupsgroup.tpl create mode 100644 views/html/charactergroups/deletegroup.tpl create mode 100644 views/html/charactergroups/deletegroupsgroup.tpl create mode 100644 views/html/charactergroups/editgroup.tpl create mode 100644 views/html/charactergroups/editgroupsgroup.tpl create mode 100644 views/html/charactergroups/group.tpl create mode 100644 views/html/charactergroups/groupsgroup.tpl create mode 100644 views/html/charactergroups/index.tpl create mode 100644 views/html/charactergroups/managegroup.tpl create mode 100644 views/html/charactergroupsquests/create.tpl create mode 100644 views/html/charactergroupsquests/delete.tpl create mode 100644 views/html/charactergroupsquests/edit.tpl create mode 100644 views/html/charactergroupsquests/manage.tpl create mode 100644 views/html/charactergroupsquests/quest.tpl create mode 100644 views/html/characters/character.tpl create mode 100644 views/html/characters/delete.tpl create mode 100644 views/html/characters/edit.tpl create mode 100644 views/html/characters/index.tpl create mode 100644 views/html/characters/manage.tpl create mode 100644 views/html/characters/register.tpl create mode 100644 views/html/charactertypes/create.tpl create mode 100644 views/html/charactertypes/delete.tpl create mode 100644 views/html/charactertypes/edit.tpl create mode 100644 views/html/charactertypes/index.tpl create mode 100644 views/html/error/index.tpl create mode 100644 views/html/html.tpl create mode 100644 views/html/introduction/index.tpl create mode 100644 views/html/library/create.tpl create mode 100644 views/html/library/delete.tpl create mode 100644 views/html/library/edit.tpl create mode 100644 views/html/library/index.tpl create mode 100644 views/html/library/manage.tpl create mode 100644 views/html/library/topic.tpl create mode 100644 views/html/map/index.tpl create mode 100644 views/html/menu/index.tpl create mode 100644 views/html/questgroups/create.tpl create mode 100644 views/html/questgroups/delete.tpl create mode 100644 views/html/questgroups/edit.tpl create mode 100644 views/html/questgroups/edittexts.tpl create mode 100644 views/html/questgroups/movedown.tpl create mode 100644 views/html/questgroups/moveup.tpl create mode 100644 views/html/questgroups/questgroup.tpl create mode 100644 views/html/questgroupshierarchy/create.tpl create mode 100644 views/html/questgroupshierarchy/delete.tpl create mode 100644 views/html/questgroupshierarchy/edit.tpl create mode 100644 views/html/questgroupshierarchy/movedown.tpl create mode 100644 views/html/questgroupshierarchy/moveup.tpl create mode 100644 views/html/questgroupshierarchypath/index.tpl create mode 100644 views/html/quests/create.tpl create mode 100644 views/html/quests/delete.tpl create mode 100644 views/html/quests/edit.tpl create mode 100644 views/html/quests/edittask.tpl create mode 100644 views/html/quests/edittexts.tpl create mode 100644 views/html/quests/index.tpl create mode 100644 views/html/quests/quest.tpl create mode 100644 views/html/quests/submission.tpl create mode 100644 views/html/quests/submissions.tpl create mode 100644 views/html/seminaries/calculatexps.tpl create mode 100644 views/html/seminaries/copy.tpl create mode 100644 views/html/seminaries/create.tpl create mode 100644 views/html/seminaries/delete.tpl create mode 100644 views/html/seminaries/edit.tpl create mode 100644 views/html/seminaries/index.tpl create mode 100644 views/html/seminaries/seminary.tpl create mode 100644 views/html/seminarybar/index.tpl create mode 100644 views/html/seminarymenu/index.tpl create mode 100644 views/html/userroles/user.tpl create mode 100644 views/html/users/create.tpl create mode 100644 views/html/users/delete.tpl create mode 100644 views/html/users/edit.tpl create mode 100644 views/html/users/index.tpl create mode 100644 views/html/users/login.tpl create mode 100644 views/html/users/logout.tpl create mode 100644 views/html/users/manage.tpl create mode 100644 views/html/users/register.tpl create mode 100644 views/html/users/user.tpl create mode 100644 views/html/xplevels/manage.tpl create mode 100644 views/htmlmail/htmlmail.tpl create mode 100644 views/htmlmail/mail/characterregistration.tpl create mode 100644 views/htmlmail/mail/charactersubmission.tpl create mode 100644 views/htmlmail/mail/charactersubmissionapproved.tpl create mode 100644 views/htmlmail/mail/userregistration.tpl create mode 100644 views/htmlmail/mailreceiver/index.tpl create mode 100644 views/inlineerror.tpl create mode 100644 views/textmail/mail/characterregistration.tpl create mode 100644 views/textmail/mail/charactersubmission.tpl create mode 100644 views/textmail/mail/charactersubmissionapproved.tpl create mode 100644 views/textmail/mail/userregistration.tpl create mode 100644 views/textmail/mailreceiver/index.tpl create mode 100644 views/textmail/textmail.tpl create mode 100644 www/.htaccess create mode 100644 www/analytics/LEGALNOTICE create mode 100644 www/analytics/README.md create mode 100644 www/analytics/composer.json create mode 100644 www/analytics/composer.lock create mode 100644 www/analytics/config/.htaccess create mode 100644 www/analytics/config/global.ini.php create mode 100644 www/analytics/config/manifest.inc.php create mode 100755 www/analytics/console create mode 100644 www/analytics/core/.htaccess create mode 100644 www/analytics/core/API/DataTableGenericFilter.php create mode 100644 www/analytics/core/API/DataTableManipulator.php create mode 100644 www/analytics/core/API/DataTableManipulator/Flattener.php create mode 100644 www/analytics/core/API/DataTableManipulator/LabelFilter.php create mode 100644 www/analytics/core/API/DataTableManipulator/ReportTotalsCalculator.php create mode 100644 www/analytics/core/API/DocumentationGenerator.php create mode 100644 www/analytics/core/API/Proxy.php create mode 100644 www/analytics/core/API/Request.php create mode 100644 www/analytics/core/API/ResponseBuilder.php create mode 100644 www/analytics/core/Access.php create mode 100644 www/analytics/core/Archive.php create mode 100644 www/analytics/core/Archive/DataCollection.php create mode 100644 www/analytics/core/Archive/DataTableFactory.php create mode 100644 www/analytics/core/Archive/Parameters.php create mode 100644 www/analytics/core/ArchiveProcessor.php create mode 100644 www/analytics/core/ArchiveProcessor/Loader.php create mode 100644 www/analytics/core/ArchiveProcessor/Parameters.php create mode 100644 www/analytics/core/ArchiveProcessor/PluginsArchiver.php create mode 100644 www/analytics/core/ArchiveProcessor/Rules.php create mode 100644 www/analytics/core/AssetManager.php create mode 100644 www/analytics/core/AssetManager/UIAsset.php create mode 100644 www/analytics/core/AssetManager/UIAsset/InMemoryUIAsset.php create mode 100644 www/analytics/core/AssetManager/UIAsset/OnDiskUIAsset.php create mode 100644 www/analytics/core/AssetManager/UIAssetCacheBuster.php create mode 100644 www/analytics/core/AssetManager/UIAssetCatalog.php create mode 100644 www/analytics/core/AssetManager/UIAssetCatalogSorter.php create mode 100644 www/analytics/core/AssetManager/UIAssetFetcher.php create mode 100644 www/analytics/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php create mode 100644 www/analytics/core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php create mode 100644 www/analytics/core/AssetManager/UIAssetFetcher/StylesheetUIAssetFetcher.php create mode 100644 www/analytics/core/AssetManager/UIAssetMerger.php create mode 100644 www/analytics/core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php create mode 100644 www/analytics/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php create mode 100644 www/analytics/core/AssetManager/UIAssetMinifier.php create mode 100644 www/analytics/core/Auth.php create mode 100644 www/analytics/core/CacheFile.php create mode 100644 www/analytics/core/CliMulti.php create mode 100644 www/analytics/core/CliMulti/Output.php create mode 100644 www/analytics/core/CliMulti/Process.php create mode 100644 www/analytics/core/CliMulti/RequestCommand.php create mode 100644 www/analytics/core/Common.php create mode 100644 www/analytics/core/Config.php create mode 100644 www/analytics/core/Console.php create mode 100644 www/analytics/core/Cookie.php create mode 100644 www/analytics/core/CronArchive.php create mode 100644 www/analytics/core/CronArchive/FixedSiteIds.php create mode 100644 www/analytics/core/CronArchive/SharedSiteIds.php create mode 100644 www/analytics/core/DataAccess/ArchiveSelector.php create mode 100644 www/analytics/core/DataAccess/ArchiveTableCreator.php create mode 100644 www/analytics/core/DataAccess/ArchiveWriter.php create mode 100644 www/analytics/core/DataAccess/LogAggregator.php create mode 100644 www/analytics/core/DataArray.php create mode 100644 www/analytics/core/DataFiles/Countries.php create mode 100644 www/analytics/core/DataFiles/Currencies.php create mode 100644 www/analytics/core/DataFiles/LanguageToCountry.php create mode 100644 www/analytics/core/DataFiles/Languages.php create mode 100644 www/analytics/core/DataFiles/Providers.php create mode 100644 www/analytics/core/DataFiles/SearchEngines.php create mode 100755 www/analytics/core/DataFiles/Socials.php create mode 100644 www/analytics/core/DataTable.php create mode 100644 www/analytics/core/DataTable/BaseFilter.php create mode 100644 www/analytics/core/DataTable/Bridges.php create mode 100644 www/analytics/core/DataTable/DataTableInterface.php create mode 100644 www/analytics/core/DataTable/Filter/AddColumnsProcessedMetrics.php create mode 100644 www/analytics/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php create mode 100644 www/analytics/core/DataTable/Filter/AddSummaryRow.php create mode 100644 www/analytics/core/DataTable/Filter/BeautifyRangeLabels.php create mode 100644 www/analytics/core/DataTable/Filter/BeautifyTimeRangeLabels.php create mode 100755 www/analytics/core/DataTable/Filter/CalculateEvolutionFilter.php create mode 100755 www/analytics/core/DataTable/Filter/ColumnCallbackAddColumn.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnCallbackAddColumnPercentage.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnCallbackAddMetadata.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnCallbackDeleteRow.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnCallbackReplace.php create mode 100644 www/analytics/core/DataTable/Filter/ColumnDelete.php create mode 100644 www/analytics/core/DataTable/Filter/ExcludeLowPopulation.php create mode 100755 www/analytics/core/DataTable/Filter/GroupBy.php create mode 100644 www/analytics/core/DataTable/Filter/Limit.php create mode 100644 www/analytics/core/DataTable/Filter/MetadataCallbackAddMetadata.php create mode 100644 www/analytics/core/DataTable/Filter/MetadataCallbackReplace.php create mode 100644 www/analytics/core/DataTable/Filter/Pattern.php create mode 100644 www/analytics/core/DataTable/Filter/PatternRecursive.php create mode 100644 www/analytics/core/DataTable/Filter/RangeCheck.php create mode 100644 www/analytics/core/DataTable/Filter/ReplaceColumnNames.php create mode 100644 www/analytics/core/DataTable/Filter/ReplaceSummaryRowLabel.php create mode 100644 www/analytics/core/DataTable/Filter/SafeDecodeLabel.php create mode 100644 www/analytics/core/DataTable/Filter/Sort.php create mode 100644 www/analytics/core/DataTable/Filter/Truncate.php create mode 100644 www/analytics/core/DataTable/Manager.php create mode 100644 www/analytics/core/DataTable/Map.php create mode 100644 www/analytics/core/DataTable/Renderer.php create mode 100644 www/analytics/core/DataTable/Renderer/Console.php create mode 100644 www/analytics/core/DataTable/Renderer/Csv.php create mode 100644 www/analytics/core/DataTable/Renderer/Html.php create mode 100644 www/analytics/core/DataTable/Renderer/Json.php create mode 100644 www/analytics/core/DataTable/Renderer/Php.php create mode 100644 www/analytics/core/DataTable/Renderer/Rss.php create mode 100644 www/analytics/core/DataTable/Renderer/Tsv.php create mode 100644 www/analytics/core/DataTable/Renderer/Xml.php create mode 100644 www/analytics/core/DataTable/Row.php create mode 100644 www/analytics/core/DataTable/Row/DataTableSummaryRow.php create mode 100644 www/analytics/core/DataTable/Simple.php create mode 100644 www/analytics/core/DataTable/TableNotFoundException.php create mode 100644 www/analytics/core/Date.php create mode 100644 www/analytics/core/Db.php create mode 100644 www/analytics/core/Db/Adapter.php create mode 100644 www/analytics/core/Db/Adapter/Mysqli.php create mode 100644 www/analytics/core/Db/Adapter/Pdo/Mssql.php create mode 100644 www/analytics/core/Db/Adapter/Pdo/Mysql.php create mode 100644 www/analytics/core/Db/Adapter/Pdo/Pgsql.php create mode 100644 www/analytics/core/Db/AdapterInterface.php create mode 100644 www/analytics/core/Db/BatchInsert.php create mode 100644 www/analytics/core/Db/Schema.php create mode 100644 www/analytics/core/Db/Schema/Mysql.php create mode 100644 www/analytics/core/Db/SchemaInterface.php create mode 100644 www/analytics/core/DbHelper.php create mode 100644 www/analytics/core/Error.php create mode 100644 www/analytics/core/EventDispatcher.php create mode 100644 www/analytics/core/ExceptionHandler.php create mode 100644 www/analytics/core/Filechecks.php create mode 100644 www/analytics/core/Filesystem.php create mode 100644 www/analytics/core/FrontController.php create mode 100644 www/analytics/core/Http.php create mode 100644 www/analytics/core/IP.php create mode 100644 www/analytics/core/Loader.php create mode 100644 www/analytics/core/Log.php create mode 100644 www/analytics/core/Mail.php create mode 100644 www/analytics/core/Menu/MenuAbstract.php create mode 100644 www/analytics/core/Menu/MenuAdmin.php create mode 100644 www/analytics/core/Menu/MenuMain.php create mode 100644 www/analytics/core/Menu/MenuTop.php create mode 100644 www/analytics/core/Metrics.php create mode 100644 www/analytics/core/MetricsFormatter.php create mode 100644 www/analytics/core/Nonce.php create mode 100644 www/analytics/core/Notification.php create mode 100644 www/analytics/core/Notification/Manager.php create mode 100644 www/analytics/core/Option.php create mode 100644 www/analytics/core/Period.php create mode 100644 www/analytics/core/Period/Day.php create mode 100644 www/analytics/core/Period/Month.php create mode 100644 www/analytics/core/Period/Range.php create mode 100644 www/analytics/core/Period/Week.php create mode 100644 www/analytics/core/Period/Year.php create mode 100644 www/analytics/core/Piwik.php create mode 100644 www/analytics/core/Plugin.php create mode 100644 www/analytics/core/Plugin/API.php create mode 100644 www/analytics/core/Plugin/Archiver.php create mode 100644 www/analytics/core/Plugin/ConsoleCommand.php create mode 100644 www/analytics/core/Plugin/Controller.php create mode 100644 www/analytics/core/Plugin/ControllerAdmin.php create mode 100644 www/analytics/core/Plugin/Dependency.php create mode 100644 www/analytics/core/Plugin/Manager.php create mode 100644 www/analytics/core/Plugin/MetadataLoader.php create mode 100644 www/analytics/core/Plugin/Settings.php create mode 100644 www/analytics/core/Plugin/ViewDataTable.php create mode 100644 www/analytics/core/Plugin/Visualization.php create mode 100644 www/analytics/core/Profiler.php create mode 100644 www/analytics/core/ProxyHeaders.php create mode 100644 www/analytics/core/ProxyHttp.php create mode 100644 www/analytics/core/QuickForm2.php create mode 100644 www/analytics/core/RankingQuery.php create mode 100644 www/analytics/core/Registry.php create mode 100644 www/analytics/core/ReportRenderer.php create mode 100644 www/analytics/core/ReportRenderer/Csv.php create mode 100644 www/analytics/core/ReportRenderer/Html.php create mode 100644 www/analytics/core/ReportRenderer/Pdf.php create mode 100644 www/analytics/core/ScheduledTask.php create mode 100644 www/analytics/core/ScheduledTaskTimetable.php create mode 100644 www/analytics/core/ScheduledTime.php create mode 100644 www/analytics/core/ScheduledTime/Daily.php create mode 100644 www/analytics/core/ScheduledTime/Hourly.php create mode 100644 www/analytics/core/ScheduledTime/Monthly.php create mode 100644 www/analytics/core/ScheduledTime/Weekly.php create mode 100644 www/analytics/core/Segment.php create mode 100644 www/analytics/core/SegmentExpression.php create mode 100644 www/analytics/core/Session.php create mode 100644 www/analytics/core/Session/SaveHandler/DbTable.php create mode 100644 www/analytics/core/Session/SessionNamespace.php create mode 100644 www/analytics/core/Settings/Manager.php create mode 100644 www/analytics/core/Settings/Setting.php create mode 100644 www/analytics/core/Settings/StorageInterface.php create mode 100644 www/analytics/core/Settings/SystemSetting.php create mode 100644 www/analytics/core/Settings/UserSetting.php create mode 100644 www/analytics/core/SettingsPiwik.php create mode 100644 www/analytics/core/SettingsServer.php create mode 100644 www/analytics/core/Singleton.php create mode 100644 www/analytics/core/Site.php create mode 100644 www/analytics/core/TCPDF.php create mode 100644 www/analytics/core/TaskScheduler.php create mode 100644 www/analytics/core/Theme.php create mode 100644 www/analytics/core/Timer.php create mode 100644 www/analytics/core/Tracker.php create mode 100644 www/analytics/core/Tracker/Action.php create mode 100644 www/analytics/core/Tracker/ActionClickUrl.php create mode 100644 www/analytics/core/Tracker/ActionEvent.php create mode 100644 www/analytics/core/Tracker/ActionPageview.php create mode 100644 www/analytics/core/Tracker/ActionSiteSearch.php create mode 100644 www/analytics/core/Tracker/Cache.php create mode 100644 www/analytics/core/Tracker/Db.php create mode 100644 www/analytics/core/Tracker/Db/DbException.php create mode 100644 www/analytics/core/Tracker/Db/Mysqli.php create mode 100644 www/analytics/core/Tracker/Db/Pdo/Mysql.php create mode 100644 www/analytics/core/Tracker/Db/Pdo/Pgsql.php create mode 100644 www/analytics/core/Tracker/GoalManager.php create mode 100644 www/analytics/core/Tracker/IgnoreCookie.php create mode 100644 www/analytics/core/Tracker/PageUrl.php create mode 100644 www/analytics/core/Tracker/Referrer.php create mode 100644 www/analytics/core/Tracker/Request.php create mode 100644 www/analytics/core/Tracker/TableLogAction.php create mode 100644 www/analytics/core/Tracker/Visit.php create mode 100644 www/analytics/core/Tracker/VisitExcluded.php create mode 100644 www/analytics/core/Tracker/VisitInterface.php create mode 100644 www/analytics/core/Tracker/VisitorNotFoundInDb.php create mode 100644 www/analytics/core/Translate.php create mode 100644 www/analytics/core/Translate/Filter/ByBaseTranslations.php create mode 100644 www/analytics/core/Translate/Filter/ByParameterCount.php create mode 100644 www/analytics/core/Translate/Filter/EmptyTranslations.php create mode 100644 www/analytics/core/Translate/Filter/EncodedEntities.php create mode 100644 www/analytics/core/Translate/Filter/FilterAbstract.php create mode 100644 www/analytics/core/Translate/Filter/UnnecassaryWhitespaces.php create mode 100644 www/analytics/core/Translate/Validate/CoreTranslations.php create mode 100644 www/analytics/core/Translate/Validate/NoScripts.php create mode 100644 www/analytics/core/Translate/Validate/ValidateAbstract.php create mode 100644 www/analytics/core/Translate/Writer.php create mode 100644 www/analytics/core/Twig.php create mode 100644 www/analytics/core/Unzip.php create mode 100755 www/analytics/core/Unzip/Gzip.php create mode 100644 www/analytics/core/Unzip/PclZip.php create mode 100755 www/analytics/core/Unzip/Tar.php create mode 100644 www/analytics/core/Unzip/UncompressInterface.php create mode 100644 www/analytics/core/Unzip/ZipArchive.php create mode 100644 www/analytics/core/UpdateCheck.php create mode 100644 www/analytics/core/Updater.php create mode 100644 www/analytics/core/Updates.php create mode 100644 www/analytics/core/Updates/0.2.10.php create mode 100644 www/analytics/core/Updates/0.2.12.php create mode 100644 www/analytics/core/Updates/0.2.13.php create mode 100644 www/analytics/core/Updates/0.2.24.php create mode 100644 www/analytics/core/Updates/0.2.27.php create mode 100644 www/analytics/core/Updates/0.2.32.php create mode 100644 www/analytics/core/Updates/0.2.33.php create mode 100644 www/analytics/core/Updates/0.2.34.php create mode 100644 www/analytics/core/Updates/0.2.35.php create mode 100644 www/analytics/core/Updates/0.2.37.php create mode 100644 www/analytics/core/Updates/0.4.1.php create mode 100644 www/analytics/core/Updates/0.4.2.php create mode 100644 www/analytics/core/Updates/0.4.4.php create mode 100644 www/analytics/core/Updates/0.4.php create mode 100644 www/analytics/core/Updates/0.5.4.php create mode 100644 www/analytics/core/Updates/0.5.5.php create mode 100644 www/analytics/core/Updates/0.5.php create mode 100644 www/analytics/core/Updates/0.6-rc1.php create mode 100644 www/analytics/core/Updates/0.6.2.php create mode 100644 www/analytics/core/Updates/0.6.3.php create mode 100644 www/analytics/core/Updates/0.7.php create mode 100644 www/analytics/core/Updates/0.9.1.php create mode 100644 www/analytics/core/Updates/1.1.php create mode 100755 www/analytics/core/Updates/1.10-b4.php create mode 100755 www/analytics/core/Updates/1.10.1.php create mode 100755 www/analytics/core/Updates/1.10.2-b1.php create mode 100644 www/analytics/core/Updates/1.10.2-b2.php create mode 100644 www/analytics/core/Updates/1.11-b1.php create mode 100644 www/analytics/core/Updates/1.12-b1.php create mode 100644 www/analytics/core/Updates/1.12-b15.php create mode 100644 www/analytics/core/Updates/1.12-b16.php create mode 100644 www/analytics/core/Updates/1.2-rc1.php create mode 100644 www/analytics/core/Updates/1.2-rc2.php create mode 100644 www/analytics/core/Updates/1.2.3.php create mode 100644 www/analytics/core/Updates/1.2.5-rc1.php create mode 100644 www/analytics/core/Updates/1.2.5-rc7.php create mode 100644 www/analytics/core/Updates/1.4-rc1.php create mode 100644 www/analytics/core/Updates/1.4-rc2.php create mode 100644 www/analytics/core/Updates/1.5-b1.php create mode 100644 www/analytics/core/Updates/1.5-b2.php create mode 100644 www/analytics/core/Updates/1.5-b3.php create mode 100644 www/analytics/core/Updates/1.5-b4.php create mode 100644 www/analytics/core/Updates/1.5-b5.php create mode 100644 www/analytics/core/Updates/1.5-rc6.php create mode 100644 www/analytics/core/Updates/1.6-b1.php create mode 100644 www/analytics/core/Updates/1.6-rc1.php create mode 100644 www/analytics/core/Updates/1.7-b1.php create mode 100644 www/analytics/core/Updates/1.7.2-rc5.php create mode 100755 www/analytics/core/Updates/1.7.2-rc7.php create mode 100644 www/analytics/core/Updates/1.8.3-b1.php create mode 100644 www/analytics/core/Updates/1.8.4-b1.php create mode 100755 www/analytics/core/Updates/1.9-b16.php create mode 100755 www/analytics/core/Updates/1.9-b19.php create mode 100755 www/analytics/core/Updates/1.9-b9.php create mode 100644 www/analytics/core/Updates/1.9.1-b2.php create mode 100755 www/analytics/core/Updates/1.9.3-b10.php create mode 100644 www/analytics/core/Updates/1.9.3-b3.php create mode 100755 www/analytics/core/Updates/1.9.3-b8.php create mode 100644 www/analytics/core/Updates/2.0-a12.php create mode 100644 www/analytics/core/Updates/2.0-a13.php create mode 100644 www/analytics/core/Updates/2.0-a17.php create mode 100644 www/analytics/core/Updates/2.0-a7.php create mode 100644 www/analytics/core/Updates/2.0-b10.php create mode 100644 www/analytics/core/Updates/2.0-b13.php create mode 100644 www/analytics/core/Updates/2.0-b3.php create mode 100644 www/analytics/core/Updates/2.0-b9.php create mode 100644 www/analytics/core/Updates/2.0-rc1.php create mode 100644 www/analytics/core/Updates/2.0.3-b7.php create mode 100644 www/analytics/core/Updates/2.0.4-b5.php create mode 100644 www/analytics/core/Updates/2.0.4-b7.php create mode 100644 www/analytics/core/Updates/2.0.4-b8.php create mode 100644 www/analytics/core/Updates/2.1.1-b11.php create mode 100644 www/analytics/core/Updates/2.2.0-b15.php create mode 100644 www/analytics/core/Url.php create mode 100644 www/analytics/core/UrlHelper.php create mode 100644 www/analytics/core/Version.php create mode 100644 www/analytics/core/View.php create mode 100644 www/analytics/core/View/OneClickDone.php create mode 100644 www/analytics/core/View/RenderTokenParser.php create mode 100644 www/analytics/core/View/ReportsByDimension.php create mode 100644 www/analytics/core/View/UIControl.php create mode 100644 www/analytics/core/View/ViewInterface.php create mode 100644 www/analytics/core/ViewDataTable/Config.php create mode 100644 www/analytics/core/ViewDataTable/Factory.php create mode 100644 www/analytics/core/ViewDataTable/Manager.php create mode 100644 www/analytics/core/ViewDataTable/Request.php create mode 100644 www/analytics/core/ViewDataTable/RequestConfig.php create mode 100644 www/analytics/core/Visualization/Sparkline.php create mode 100644 www/analytics/core/WidgetsList.php create mode 100644 www/analytics/core/dispatch.php create mode 100644 www/analytics/core/testMinimumPhpVersion.php create mode 100644 www/analytics/favicon.ico create mode 100644 www/analytics/index.php create mode 100644 www/analytics/js/.htaccess create mode 100644 www/analytics/js/LICENSE.txt create mode 100644 www/analytics/js/README.md create mode 100644 www/analytics/js/index.php create mode 100644 www/analytics/js/piwik.js create mode 100644 www/analytics/lang/.htaccess create mode 100644 www/analytics/lang/README.md create mode 100644 www/analytics/lang/am.json create mode 100644 www/analytics/lang/ar.json create mode 100644 www/analytics/lang/be.json create mode 100644 www/analytics/lang/bg.json create mode 100644 www/analytics/lang/bn.json create mode 100644 www/analytics/lang/bs.json create mode 100644 www/analytics/lang/ca.json create mode 100644 www/analytics/lang/cs.json create mode 100644 www/analytics/lang/cy.json create mode 100644 www/analytics/lang/da.json create mode 100644 www/analytics/lang/de.json create mode 100644 www/analytics/lang/el.json create mode 100644 www/analytics/lang/en.json create mode 100644 www/analytics/lang/es.json create mode 100644 www/analytics/lang/et.json create mode 100644 www/analytics/lang/eu.json create mode 100644 www/analytics/lang/fa.json create mode 100644 www/analytics/lang/fi.json create mode 100644 www/analytics/lang/fr.json create mode 100644 www/analytics/lang/gl.json create mode 100644 www/analytics/lang/he.json create mode 100644 www/analytics/lang/hi.json create mode 100644 www/analytics/lang/hr.json create mode 100644 www/analytics/lang/hu.json create mode 100644 www/analytics/lang/id.json create mode 100644 www/analytics/lang/is.json create mode 100644 www/analytics/lang/it.json create mode 100644 www/analytics/lang/ja.json create mode 100644 www/analytics/lang/ka.json create mode 100644 www/analytics/lang/ko.json create mode 100644 www/analytics/lang/lt.json create mode 100644 www/analytics/lang/lv.json create mode 100644 www/analytics/lang/nb.json create mode 100644 www/analytics/lang/nl.json create mode 100644 www/analytics/lang/nn.json create mode 100644 www/analytics/lang/pl.json create mode 100644 www/analytics/lang/pt-br.json create mode 100644 www/analytics/lang/pt.json create mode 100644 www/analytics/lang/ro.json create mode 100644 www/analytics/lang/ru.json create mode 100644 www/analytics/lang/sk.json create mode 100644 www/analytics/lang/sl.json create mode 100644 www/analytics/lang/sq.json create mode 100644 www/analytics/lang/sr.json create mode 100644 www/analytics/lang/sv.json create mode 100644 www/analytics/lang/ta.json create mode 100644 www/analytics/lang/te.json create mode 100644 www/analytics/lang/th.json create mode 100644 www/analytics/lang/tr.json create mode 100644 www/analytics/lang/uk.json create mode 100644 www/analytics/lang/vi.json create mode 100644 www/analytics/lang/zh-cn.json create mode 100644 www/analytics/lang/zh-tw.json create mode 100644 www/analytics/libs/.htaccess create mode 100755 www/analytics/libs/Archive_Tar/Tar.php create mode 100644 www/analytics/libs/HTML/Common2.php create mode 100644 www/analytics/libs/HTML/QuickForm2.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Container.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Container/Fieldset.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Container/Group.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Back.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Direct.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Display.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Jump.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Next.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Action/Submit.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/DefaultAction.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/Page.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Controller/SessionContainer.php create mode 100644 www/analytics/libs/HTML/QuickForm2/DataSource.php create mode 100644 www/analytics/libs/HTML/QuickForm2/DataSource/Array.php create mode 100644 www/analytics/libs/HTML/QuickForm2/DataSource/Session.php create mode 100644 www/analytics/libs/HTML/QuickForm2/DataSource/Submit.php create mode 100644 www/analytics/libs/HTML/QuickForm2/DataSource/SuperGlobal.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Button.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Date.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Input.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputButton.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputCheckable.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputCheckbox.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputFile.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputHidden.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputImage.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputPassword.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputRadio.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputReset.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputSubmit.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/InputText.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Select.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Static.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Element/Textarea.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Exception.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Factory.php create mode 100644 www/analytics/libs/HTML/QuickForm2/JavascriptBuilder.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Loader.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Node.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer/Array.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer/Default.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer/Plugin.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer/Proxy.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Renderer/Smarty.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Callback.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Compare.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Each.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Empty.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Length.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/MaxFileSize.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/MimeType.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Nonempty.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/NotCallback.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/NotRegex.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Regex.php create mode 100644 www/analytics/libs/HTML/QuickForm2/Rule/Required.php create mode 100755 www/analytics/libs/MaxMindGeoIP/geoip.inc create mode 100755 www/analytics/libs/MaxMindGeoIP/geoipcity.inc create mode 100755 www/analytics/libs/MaxMindGeoIP/geoipregionvars.php create mode 100644 www/analytics/libs/PEAR.php create mode 100644 www/analytics/libs/PEAR/Exception.php create mode 100644 www/analytics/libs/PEAR/FixPHP5PEARWarnings.php create mode 100644 www/analytics/libs/PEAR/LICENSE create mode 100644 www/analytics/libs/PEAR5.php create mode 100644 www/analytics/libs/PclZip/lgpl-2.1.txt create mode 100644 www/analytics/libs/PclZip/pclzip.lib.php create mode 100644 www/analytics/libs/PiwikTracker/LICENSE.txt create mode 100644 www/analytics/libs/PiwikTracker/PiwikTracker.php create mode 100644 www/analytics/libs/README.md create mode 100644 www/analytics/libs/UserAgentParser/README.md create mode 100644 www/analytics/libs/UserAgentParser/UserAgentParser.php create mode 100644 www/analytics/libs/UserAgentParser/UserAgentParser.test.php create mode 100644 www/analytics/libs/Zend/Cache.php create mode 100644 www/analytics/libs/Zend/Cache/Backend.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Apc.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/BlackHole.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/ExtendedInterface.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/File.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Interface.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Libmemcached.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Memcached.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Sqlite.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Static.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Test.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/TwoLevels.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/WinCache.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/Xcache.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/ZendPlatform.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/ZendServer.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/ZendServer/Disk.php create mode 100644 www/analytics/libs/Zend/Cache/Backend/ZendServer/ShMem.php create mode 100644 www/analytics/libs/Zend/Cache/Core.php create mode 100644 www/analytics/libs/Zend/Cache/Exception.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/Capture.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/Class.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/File.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/Function.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/Output.php create mode 100644 www/analytics/libs/Zend/Cache/Frontend/Page.php create mode 100644 www/analytics/libs/Zend/Cache/Manager.php create mode 100644 www/analytics/libs/Zend/Config.php create mode 100644 www/analytics/libs/Zend/Config/Exception.php create mode 100644 www/analytics/libs/Zend/Config/Ini.php create mode 100755 www/analytics/libs/Zend/Config/Json.php create mode 100644 www/analytics/libs/Zend/Config/Writer.php create mode 100644 www/analytics/libs/Zend/Config/Writer/Array.php create mode 100644 www/analytics/libs/Zend/Config/Writer/FileAbstract.php create mode 100644 www/analytics/libs/Zend/Config/Writer/Ini.php create mode 100755 www/analytics/libs/Zend/Config/Writer/Json.php create mode 100644 www/analytics/libs/Zend/Config/Writer/Xml.php create mode 100755 www/analytics/libs/Zend/Config/Writer/Yaml.php create mode 100644 www/analytics/libs/Zend/Config/Xml.php create mode 100755 www/analytics/libs/Zend/Config/Yaml.php create mode 100644 www/analytics/libs/Zend/Db.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Abstract.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Db2.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Db2/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Mysqli.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Mysqli/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Oracle.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Oracle/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Abstract.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Ibm.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Mssql.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Mysql.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Oci.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Pgsql.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Pdo/Sqlite.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Sqlsrv.php create mode 100644 www/analytics/libs/Zend/Db/Adapter/Sqlsrv/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Expr.php create mode 100644 www/analytics/libs/Zend/Db/Profiler.php create mode 100644 www/analytics/libs/Zend/Db/Profiler/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Profiler/Firebug.php create mode 100644 www/analytics/libs/Zend/Db/Profiler/Query.php create mode 100644 www/analytics/libs/Zend/Db/Select.php create mode 100644 www/analytics/libs/Zend/Db/Select/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Statement.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Db2.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Db2/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Interface.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Mysqli.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Mysqli/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Oracle.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Oracle/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Pdo.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Pdo/Ibm.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Pdo/Oci.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Sqlsrv.php create mode 100644 www/analytics/libs/Zend/Db/Statement/Sqlsrv/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Table.php create mode 100644 www/analytics/libs/Zend/Db/Table/Abstract.php create mode 100644 www/analytics/libs/Zend/Db/Table/Definition.php create mode 100644 www/analytics/libs/Zend/Db/Table/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Table/Row.php create mode 100644 www/analytics/libs/Zend/Db/Table/Row/Abstract.php create mode 100644 www/analytics/libs/Zend/Db/Table/Row/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Table/Rowset.php create mode 100644 www/analytics/libs/Zend/Db/Table/Rowset/Abstract.php create mode 100644 www/analytics/libs/Zend/Db/Table/Rowset/Exception.php create mode 100644 www/analytics/libs/Zend/Db/Table/Select.php create mode 100644 www/analytics/libs/Zend/Db/Table/Select/Exception.php create mode 100644 www/analytics/libs/Zend/Exception.php create mode 100644 www/analytics/libs/Zend/LICENSE.txt create mode 100644 www/analytics/libs/Zend/Mail.php create mode 100644 www/analytics/libs/Zend/Mail/Exception.php create mode 100644 www/analytics/libs/Zend/Mail/Message.php create mode 100644 www/analytics/libs/Zend/Mail/Message/File.php create mode 100644 www/analytics/libs/Zend/Mail/Message/Interface.php create mode 100644 www/analytics/libs/Zend/Mail/Part.php create mode 100644 www/analytics/libs/Zend/Mail/Part/File.php create mode 100644 www/analytics/libs/Zend/Mail/Part/Interface.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Abstract.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Exception.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Imap.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Pop3.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Smtp.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Smtp/Auth/Login.php create mode 100644 www/analytics/libs/Zend/Mail/Protocol/Smtp/Auth/Plain.php create mode 100644 www/analytics/libs/Zend/Mail/Storage.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Abstract.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Exception.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Folder.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Folder/Interface.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Folder/Maildir.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Folder/Mbox.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Imap.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Maildir.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Mbox.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Pop3.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Writable/Interface.php create mode 100644 www/analytics/libs/Zend/Mail/Storage/Writable/Maildir.php create mode 100644 www/analytics/libs/Zend/Mail/Transport/Abstract.php create mode 100644 www/analytics/libs/Zend/Mail/Transport/Exception.php create mode 100644 www/analytics/libs/Zend/Mail/Transport/File.php create mode 100644 www/analytics/libs/Zend/Mail/Transport/Sendmail.php create mode 100644 www/analytics/libs/Zend/Mail/Transport/Smtp.php create mode 100644 www/analytics/libs/Zend/Mime.php create mode 100644 www/analytics/libs/Zend/Mime/Decode.php create mode 100644 www/analytics/libs/Zend/Mime/Exception.php create mode 100644 www/analytics/libs/Zend/Mime/Message.php create mode 100644 www/analytics/libs/Zend/Mime/Part.php create mode 100644 www/analytics/libs/Zend/Registry.php create mode 100644 www/analytics/libs/Zend/Session.php create mode 100644 www/analytics/libs/Zend/Session/Abstract.php create mode 100644 www/analytics/libs/Zend/Session/Exception.php create mode 100644 www/analytics/libs/Zend/Session/Namespace.php create mode 100644 www/analytics/libs/Zend/Session/SaveHandler/DbTable.php create mode 100644 www/analytics/libs/Zend/Session/SaveHandler/Exception.php create mode 100644 www/analytics/libs/Zend/Session/SaveHandler/Interface.php create mode 100644 www/analytics/libs/Zend/Session/Validator/Abstract.php create mode 100644 www/analytics/libs/Zend/Session/Validator/HttpUserAgent.php create mode 100644 www/analytics/libs/Zend/Session/Validator/Interface.php create mode 100644 www/analytics/libs/Zend/Validate.php create mode 100644 www/analytics/libs/Zend/Validate/Abstract.php create mode 100644 www/analytics/libs/Zend/Validate/Alnum.php create mode 100644 www/analytics/libs/Zend/Validate/Alpha.php create mode 100644 www/analytics/libs/Zend/Validate/Between.php create mode 100644 www/analytics/libs/Zend/Validate/Callback.php create mode 100644 www/analytics/libs/Zend/Validate/Ccnum.php create mode 100644 www/analytics/libs/Zend/Validate/CreditCard.php create mode 100644 www/analytics/libs/Zend/Validate/Date.php create mode 100644 www/analytics/libs/Zend/Validate/Digits.php create mode 100644 www/analytics/libs/Zend/Validate/EmailAddress.php create mode 100644 www/analytics/libs/Zend/Validate/Exception.php create mode 100644 www/analytics/libs/Zend/Validate/File/Count.php create mode 100644 www/analytics/libs/Zend/Validate/File/Crc32.php create mode 100644 www/analytics/libs/Zend/Validate/File/ExcludeExtension.php create mode 100644 www/analytics/libs/Zend/Validate/File/ExcludeMimeType.php create mode 100644 www/analytics/libs/Zend/Validate/File/Exists.php create mode 100644 www/analytics/libs/Zend/Validate/File/Extension.php create mode 100644 www/analytics/libs/Zend/Validate/File/FilesSize.php create mode 100644 www/analytics/libs/Zend/Validate/File/Hash.php create mode 100644 www/analytics/libs/Zend/Validate/File/ImageSize.php create mode 100644 www/analytics/libs/Zend/Validate/File/IsCompressed.php create mode 100644 www/analytics/libs/Zend/Validate/File/IsImage.php create mode 100644 www/analytics/libs/Zend/Validate/File/Md5.php create mode 100644 www/analytics/libs/Zend/Validate/File/MimeType.php create mode 100644 www/analytics/libs/Zend/Validate/File/NotExists.php create mode 100644 www/analytics/libs/Zend/Validate/File/Sha1.php create mode 100644 www/analytics/libs/Zend/Validate/File/Size.php create mode 100644 www/analytics/libs/Zend/Validate/File/Upload.php create mode 100644 www/analytics/libs/Zend/Validate/File/WordCount.php create mode 100644 www/analytics/libs/Zend/Validate/Float.php create mode 100644 www/analytics/libs/Zend/Validate/GreaterThan.php create mode 100644 www/analytics/libs/Zend/Validate/Hex.php create mode 100644 www/analytics/libs/Zend/Validate/Hostname.php create mode 100644 www/analytics/libs/Zend/Validate/Hostname/Biz.php create mode 100644 www/analytics/libs/Zend/Validate/Hostname/Cn.php create mode 100644 www/analytics/libs/Zend/Validate/Hostname/Com.php create mode 100644 www/analytics/libs/Zend/Validate/Hostname/Jp.php create mode 100644 www/analytics/libs/Zend/Validate/Iban.php create mode 100644 www/analytics/libs/Zend/Validate/Identical.php create mode 100644 www/analytics/libs/Zend/Validate/InArray.php create mode 100644 www/analytics/libs/Zend/Validate/Int.php create mode 100644 www/analytics/libs/Zend/Validate/Interface.php create mode 100644 www/analytics/libs/Zend/Validate/Ip.php create mode 100644 www/analytics/libs/Zend/Validate/Isbn.php create mode 100644 www/analytics/libs/Zend/Validate/LessThan.php create mode 100644 www/analytics/libs/Zend/Validate/NotEmpty.php create mode 100644 www/analytics/libs/Zend/Validate/PostCode.php create mode 100644 www/analytics/libs/Zend/Validate/Regex.php create mode 100644 www/analytics/libs/Zend/Validate/StringLength.php create mode 100644 www/analytics/libs/Zend/Version.php create mode 100755 www/analytics/libs/angularjs/LICENSE create mode 100755 www/analytics/libs/angularjs/angular-animate.js create mode 100755 www/analytics/libs/angularjs/angular-animate.min.js create mode 100755 www/analytics/libs/angularjs/angular-cookies.js create mode 100755 www/analytics/libs/angularjs/angular-cookies.min.js create mode 100755 www/analytics/libs/angularjs/angular-csp.css create mode 100755 www/analytics/libs/angularjs/angular-loader.js create mode 100755 www/analytics/libs/angularjs/angular-loader.min.js create mode 100755 www/analytics/libs/angularjs/angular-mocks.js create mode 100755 www/analytics/libs/angularjs/angular-resource.js create mode 100755 www/analytics/libs/angularjs/angular-resource.min.js create mode 100755 www/analytics/libs/angularjs/angular-route.js create mode 100755 www/analytics/libs/angularjs/angular-route.min.js create mode 100755 www/analytics/libs/angularjs/angular-sanitize.js create mode 100755 www/analytics/libs/angularjs/angular-sanitize.min.js create mode 100755 www/analytics/libs/angularjs/angular-scenario.js create mode 100755 www/analytics/libs/angularjs/angular-touch.js create mode 100755 www/analytics/libs/angularjs/angular-touch.min.js create mode 100755 www/analytics/libs/angularjs/angular.js create mode 100755 www/analytics/libs/angularjs/angular.min.js create mode 100755 www/analytics/libs/angularjs/errors.json create mode 100755 www/analytics/libs/angularjs/version.json create mode 100755 www/analytics/libs/angularjs/version.txt create mode 100644 www/analytics/libs/html5shiv/html5shiv.js create mode 100644 www/analytics/libs/javascript/json2.js create mode 100644 www/analytics/libs/javascript/sprintf.js create mode 100644 www/analytics/libs/jqplot/MIT-LICENSE.txt create mode 100755 www/analytics/libs/jqplot/build_minified_script.sh create mode 100644 www/analytics/libs/jqplot/excanvas.min.js create mode 100644 www/analytics/libs/jqplot/gpl-2.0.txt create mode 100644 www/analytics/libs/jqplot/jqplot-custom.min.js create mode 100644 www/analytics/libs/jqplot/jqplot.axisLabelRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.axisTickRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.canvasGridRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.core.js create mode 100644 www/analytics/libs/jqplot/jqplot.divTitleRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.linePattern.js create mode 100644 www/analytics/libs/jqplot/jqplot.lineRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.linearAxisRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.markerRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.shadowRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.shapeRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.sprintf.js create mode 100644 www/analytics/libs/jqplot/jqplot.tableLegendRenderer.js create mode 100644 www/analytics/libs/jqplot/jqplot.themeEngine.js create mode 100644 www/analytics/libs/jqplot/plugins/jqplot.barRenderer.js create mode 100644 www/analytics/libs/jqplot/plugins/jqplot.canvasAxisTickRenderer.js create mode 100644 www/analytics/libs/jqplot/plugins/jqplot.canvasTextRenderer.js create mode 100644 www/analytics/libs/jqplot/plugins/jqplot.categoryAxisRenderer.js create mode 100644 www/analytics/libs/jqplot/plugins/jqplot.pieRenderer.js create mode 100644 www/analytics/libs/jquery/LICENSE-sizzle.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-history.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-jquery.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-jqueryui.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-placeholder.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-scrollto.txt create mode 100644 www/analytics/libs/jquery/MIT-LICENSE-smartbanner.txt create mode 100644 www/analytics/libs/jquery/gpl-2.0.txt create mode 100644 www/analytics/libs/jquery/gpl-3.0.txt create mode 100644 www/analytics/libs/jquery/images/down_arrow.png create mode 100644 www/analytics/libs/jquery/images/scroller.png create mode 100644 www/analytics/libs/jquery/images/slide.png create mode 100644 www/analytics/libs/jquery/images/up_arrow.png create mode 100644 www/analytics/libs/jquery/jquery-ui.js create mode 100644 www/analytics/libs/jquery/jquery.browser.js create mode 100644 www/analytics/libs/jquery/jquery.history.js create mode 100644 www/analytics/libs/jquery/jquery.js create mode 100644 www/analytics/libs/jquery/jquery.jscrollpane.js create mode 100644 www/analytics/libs/jquery/jquery.mousewheel.js create mode 100644 www/analytics/libs/jquery/jquery.placeholder.js create mode 100644 www/analytics/libs/jquery/jquery.scrollTo.js create mode 100644 www/analytics/libs/jquery/jquery.smartbanner.js create mode 100644 www/analytics/libs/jquery/jquery.truncate.js create mode 100644 www/analytics/libs/jquery/mwheelIntent.js create mode 100644 www/analytics/libs/jquery/stylesheets/jquery.jscrollpane.css create mode 100644 www/analytics/libs/jquery/stylesheets/jquery.smartbanner.css create mode 100644 www/analytics/libs/jquery/stylesheets/scroll.less create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-anim_basic_16x16.gif create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-icons_222222_256x240.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-icons_2e83ff_256x240.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-icons_454545_256x240.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-icons_888888_256x240.png create mode 100644 www/analytics/libs/jquery/themes/base/images/ui-icons_cd0a0a_256x240.png create mode 100644 www/analytics/libs/jquery/themes/base/jquery-ui.css create mode 100644 www/analytics/libs/pChart2.1.3/GPLv3.txt create mode 100644 www/analytics/libs/pChart2.1.3/change.log create mode 100644 www/analytics/libs/pChart2.1.3/class/pData.class.php create mode 100644 www/analytics/libs/pChart2.1.3/class/pDraw.class.php create mode 100644 www/analytics/libs/pChart2.1.3/class/pImage.class.php create mode 100644 www/analytics/libs/pChart2.1.3/class/pPie.class.php create mode 100644 www/analytics/libs/pChart2.1.3/readme.txt create mode 100644 www/analytics/libs/sparkline/CHANGES create mode 100644 www/analytics/libs/sparkline/DESIGN create mode 100644 www/analytics/libs/sparkline/LICENSE-BSD.txt create mode 100644 www/analytics/libs/sparkline/README create mode 100644 www/analytics/libs/sparkline/gpl-2.0.txt create mode 100644 www/analytics/libs/sparkline/lib/Object.php create mode 100644 www/analytics/libs/sparkline/lib/Sparkline.php create mode 100644 www/analytics/libs/sparkline/lib/Sparkline_Bar.php create mode 100644 www/analytics/libs/sparkline/lib/Sparkline_Line.php create mode 100644 www/analytics/libs/tcpdf/2dbarcodes.php create mode 100644 www/analytics/libs/tcpdf/LICENSE.TXT create mode 100644 www/analytics/libs/tcpdf/README.TXT create mode 100644 www/analytics/libs/tcpdf/barcodes.php create mode 100644 www/analytics/libs/tcpdf/composer.json create mode 100644 www/analytics/libs/tcpdf/config/lang/eng.php create mode 100644 www/analytics/libs/tcpdf/config/tcpdf_config.php create mode 100644 www/analytics/libs/tcpdf/config/tcpdf_config_alt.php create mode 100644 www/analytics/libs/tcpdf/fonts/almohanad.ctg.z create mode 100644 www/analytics/libs/tcpdf/fonts/almohanad.php create mode 100644 www/analytics/libs/tcpdf/fonts/almohanad.z create mode 100644 www/analytics/libs/tcpdf/fonts/dejavusans.ctg.z create mode 100644 www/analytics/libs/tcpdf/fonts/dejavusans.php create mode 100644 www/analytics/libs/tcpdf/fonts/dejavusans.z create mode 100644 www/analytics/libs/tcpdf/fonts/helvetica.php create mode 100644 www/analytics/libs/tcpdf/fonts/helveticab.php create mode 100644 www/analytics/libs/tcpdf/fonts/helveticabi.php create mode 100644 www/analytics/libs/tcpdf/fonts/helveticai.php create mode 100644 www/analytics/libs/tcpdf/fonts/hysmyeongjostdmedium.php create mode 100644 www/analytics/libs/tcpdf/fonts/kozgopromedium.php create mode 100644 www/analytics/libs/tcpdf/fonts/kozminproregular.php create mode 100644 www/analytics/libs/tcpdf/fonts/msungstdlight.php create mode 100644 www/analytics/libs/tcpdf/fonts/stsongstdlight.php create mode 100644 www/analytics/libs/tcpdf/fonts/symbol.php create mode 100644 www/analytics/libs/tcpdf/fonts/times.php create mode 100644 www/analytics/libs/tcpdf/fonts/timesb.php create mode 100644 www/analytics/libs/tcpdf/fonts/timesbi.php create mode 100644 www/analytics/libs/tcpdf/fonts/timesi.php create mode 100644 www/analytics/libs/tcpdf/gpl.txt create mode 100644 www/analytics/libs/tcpdf/htmlcolors.php create mode 100644 www/analytics/libs/tcpdf/include/sRGB.icc create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_colors.php create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_filters.php create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_font_data.php create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_fonts.php create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_images.php create mode 100644 www/analytics/libs/tcpdf/include/tcpdf_static.php create mode 100644 www/analytics/libs/tcpdf/lgpl-3.0.txt create mode 100644 www/analytics/libs/tcpdf/pdf417.php create mode 100644 www/analytics/libs/tcpdf/qrcode.php create mode 100644 www/analytics/libs/tcpdf/spotcolors.php create mode 100644 www/analytics/libs/tcpdf/tcpdf.crt create mode 100644 www/analytics/libs/tcpdf/tcpdf.fdf create mode 100644 www/analytics/libs/tcpdf/tcpdf.p12 create mode 100644 www/analytics/libs/tcpdf/tcpdf.php create mode 100644 www/analytics/libs/tcpdf/tcpdf_autoconfig.php create mode 100644 www/analytics/libs/tcpdf/tcpdf_import.php create mode 100644 www/analytics/libs/tcpdf/tcpdf_parser.php create mode 100644 www/analytics/libs/tcpdf/unicode_data.php create mode 100644 www/analytics/libs/upgradephp/README create mode 100644 www/analytics/libs/upgradephp/upgrade.php create mode 100644 www/analytics/misc/How to install Piwik.html create mode 100644 www/analytics/misc/cron/archive.php create mode 100755 www/analytics/misc/cron/archive.sh create mode 100644 www/analytics/misc/cron/updatetoken.php create mode 100644 www/analytics/misc/gpl-3.0.txt create mode 100644 www/analytics/misc/log-analytics/README.md create mode 100755 www/analytics/misc/log-analytics/import_logs.py create mode 100644 www/analytics/misc/others/ExamplePiwikTracker.php create mode 100644 www/analytics/misc/others/api_internal_call.php create mode 100644 www/analytics/misc/others/api_rest_call.php create mode 100644 www/analytics/misc/others/cli-script-bootstrap.php create mode 100644 www/analytics/misc/others/download-count.txt create mode 100755 www/analytics/misc/others/geoipUpdateRows.php create mode 100644 www/analytics/misc/others/iframeWidget.htm create mode 100644 www/analytics/misc/others/iframeWidget_localhost.php create mode 100644 www/analytics/misc/others/phpstorm-codestyles/Piwik_codestyle.xml create mode 100644 www/analytics/misc/others/phpstorm-codestyles/README.md create mode 100644 www/analytics/misc/others/stress.sh create mode 100644 www/analytics/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php create mode 100644 www/analytics/misc/others/test_generateLotsVisitsWebsites.php create mode 100644 www/analytics/misc/others/tracker_simpleImageTracker.php create mode 100644 www/analytics/misc/others/uninstall-delete-piwik-directory.php create mode 100644 www/analytics/misc/others/widget_example_lastvisits.html create mode 100644 www/analytics/misc/proxy-hide-piwik-url/README.md create mode 100644 www/analytics/misc/proxy-hide-piwik-url/piwik.php create mode 100755 www/analytics/misc/user/.gitkeep create mode 100644 www/analytics/misc/user/.htaccess create mode 100644 www/analytics/misc/user/index.html create mode 100644 www/analytics/piwik.js create mode 100644 www/analytics/piwik.php create mode 100644 www/analytics/plugins/.htaccess create mode 100644 www/analytics/plugins/API/API.php create mode 100644 www/analytics/plugins/API/Controller.php create mode 100644 www/analytics/plugins/API/ProcessedReport.php create mode 100644 www/analytics/plugins/API/RowEvolution.php create mode 100644 www/analytics/plugins/API/stylesheets/listAllAPI.less create mode 100644 www/analytics/plugins/API/templates/listAllAPI.twig create mode 100644 www/analytics/plugins/Actions/API.php create mode 100644 www/analytics/plugins/Actions/Actions.php create mode 100644 www/analytics/plugins/Actions/Archiver.php create mode 100644 www/analytics/plugins/Actions/ArchivingHelper.php create mode 100644 www/analytics/plugins/Actions/Controller.php create mode 100644 www/analytics/plugins/Actions/javascripts/actionsDataTable.js create mode 100644 www/analytics/plugins/Actions/stylesheets/dataTableActions.less create mode 100644 www/analytics/plugins/Actions/templates/indexSiteSearch.twig create mode 100755 www/analytics/plugins/Annotations/API.php create mode 100755 www/analytics/plugins/Annotations/AnnotationList.php create mode 100755 www/analytics/plugins/Annotations/Annotations.php create mode 100755 www/analytics/plugins/Annotations/Controller.php create mode 100755 www/analytics/plugins/Annotations/javascripts/annotations.js create mode 100755 www/analytics/plugins/Annotations/stylesheets/annotations.less create mode 100755 www/analytics/plugins/Annotations/templates/_annotation.twig create mode 100755 www/analytics/plugins/Annotations/templates/_annotationList.twig create mode 100755 www/analytics/plugins/Annotations/templates/getAnnotationManager.twig create mode 100755 www/analytics/plugins/Annotations/templates/getEvolutionIcons.twig create mode 100644 www/analytics/plugins/Annotations/templates/saveAnnotation.twig create mode 100644 www/analytics/plugins/CoreAdminHome/API.php create mode 100644 www/analytics/plugins/CoreAdminHome/Controller.php create mode 100644 www/analytics/plugins/CoreAdminHome/CoreAdminHome.php create mode 100644 www/analytics/plugins/CoreAdminHome/CustomLogo.php create mode 100644 www/analytics/plugins/CoreAdminHome/javascripts/generalSettings.js create mode 100644 www/analytics/plugins/CoreAdminHome/javascripts/jsTrackingGenerator.js create mode 100644 www/analytics/plugins/CoreAdminHome/javascripts/pluginSettings.js create mode 100644 www/analytics/plugins/CoreAdminHome/stylesheets/generalSettings.less create mode 100644 www/analytics/plugins/CoreAdminHome/stylesheets/jsTrackingGenerator.css create mode 100644 www/analytics/plugins/CoreAdminHome/stylesheets/menu.less create mode 100644 www/analytics/plugins/CoreAdminHome/stylesheets/pluginSettings.less create mode 100644 www/analytics/plugins/CoreAdminHome/templates/_menu.twig create mode 100644 www/analytics/plugins/CoreAdminHome/templates/generalSettings.twig create mode 100644 www/analytics/plugins/CoreAdminHome/templates/optOut.twig create mode 100644 www/analytics/plugins/CoreAdminHome/templates/pluginSettings.twig create mode 100644 www/analytics/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig create mode 100644 www/analytics/plugins/CoreConsole/Commands/CodeCoverage.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/CoreArchiver.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateApi.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateCommand.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateController.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GeneratePlugin.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GeneratePluginBase.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateSettings.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateTest.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GitCommit.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GitPull.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/GitPush.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/ManagePlugin.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/ManageTestFiles.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/RunTests.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/RunUITests.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/SetupFixture.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/SyncUITestScreenshots.php create mode 100644 www/analytics/plugins/CoreConsole/Commands/WatchLog.php create mode 100644 www/analytics/plugins/CoreHome/Controller.php create mode 100644 www/analytics/plugins/CoreHome/CoreHome.php create mode 100644 www/analytics/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php create mode 100644 www/analytics/plugins/CoreHome/DataTableRowAction/RowEvolution.php create mode 100644 www/analytics/plugins/CoreHome/angularjs/anchorLinkFix.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/autocomplete-matched_spec.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/dialog.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/directive.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/focusif.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/ignore-click.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/directives/onenter.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/filters/evolution.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/filters/filter.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/filters/startfrom.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/filters/startfrom_spec.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/filters/translate.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/services/piwik-api.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/services/piwik.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/services/piwik_spec.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/common/services/service.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline-directive.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.html create mode 100644 www/analytics/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.less create mode 100644 www/analytics/plugins/CoreHome/angularjs/enrichedheadline/help.png create mode 100644 www/analytics/plugins/CoreHome/angularjs/piwikApp.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/piwikAppConfig.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/siteselector/siteselector-controller.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/siteselector/siteselector-directive.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/siteselector/siteselector-model.js create mode 100644 www/analytics/plugins/CoreHome/angularjs/siteselector/siteselector.html create mode 100644 www/analytics/plugins/CoreHome/angularjs/siteselector/siteselector.less create mode 100644 www/analytics/plugins/CoreHome/images/bg_header.jpg create mode 100644 www/analytics/plugins/CoreHome/images/bullet1.gif create mode 100644 www/analytics/plugins/CoreHome/images/bullet2.gif create mode 100644 www/analytics/plugins/CoreHome/images/favicon.ico create mode 100644 www/analytics/plugins/CoreHome/images/googleplay.png create mode 100644 www/analytics/plugins/CoreHome/images/more.png create mode 100644 www/analytics/plugins/CoreHome/images/more_date.gif create mode 100644 www/analytics/plugins/CoreHome/images/more_period.gif create mode 100755 www/analytics/plugins/CoreHome/images/promo_splash.png create mode 100644 www/analytics/plugins/CoreHome/images/reset_search.png create mode 100644 www/analytics/plugins/CoreHome/images/search.png create mode 100644 www/analytics/plugins/CoreHome/javascripts/broadcast.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/calendar.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/color_manager.js create mode 100755 www/analytics/plugins/CoreHome/javascripts/corehome.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/dataTable.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/dataTable_rowactions.js create mode 100755 www/analytics/plugins/CoreHome/javascripts/donate.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/menu.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/menu_init.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/notification.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/notification_parser.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/popover.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/promo.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/require.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/sparkline.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/top_controls.js create mode 100644 www/analytics/plugins/CoreHome/javascripts/uiControl.js create mode 100755 www/analytics/plugins/CoreHome/stylesheets/_donate.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/cloud.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/color_manager.css create mode 100644 www/analytics/plugins/CoreHome/stylesheets/coreHome.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_dataTable.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_limitSelection.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_reportDocumentation.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_rowActions.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_subDataTable.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/dataTable/_tableConfiguration.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/jqplotColors.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css create mode 100644 www/analytics/plugins/CoreHome/stylesheets/menu.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/notification.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/promo.less create mode 100644 www/analytics/plugins/CoreHome/stylesheets/sparklineColors.less create mode 100644 www/analytics/plugins/CoreHome/templates/ReportRenderer/_htmlReportBody.twig create mode 100644 www/analytics/plugins/CoreHome/templates/ReportRenderer/_htmlReportFooter.twig create mode 100644 www/analytics/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig create mode 100644 www/analytics/plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_dataTable.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_dataTableCell.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_dataTableFooter.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_dataTableHead.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_dataTableJS.twig create mode 100755 www/analytics/plugins/CoreHome/templates/_donate.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_headerMessage.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_indexContent.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_javaScriptDisabled.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_logo.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_menu.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_notifications.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_periodSelect.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_singleReport.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_siteSelectHeader.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_topBar.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_topBarHelloMenu.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_topBarTopMenu.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_topScreen.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_uiControl.twig create mode 100644 www/analytics/plugins/CoreHome/templates/_warningInvalidHost.twig create mode 100644 www/analytics/plugins/CoreHome/templates/checkForUpdates.twig create mode 100644 www/analytics/plugins/CoreHome/templates/getDefaultIndexView.twig create mode 100644 www/analytics/plugins/CoreHome/templates/getDonateForm.twig create mode 100644 www/analytics/plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig create mode 100755 www/analytics/plugins/CoreHome/templates/getPromoVideo.twig create mode 100644 www/analytics/plugins/CoreHome/templates/getRowEvolutionPopover.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/Controller.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/CorePluginsAdmin.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/Marketplace.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/MarketplaceApiClient.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/MarketplaceApiException.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/PluginInstaller.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/PluginInstallerException.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/UpdateCommunication.php create mode 100644 www/analytics/plugins/CorePluginsAdmin/images/plugins.png create mode 100755 www/analytics/plugins/CorePluginsAdmin/images/rating_important.png create mode 100644 www/analytics/plugins/CorePluginsAdmin/images/themes.png create mode 100755 www/analytics/plugins/CorePluginsAdmin/javascripts/pluginDetail.js create mode 100644 www/analytics/plugins/CorePluginsAdmin/javascripts/pluginExtend.js create mode 100644 www/analytics/plugins/CorePluginsAdmin/javascripts/pluginOverview.js create mode 100644 www/analytics/plugins/CorePluginsAdmin/javascripts/plugins.js create mode 100644 www/analytics/plugins/CorePluginsAdmin/stylesheets/marketplace.less create mode 100644 www/analytics/plugins/CorePluginsAdmin/stylesheets/plugins_admin.less create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/browsePlugins.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/browsePluginsActions.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/browseThemes.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/extend.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/installPlugin.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/macros.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/pluginDetails.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/pluginMetadata.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/pluginOverview.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/plugins.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/safemode.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/themeOverview.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/themes.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/updatePlugin.twig create mode 100644 www/analytics/plugins/CorePluginsAdmin/templates/uploadPlugin.twig create mode 100644 www/analytics/plugins/CoreUpdater/Commands/Update.php create mode 100644 www/analytics/plugins/CoreUpdater/Controller.php create mode 100644 www/analytics/plugins/CoreUpdater/CoreUpdater.php create mode 100644 www/analytics/plugins/CoreUpdater/NoUpdatesFoundException.php create mode 100644 www/analytics/plugins/CoreUpdater/UpdateCommunication.php create mode 100644 www/analytics/plugins/CoreUpdater/javascripts/updateLayout.js create mode 100644 www/analytics/plugins/CoreUpdater/stylesheets/updateLayout.css create mode 100644 www/analytics/plugins/CoreUpdater/templates/layout.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/newVersionAvailable.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/oneClickResults.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/runUpdaterAndExit_done_cli.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig create mode 100644 www/analytics/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome_cli.twig create mode 100644 www/analytics/plugins/CoreVisualizations/CoreVisualizations.php create mode 100644 www/analytics/plugins/CoreVisualizations/JqplotDataGenerator.php create mode 100644 www/analytics/plugins/CoreVisualizations/JqplotDataGenerator/Chart.php create mode 100644 www/analytics/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/Cloud.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/Cloud/Config.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/Graph.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/Graph/Config.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/HtmlTable.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/HtmlTable/Config.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/HtmlTable/RequestConfig.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph/Config.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution/Config.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php create mode 100644 www/analytics/plugins/CoreVisualizations/Visualizations/Sparkline.php create mode 100644 www/analytics/plugins/CoreVisualizations/javascripts/jqplot.js create mode 100644 www/analytics/plugins/CoreVisualizations/javascripts/jqplotBarGraph.js create mode 100644 www/analytics/plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js create mode 100644 www/analytics/plugins/CoreVisualizations/javascripts/jqplotPieGraph.js create mode 100644 www/analytics/plugins/CoreVisualizations/javascripts/seriesPicker.js create mode 100644 www/analytics/plugins/CoreVisualizations/stylesheets/dataTableVisualizations.less create mode 100644 www/analytics/plugins/CoreVisualizations/stylesheets/jqplot.css create mode 100644 www/analytics/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig create mode 100644 www/analytics/plugins/CoreVisualizations/templates/_dataTableViz_jqplotGraph.twig create mode 100644 www/analytics/plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig create mode 100644 www/analytics/plugins/CustomVariables/API.php create mode 100644 www/analytics/plugins/CustomVariables/Archiver.php create mode 100644 www/analytics/plugins/CustomVariables/Commands/Info.php create mode 100644 www/analytics/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php create mode 100644 www/analytics/plugins/CustomVariables/Controller.php create mode 100644 www/analytics/plugins/CustomVariables/CustomVariables.php create mode 100644 www/analytics/plugins/CustomVariables/Model.php create mode 100644 www/analytics/plugins/DBStats/.gitignore create mode 100644 www/analytics/plugins/DBStats/API.php create mode 100644 www/analytics/plugins/DBStats/Controller.php create mode 100644 www/analytics/plugins/DBStats/DBStats.php create mode 100644 www/analytics/plugins/DBStats/MySQLMetadataDataAccess.php create mode 100755 www/analytics/plugins/DBStats/MySQLMetadataProvider.php create mode 100644 www/analytics/plugins/DBStats/lang/am.json create mode 100644 www/analytics/plugins/DBStats/lang/ar.json create mode 100644 www/analytics/plugins/DBStats/lang/be.json create mode 100644 www/analytics/plugins/DBStats/lang/bg.json create mode 100644 www/analytics/plugins/DBStats/lang/bn.json create mode 100644 www/analytics/plugins/DBStats/lang/bs.json create mode 100644 www/analytics/plugins/DBStats/lang/ca.json create mode 100644 www/analytics/plugins/DBStats/lang/cs.json create mode 100644 www/analytics/plugins/DBStats/lang/da.json create mode 100644 www/analytics/plugins/DBStats/lang/de.json create mode 100644 www/analytics/plugins/DBStats/lang/el.json create mode 100644 www/analytics/plugins/DBStats/lang/en.json create mode 100644 www/analytics/plugins/DBStats/lang/es.json create mode 100644 www/analytics/plugins/DBStats/lang/et.json create mode 100644 www/analytics/plugins/DBStats/lang/eu.json create mode 100644 www/analytics/plugins/DBStats/lang/fa.json create mode 100644 www/analytics/plugins/DBStats/lang/fi.json create mode 100644 www/analytics/plugins/DBStats/lang/fr.json create mode 100644 www/analytics/plugins/DBStats/lang/he.json create mode 100644 www/analytics/plugins/DBStats/lang/hi.json create mode 100644 www/analytics/plugins/DBStats/lang/hu.json create mode 100644 www/analytics/plugins/DBStats/lang/id.json create mode 100644 www/analytics/plugins/DBStats/lang/is.json create mode 100644 www/analytics/plugins/DBStats/lang/it.json create mode 100644 www/analytics/plugins/DBStats/lang/ja.json create mode 100644 www/analytics/plugins/DBStats/lang/ka.json create mode 100644 www/analytics/plugins/DBStats/lang/ko.json create mode 100644 www/analytics/plugins/DBStats/lang/lt.json create mode 100644 www/analytics/plugins/DBStats/lang/lv.json create mode 100644 www/analytics/plugins/DBStats/lang/nb.json create mode 100644 www/analytics/plugins/DBStats/lang/nl.json create mode 100644 www/analytics/plugins/DBStats/lang/nn.json create mode 100644 www/analytics/plugins/DBStats/lang/pl.json create mode 100644 www/analytics/plugins/DBStats/lang/pt-br.json create mode 100644 www/analytics/plugins/DBStats/lang/pt.json create mode 100644 www/analytics/plugins/DBStats/lang/ro.json create mode 100644 www/analytics/plugins/DBStats/lang/ru.json create mode 100644 www/analytics/plugins/DBStats/lang/sk.json create mode 100644 www/analytics/plugins/DBStats/lang/sl.json create mode 100644 www/analytics/plugins/DBStats/lang/sq.json create mode 100644 www/analytics/plugins/DBStats/lang/sr.json create mode 100644 www/analytics/plugins/DBStats/lang/sv.json create mode 100644 www/analytics/plugins/DBStats/lang/ta.json create mode 100644 www/analytics/plugins/DBStats/lang/te.json create mode 100644 www/analytics/plugins/DBStats/lang/th.json create mode 100644 www/analytics/plugins/DBStats/lang/tr.json create mode 100644 www/analytics/plugins/DBStats/lang/uk.json create mode 100644 www/analytics/plugins/DBStats/lang/vi.json create mode 100644 www/analytics/plugins/DBStats/lang/zh-cn.json create mode 100644 www/analytics/plugins/DBStats/lang/zh-tw.json create mode 100644 www/analytics/plugins/DBStats/stylesheets/dbStatsTable.less create mode 100755 www/analytics/plugins/DBStats/templates/index.twig create mode 100644 www/analytics/plugins/Dashboard/API.php create mode 100644 www/analytics/plugins/Dashboard/Controller.php create mode 100644 www/analytics/plugins/Dashboard/Dashboard.php create mode 100644 www/analytics/plugins/Dashboard/DashboardManagerControl.php create mode 100644 www/analytics/plugins/Dashboard/DashboardSettingsControlBase.php create mode 100644 www/analytics/plugins/Dashboard/javascripts/dashboard.js create mode 100644 www/analytics/plugins/Dashboard/javascripts/dashboardObject.js create mode 100755 www/analytics/plugins/Dashboard/javascripts/dashboardWidget.js create mode 100644 www/analytics/plugins/Dashboard/javascripts/widgetMenu.js create mode 100644 www/analytics/plugins/Dashboard/stylesheets/dashboard.less create mode 100644 www/analytics/plugins/Dashboard/stylesheets/standalone.css create mode 100644 www/analytics/plugins/Dashboard/templates/_dashboardSettings.twig create mode 100644 www/analytics/plugins/Dashboard/templates/_header.twig create mode 100644 www/analytics/plugins/Dashboard/templates/_widgetFactoryTemplate.twig create mode 100644 www/analytics/plugins/Dashboard/templates/embeddedIndex.twig create mode 100644 www/analytics/plugins/Dashboard/templates/index.twig create mode 100644 www/analytics/plugins/DevicesDetection/API.php create mode 100644 www/analytics/plugins/DevicesDetection/Archiver.php create mode 100644 www/analytics/plugins/DevicesDetection/Controller.php create mode 100644 www/analytics/plugins/DevicesDetection/DevicesDetection.php create mode 100644 www/analytics/plugins/DevicesDetection/Updates/1.14.php create mode 100644 www/analytics/plugins/DevicesDetection/functions.php create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Acer.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Alcatel.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Apple.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Archos.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Asus.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Audiovox.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Avvio.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/BangOlufsen.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Becker.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Beetel.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/BenQ.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Cat.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/CnM.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Compal.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/CreNova.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Cricket.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/DMM.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Dell.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Denver.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/DoCoMo.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Ericsson.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Fly.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Gemini.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Google.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Gradiente.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Grundig.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/HP.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/HTC.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Haier.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Huawei.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Humax.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/INQ.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Ikea.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Intek.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Inverto.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Jolla.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/KDDI.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Karbonn.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Kindle.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Kyocera.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/LG.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/LGUPlus.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Lanix.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Lenovo.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Loewe.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Manta_Multimedia.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/MediaTek.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Medion.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Metz.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/MicroMax.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Microsoft.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Mio.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Mitsubishi.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Motorola.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/MyPhone.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/NEC.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/NGM.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Nexian.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Nintendo.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Nokia.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/O2.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/OPPO.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Onda.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Orange.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/PEAQ.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Panasonic.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Pantech.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Philips.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Polaroid.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/PolyPad.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/RIM.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sagem.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Samsung.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sanyo.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sega.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Selevision.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sharp.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Siemens.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Smart.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Softbank.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sony.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Sony_Ericsson.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Spice.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/T-Mobile.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/TCL.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/TechniSat.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/TechnoTrend.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Telefunken.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Telit.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Thomson.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/TiPhone.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Toshiba.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Vertu.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Vestel.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Videocon.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Videoweb.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/ViewSonic.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Voxtel.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Xiaomi.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Yuandao.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/ZTE.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/Zonda.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/eTouch.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/i-mobile.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/brand/unknown.ico create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/camera.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/carbrowser.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/computer.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/console.gif create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/dual.gif create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/mobile.gif create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/normal.gif create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/smartphone.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/tablet.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/tv.png create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/unknown.gif create mode 100644 www/analytics/plugins/DevicesDetection/images/screens/wide.gif create mode 100644 www/analytics/plugins/DevicesDetection/lang/bg.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/cs.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/da.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/de.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/el.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/en.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/es.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/et.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/fa.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/fi.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/fr.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/it.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/ja.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/nb.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/nl.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/pt-br.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/ro.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/ru.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/sr.json create mode 100644 www/analytics/plugins/DevicesDetection/lang/sv.json create mode 100644 www/analytics/plugins/DevicesDetection/templates/detection.twig create mode 100644 www/analytics/plugins/DevicesDetection/templates/index.twig create mode 100644 www/analytics/plugins/DevicesDetection/templates/list.twig create mode 100644 www/analytics/plugins/Events/API.php create mode 100644 www/analytics/plugins/Events/Archiver.php create mode 100644 www/analytics/plugins/Events/Controller.php create mode 100644 www/analytics/plugins/Events/Events.php create mode 100644 www/analytics/plugins/Events/lang/bg.json create mode 100644 www/analytics/plugins/Events/lang/da.json create mode 100644 www/analytics/plugins/Events/lang/de.json create mode 100644 www/analytics/plugins/Events/lang/el.json create mode 100644 www/analytics/plugins/Events/lang/en.json create mode 100644 www/analytics/plugins/Events/lang/es.json create mode 100644 www/analytics/plugins/Events/lang/et.json create mode 100644 www/analytics/plugins/Events/lang/fa.json create mode 100644 www/analytics/plugins/Events/lang/fi.json create mode 100644 www/analytics/plugins/Events/lang/fr.json create mode 100644 www/analytics/plugins/Events/lang/it.json create mode 100644 www/analytics/plugins/Events/lang/ja.json create mode 100644 www/analytics/plugins/Events/lang/nl.json create mode 100644 www/analytics/plugins/Events/lang/pt-br.json create mode 100644 www/analytics/plugins/Events/lang/ro.json create mode 100644 www/analytics/plugins/Events/lang/sr.json create mode 100644 www/analytics/plugins/Events/lang/sv.json create mode 100644 www/analytics/plugins/Events/lang/ta.json create mode 100644 www/analytics/plugins/Events/lang/vi.json create mode 100644 www/analytics/plugins/Events/lang/zh-cn.json create mode 100644 www/analytics/plugins/Events/plugin.json create mode 100644 www/analytics/plugins/Events/templates/index.twig create mode 100644 www/analytics/plugins/ExampleAPI/API.php create mode 100644 www/analytics/plugins/ExampleAPI/ExampleAPI.php create mode 100644 www/analytics/plugins/ExampleAPI/plugin.json create mode 100644 www/analytics/plugins/ExampleCommand/Commands/HelloWorld.php create mode 100644 www/analytics/plugins/ExampleCommand/plugin.json create mode 100644 www/analytics/plugins/ExamplePlugin/.gitignore create mode 100644 www/analytics/plugins/ExamplePlugin/.travis.yml create mode 100644 www/analytics/plugins/ExamplePlugin/API.php create mode 100644 www/analytics/plugins/ExamplePlugin/Controller.php create mode 100644 www/analytics/plugins/ExamplePlugin/ExamplePlugin.php create mode 100644 www/analytics/plugins/ExamplePlugin/README.md create mode 100644 www/analytics/plugins/ExamplePlugin/javascripts/plugin.js create mode 100644 www/analytics/plugins/ExamplePlugin/plugin.json create mode 100644 www/analytics/plugins/ExamplePlugin/screenshots/.gitkeep create mode 100644 www/analytics/plugins/ExamplePlugin/templates/index.twig create mode 100644 www/analytics/plugins/ExampleRssWidget/Controller.php create mode 100644 www/analytics/plugins/ExampleRssWidget/ExampleRssWidget.php create mode 100644 www/analytics/plugins/ExampleRssWidget/RssRenderer.php create mode 100644 www/analytics/plugins/ExampleRssWidget/plugin.json create mode 100644 www/analytics/plugins/ExampleRssWidget/stylesheets/rss.less create mode 100644 www/analytics/plugins/ExampleSettingsPlugin/Settings.php create mode 100644 www/analytics/plugins/ExampleSettingsPlugin/plugin.json create mode 100644 www/analytics/plugins/ExampleTheme/README.md create mode 100644 www/analytics/plugins/ExampleTheme/plugin.json create mode 100644 www/analytics/plugins/ExampleTheme/stylesheets/theme.less create mode 100644 www/analytics/plugins/ExampleUI/API.php create mode 100644 www/analytics/plugins/ExampleUI/Controller.php create mode 100644 www/analytics/plugins/ExampleUI/ExampleUI.php create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/LICENSE create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/earth.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/jupiter.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/mars.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/mercury.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/neptune.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/saturn.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/uranus.png create mode 100644 www/analytics/plugins/ExampleUI/images/icons-planet/venus.png create mode 100644 www/analytics/plugins/ExampleUI/plugin.json create mode 100644 www/analytics/plugins/ExampleUI/templates/evolutiongraph.twig create mode 100644 www/analytics/plugins/ExampleUI/templates/notifications.twig create mode 100644 www/analytics/plugins/ExampleUI/templates/sparklines.twig create mode 100644 www/analytics/plugins/ExampleVisualization/ExampleVisualization.php create mode 100644 www/analytics/plugins/ExampleVisualization/README.md create mode 100644 www/analytics/plugins/ExampleVisualization/SimpleTable.php create mode 100644 www/analytics/plugins/ExampleVisualization/images/table.png create mode 100644 www/analytics/plugins/ExampleVisualization/plugin.json create mode 100644 www/analytics/plugins/ExampleVisualization/templates/simpleTable.twig create mode 100644 www/analytics/plugins/Feedback/API.php create mode 100644 www/analytics/plugins/Feedback/Controller.php create mode 100644 www/analytics/plugins/Feedback/Feedback.php create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/icon_license create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-controller.js create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-directive.js create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-model.js create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature.html create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature.less create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/thumbs-down.png create mode 100644 www/analytics/plugins/Feedback/angularjs/ratefeature/thumbs-up.png create mode 100644 www/analytics/plugins/Feedback/images/facebook.png create mode 100644 www/analytics/plugins/Feedback/images/github.png create mode 100644 www/analytics/plugins/Feedback/images/linkedin.png create mode 100644 www/analytics/plugins/Feedback/images/newsletter.png create mode 100644 www/analytics/plugins/Feedback/images/twitter.png create mode 100644 www/analytics/plugins/Feedback/stylesheets/feedback.less create mode 100644 www/analytics/plugins/Feedback/templates/index.twig create mode 100644 www/analytics/plugins/Goals/API.php create mode 100644 www/analytics/plugins/Goals/Archiver.php create mode 100644 www/analytics/plugins/Goals/Controller.php create mode 100644 www/analytics/plugins/Goals/Goals.php create mode 100644 www/analytics/plugins/Goals/Visualizations/Goals.php create mode 100644 www/analytics/plugins/Goals/javascripts/goalsForm.js create mode 100644 www/analytics/plugins/Goals/stylesheets/goals.css create mode 100644 www/analytics/plugins/Goals/templates/_addEditGoal.twig create mode 100644 www/analytics/plugins/Goals/templates/_formAddGoal.twig create mode 100644 www/analytics/plugins/Goals/templates/_listGoalEdit.twig create mode 100644 www/analytics/plugins/Goals/templates/_listTopDimension.twig create mode 100644 www/analytics/plugins/Goals/templates/_titleAndEvolutionGraph.twig create mode 100644 www/analytics/plugins/Goals/templates/addNewGoal.twig create mode 100644 www/analytics/plugins/Goals/templates/getGoalReportView.twig create mode 100644 www/analytics/plugins/Goals/templates/getOverviewView.twig create mode 100644 www/analytics/plugins/ImageGraph/API.php create mode 100644 www/analytics/plugins/ImageGraph/Controller.php create mode 100644 www/analytics/plugins/ImageGraph/ImageGraph.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/Evolution.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/Exception.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/GridGraph.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/HorizontalBar.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/Pie.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/Pie3D.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/PieGraph.php create mode 100644 www/analytics/plugins/ImageGraph/StaticGraph/VerticalBar.php create mode 100644 www/analytics/plugins/ImageGraph/fonts/tahoma.ttf create mode 100644 www/analytics/plugins/ImageGraph/templates/index.twig create mode 100644 www/analytics/plugins/ImageGraph/templates/testAllSizes.twig create mode 100644 www/analytics/plugins/Insights/API.php create mode 100644 www/analytics/plugins/Insights/Controller.php create mode 100644 www/analytics/plugins/Insights/DataTable/Filter/ExcludeLowValue.php create mode 100644 www/analytics/plugins/Insights/DataTable/Filter/Insight.php create mode 100644 www/analytics/plugins/Insights/DataTable/Filter/Limit.php create mode 100644 www/analytics/plugins/Insights/DataTable/Filter/MinGrowth.php create mode 100644 www/analytics/plugins/Insights/DataTable/Filter/OrderBy.php create mode 100644 www/analytics/plugins/Insights/InsightReport.php create mode 100644 www/analytics/plugins/Insights/Insights.php create mode 100644 www/analytics/plugins/Insights/Model.php create mode 100644 www/analytics/plugins/Insights/Visualizations/Insight.php create mode 100644 www/analytics/plugins/Insights/Visualizations/Insight/RequestConfig.php create mode 100644 www/analytics/plugins/Insights/images/idea.png create mode 100644 www/analytics/plugins/Insights/javascripts/insightsDataTable.js create mode 100644 www/analytics/plugins/Insights/plugin.json create mode 100644 www/analytics/plugins/Insights/stylesheets/insightVisualization.less create mode 100644 www/analytics/plugins/Insights/templates/cannotDisplayReport.twig create mode 100644 www/analytics/plugins/Insights/templates/insightControls.twig create mode 100644 www/analytics/plugins/Insights/templates/insightVisualization.twig create mode 100644 www/analytics/plugins/Insights/templates/insightsOverviewWidget.twig create mode 100644 www/analytics/plugins/Insights/templates/moversAndShakersOverviewWidget.twig create mode 100644 www/analytics/plugins/Insights/templates/overviewWidget.twig create mode 100644 www/analytics/plugins/Insights/templates/table_header.twig create mode 100644 www/analytics/plugins/Insights/templates/table_row.twig create mode 100644 www/analytics/plugins/Installation/Controller.php create mode 100644 www/analytics/plugins/Installation/FormDatabaseSetup.php create mode 100644 www/analytics/plugins/Installation/FormFirstWebsiteSetup.php create mode 100644 www/analytics/plugins/Installation/FormGeneralSetup.php create mode 100644 www/analytics/plugins/Installation/Installation.php create mode 100644 www/analytics/plugins/Installation/ServerFilesGenerator.php create mode 100644 www/analytics/plugins/Installation/View.php create mode 100644 www/analytics/plugins/Installation/javascripts/installation.js create mode 100644 www/analytics/plugins/Installation/stylesheets/installation.css create mode 100755 www/analytics/plugins/Installation/stylesheets/systemCheckPage.less create mode 100644 www/analytics/plugins/Installation/templates/_allSteps.twig create mode 100644 www/analytics/plugins/Installation/templates/_integrityDetails.twig create mode 100644 www/analytics/plugins/Installation/templates/_systemCheckLegend.twig create mode 100755 www/analytics/plugins/Installation/templates/_systemCheckSection.twig create mode 100644 www/analytics/plugins/Installation/templates/databaseCheck.twig create mode 100644 www/analytics/plugins/Installation/templates/databaseSetup.twig create mode 100644 www/analytics/plugins/Installation/templates/finished.twig create mode 100644 www/analytics/plugins/Installation/templates/firstWebsiteSetup.twig create mode 100644 www/analytics/plugins/Installation/templates/generalSetup.twig create mode 100644 www/analytics/plugins/Installation/templates/layout.twig create mode 100644 www/analytics/plugins/Installation/templates/reuseTables.twig create mode 100644 www/analytics/plugins/Installation/templates/systemCheck.twig create mode 100755 www/analytics/plugins/Installation/templates/systemCheckPage.twig create mode 100644 www/analytics/plugins/Installation/templates/tablesCreation.twig create mode 100644 www/analytics/plugins/Installation/templates/trackingCode.twig create mode 100644 www/analytics/plugins/Installation/templates/welcome.twig create mode 100644 www/analytics/plugins/LanguagesManager/API.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/CreatePull.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/FetchFromOTrance.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/LanguageCodes.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/LanguageNames.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/PluginsWithTranslations.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/SetTranslations.php create mode 100644 www/analytics/plugins/LanguagesManager/Commands/Update.php create mode 100644 www/analytics/plugins/LanguagesManager/Controller.php create mode 100644 www/analytics/plugins/LanguagesManager/LanguagesManager.php create mode 100644 www/analytics/plugins/LanguagesManager/javascripts/languageSelector.js create mode 100644 www/analytics/plugins/LanguagesManager/templates/getLanguagesSelector.twig create mode 100644 www/analytics/plugins/LeftMenu/plugin.json create mode 100644 www/analytics/plugins/LeftMenu/stylesheets/theme.less create mode 100644 www/analytics/plugins/Live/API.php create mode 100644 www/analytics/plugins/Live/Controller.php create mode 100644 www/analytics/plugins/Live/Live.php create mode 100644 www/analytics/plugins/Live/Visitor.php create mode 100644 www/analytics/plugins/Live/VisitorLog.php create mode 100644 www/analytics/plugins/Live/images/avatar_frame.png create mode 100644 www/analytics/plugins/Live/images/file0.png create mode 100644 www/analytics/plugins/Live/images/file1.png create mode 100644 www/analytics/plugins/Live/images/file2.png create mode 100644 www/analytics/plugins/Live/images/file3.png create mode 100644 www/analytics/plugins/Live/images/file4.png create mode 100644 www/analytics/plugins/Live/images/file5.png create mode 100644 www/analytics/plugins/Live/images/file6.png create mode 100644 www/analytics/plugins/Live/images/file7.png create mode 100644 www/analytics/plugins/Live/images/file8.png create mode 100644 www/analytics/plugins/Live/images/file9.png create mode 100644 www/analytics/plugins/Live/images/paperclip.png create mode 100644 www/analytics/plugins/Live/images/pause.gif create mode 100644 www/analytics/plugins/Live/images/pause_disabled.gif create mode 100644 www/analytics/plugins/Live/images/play.gif create mode 100644 www/analytics/plugins/Live/images/play_disabled.gif create mode 100644 www/analytics/plugins/Live/images/returningVisitor.gif create mode 100644 www/analytics/plugins/Live/images/unknown_avatar.jpg create mode 100644 www/analytics/plugins/Live/images/visitorProfileLaunch.png create mode 100644 www/analytics/plugins/Live/images/visitor_profile_background.jpg create mode 100644 www/analytics/plugins/Live/images/visitor_profile_close.png create mode 100644 www/analytics/plugins/Live/images/visitor_profile_gradient.png create mode 100644 www/analytics/plugins/Live/javascripts/live.js create mode 100644 www/analytics/plugins/Live/javascripts/visitorLog.js create mode 100644 www/analytics/plugins/Live/javascripts/visitorProfile.js create mode 100644 www/analytics/plugins/Live/stylesheets/live.less create mode 100644 www/analytics/plugins/Live/stylesheets/visitor_profile.less create mode 100644 www/analytics/plugins/Live/templates/_actionsList.twig create mode 100644 www/analytics/plugins/Live/templates/_dataTableViz_visitorLog.twig create mode 100644 www/analytics/plugins/Live/templates/_totalVisitors.twig create mode 100644 www/analytics/plugins/Live/templates/ajaxTotalVisitors.twig create mode 100644 www/analytics/plugins/Live/templates/getLastVisitsStart.twig create mode 100644 www/analytics/plugins/Live/templates/getSimpleLastVisitCount.twig create mode 100644 www/analytics/plugins/Live/templates/getSingleVisitSummary.twig create mode 100644 www/analytics/plugins/Live/templates/getVisitList.twig create mode 100644 www/analytics/plugins/Live/templates/getVisitorProfilePopup.twig create mode 100644 www/analytics/plugins/Live/templates/index.twig create mode 100644 www/analytics/plugins/Live/templates/indexVisitorLog.twig create mode 100644 www/analytics/plugins/Login/Auth.php create mode 100644 www/analytics/plugins/Login/Controller.php create mode 100644 www/analytics/plugins/Login/FormLogin.php create mode 100644 www/analytics/plugins/Login/FormResetPassword.php create mode 100644 www/analytics/plugins/Login/Login.php create mode 100755 www/analytics/plugins/Login/javascripts/login.js create mode 100644 www/analytics/plugins/Login/stylesheets/login.css create mode 100644 www/analytics/plugins/Login/templates/login.twig create mode 100755 www/analytics/plugins/Login/templates/resetPassword.twig create mode 100644 www/analytics/plugins/MobileMessaging/API.php create mode 100644 www/analytics/plugins/MobileMessaging/APIException.php create mode 100644 www/analytics/plugins/MobileMessaging/Controller.php create mode 100644 www/analytics/plugins/MobileMessaging/CountryCallingCodes.php create mode 100644 www/analytics/plugins/MobileMessaging/GSMCharset.php create mode 100644 www/analytics/plugins/MobileMessaging/MobileMessaging.php create mode 100644 www/analytics/plugins/MobileMessaging/ReportRenderer/ReportRendererException.php create mode 100644 www/analytics/plugins/MobileMessaging/ReportRenderer/Sms.php create mode 100644 www/analytics/plugins/MobileMessaging/SMSProvider.php create mode 100644 www/analytics/plugins/MobileMessaging/SMSProvider/Clockwork.php create mode 100644 www/analytics/plugins/MobileMessaging/SMSProvider/StubbedProvider.php create mode 100644 www/analytics/plugins/MobileMessaging/images/Clockwork.png create mode 100644 www/analytics/plugins/MobileMessaging/images/phone.png create mode 100644 www/analytics/plugins/MobileMessaging/javascripts/MobileMessagingSettings.js create mode 100644 www/analytics/plugins/MobileMessaging/stylesheets/MobileMessagingSettings.less create mode 100644 www/analytics/plugins/MobileMessaging/templates/SMSReport.twig create mode 100644 www/analytics/plugins/MobileMessaging/templates/index.twig create mode 100644 www/analytics/plugins/MobileMessaging/templates/reportParametersScheduledReports.twig create mode 100644 www/analytics/plugins/Morpheus/images/add.png create mode 100644 www/analytics/plugins/Morpheus/images/annotations.png create mode 100644 www/analytics/plugins/Morpheus/images/annotations_starred.png create mode 100644 www/analytics/plugins/Morpheus/images/bullet.png create mode 100644 www/analytics/plugins/Morpheus/images/calendar.gif create mode 100644 www/analytics/plugins/Morpheus/images/chart_bar.png create mode 100644 www/analytics/plugins/Morpheus/images/chart_line_edit.png create mode 100644 www/analytics/plugins/Morpheus/images/chart_pie.png create mode 100644 www/analytics/plugins/Morpheus/images/cities.png create mode 100644 www/analytics/plugins/Morpheus/images/close.png create mode 100644 www/analytics/plugins/Morpheus/images/configure-highlight.png create mode 100644 www/analytics/plugins/Morpheus/images/configure.png create mode 100644 www/analytics/plugins/Morpheus/images/datepicker_arr_l.png create mode 100644 www/analytics/plugins/Morpheus/images/datepicker_arr_r.png create mode 100644 www/analytics/plugins/Morpheus/images/export.png create mode 100644 www/analytics/plugins/Morpheus/images/forms-sprite.png create mode 100644 www/analytics/plugins/Morpheus/images/goal.png create mode 100644 www/analytics/plugins/Morpheus/images/help.png create mode 100644 www/analytics/plugins/Morpheus/images/ico_delete.png create mode 100644 www/analytics/plugins/Morpheus/images/ico_edit.png create mode 100644 www/analytics/plugins/Morpheus/images/icon-calendar.gif create mode 100644 www/analytics/plugins/Morpheus/images/image.png create mode 100644 www/analytics/plugins/Morpheus/images/info.png create mode 100644 www/analytics/plugins/Morpheus/images/link.gif create mode 100644 www/analytics/plugins/Morpheus/images/loading-blue.gif create mode 100644 www/analytics/plugins/Morpheus/images/logo-header.png create mode 100644 www/analytics/plugins/Morpheus/images/logo.png create mode 100644 www/analytics/plugins/Morpheus/images/logo.svg create mode 100644 www/analytics/plugins/Morpheus/images/maximise.png create mode 100644 www/analytics/plugins/Morpheus/images/minimise.png create mode 100644 www/analytics/plugins/Morpheus/images/pause.gif create mode 100644 www/analytics/plugins/Morpheus/images/pause_disabled.gif create mode 100644 www/analytics/plugins/Morpheus/images/play.gif create mode 100644 www/analytics/plugins/Morpheus/images/play_disabled.gif create mode 100644 www/analytics/plugins/Morpheus/images/refresh.png create mode 100644 www/analytics/plugins/Morpheus/images/regions.png create mode 100644 www/analytics/plugins/Morpheus/images/search_ico.png create mode 100644 www/analytics/plugins/Morpheus/images/segment-users.png create mode 100644 www/analytics/plugins/Morpheus/images/sort_subtable_desc.png create mode 100644 www/analytics/plugins/Morpheus/images/sortasc.png create mode 100644 www/analytics/plugins/Morpheus/images/sortasc_dark.png create mode 100644 www/analytics/plugins/Morpheus/images/sortdesc.png create mode 100644 www/analytics/plugins/Morpheus/images/sortdesc_dark.png create mode 100644 www/analytics/plugins/Morpheus/images/table.png create mode 100644 www/analytics/plugins/Morpheus/images/table_more.png create mode 100644 www/analytics/plugins/Morpheus/images/tagcloud.png create mode 100644 www/analytics/plugins/Morpheus/images/zoom-out-disabled.png create mode 100644 www/analytics/plugins/Morpheus/images/zoom-out.png create mode 100644 www/analytics/plugins/Morpheus/javascripts/jquery.icheck.min.js create mode 100644 www/analytics/plugins/Morpheus/javascripts/morpheus.js create mode 100644 www/analytics/plugins/Morpheus/plugin.json create mode 100644 www/analytics/plugins/Morpheus/stylesheets/admin.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/charts.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/colors.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/components.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/forms.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/map.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/mixins.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/popups.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/theme.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/tooltip.less create mode 100644 www/analytics/plugins/Morpheus/stylesheets/typography.less create mode 100755 www/analytics/plugins/MultiSites/API.php create mode 100644 www/analytics/plugins/MultiSites/Controller.php create mode 100644 www/analytics/plugins/MultiSites/MultiSites.php create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard-controller.js create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard-directive.js create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard-filter.js create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard-model.js create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard.html create mode 100644 www/analytics/plugins/MultiSites/angularjs/dashboard/dashboard.less create mode 100644 www/analytics/plugins/MultiSites/angularjs/site/site-directive.js create mode 100644 www/analytics/plugins/MultiSites/angularjs/site/site.html create mode 100644 www/analytics/plugins/MultiSites/images/arrow_asc.gif create mode 100644 www/analytics/plugins/MultiSites/images/arrow_desc.gif create mode 100644 www/analytics/plugins/MultiSites/images/arrow_down.png create mode 100644 www/analytics/plugins/MultiSites/images/arrow_down_green.png create mode 100644 www/analytics/plugins/MultiSites/images/arrow_up.png create mode 100644 www/analytics/plugins/MultiSites/images/arrow_up_red.png create mode 100644 www/analytics/plugins/MultiSites/images/door_in.png create mode 100644 www/analytics/plugins/MultiSites/images/link.gif create mode 100644 www/analytics/plugins/MultiSites/images/loading-blue.gif create mode 100644 www/analytics/plugins/MultiSites/images/stop.png create mode 100644 www/analytics/plugins/MultiSites/templates/getSitesInfo.twig create mode 100644 www/analytics/plugins/Overlay/API.php create mode 100644 www/analytics/plugins/Overlay/Controller.php create mode 100644 www/analytics/plugins/Overlay/Overlay.php create mode 100644 www/analytics/plugins/Overlay/client/client.css create mode 100644 www/analytics/plugins/Overlay/client/client.js create mode 100644 www/analytics/plugins/Overlay/client/close.png create mode 100644 www/analytics/plugins/Overlay/client/followingpages.js create mode 100644 www/analytics/plugins/Overlay/client/linktags.eps create mode 100644 www/analytics/plugins/Overlay/client/linktags.png create mode 100644 www/analytics/plugins/Overlay/client/linktags.psd create mode 100644 www/analytics/plugins/Overlay/client/linktags_lessshadow.png create mode 100644 www/analytics/plugins/Overlay/client/linktags_noshadow.png create mode 100644 www/analytics/plugins/Overlay/client/loading.gif create mode 100644 www/analytics/plugins/Overlay/client/translations.js create mode 100644 www/analytics/plugins/Overlay/client/urlnormalizer.js create mode 100644 www/analytics/plugins/Overlay/images/info.png create mode 100755 www/analytics/plugins/Overlay/images/overlay_icon.png create mode 100755 www/analytics/plugins/Overlay/images/overlay_icon_hover.png create mode 100644 www/analytics/plugins/Overlay/javascripts/Overlay_Helper.js create mode 100644 www/analytics/plugins/Overlay/javascripts/Piwik_Overlay.js create mode 100644 www/analytics/plugins/Overlay/javascripts/rowaction.js create mode 100644 www/analytics/plugins/Overlay/stylesheets/overlay.css create mode 100644 www/analytics/plugins/Overlay/stylesheets/showErrorWrongDomain.css create mode 100644 www/analytics/plugins/Overlay/templates/index.twig create mode 100644 www/analytics/plugins/Overlay/templates/index_noframe.twig create mode 100644 www/analytics/plugins/Overlay/templates/notifyParentIframe.twig create mode 100644 www/analytics/plugins/Overlay/templates/renderSidebar.twig create mode 100644 www/analytics/plugins/Overlay/templates/showErrorWrongDomain.twig create mode 100644 www/analytics/plugins/PrivacyManager/Config.php create mode 100644 www/analytics/plugins/PrivacyManager/Controller.php create mode 100644 www/analytics/plugins/PrivacyManager/DoNotTrackHeaderChecker.php create mode 100644 www/analytics/plugins/PrivacyManager/IPAnonymizer.php create mode 100755 www/analytics/plugins/PrivacyManager/LogDataPurger.php create mode 100644 www/analytics/plugins/PrivacyManager/PrivacyManager.php create mode 100755 www/analytics/plugins/PrivacyManager/ReportsPurger.php create mode 100644 www/analytics/plugins/PrivacyManager/javascripts/privacySettings.js create mode 100755 www/analytics/plugins/PrivacyManager/templates/getDatabaseSize.twig create mode 100644 www/analytics/plugins/PrivacyManager/templates/privacySettings.twig create mode 100644 www/analytics/plugins/Provider/API.php create mode 100644 www/analytics/plugins/Provider/Archiver.php create mode 100644 www/analytics/plugins/Provider/Controller.php create mode 100644 www/analytics/plugins/Provider/Provider.php create mode 100644 www/analytics/plugins/Provider/functions.php create mode 100644 www/analytics/plugins/Proxy/Controller.php create mode 100644 www/analytics/plugins/Proxy/Proxy.php create mode 100644 www/analytics/plugins/Referrers/API.php create mode 100644 www/analytics/plugins/Referrers/Archiver.php create mode 100644 www/analytics/plugins/Referrers/Controller.php create mode 100644 www/analytics/plugins/Referrers/Referrers.php create mode 100644 www/analytics/plugins/Referrers/functions.php create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/1.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/abcsok.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/alexa.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/all.by.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/apollo.lv.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/apollo7.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/arama.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ariadna.elmundo.es.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/arianna.libero.it.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ask.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/bg.setooz.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/bing.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/blekko.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/blogs.icerocket.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/blogsearch.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/busca.orange.es.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/busca.uol.com.br.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/buscador.terra.es.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/cgi.search.biglobe.ne.jp.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/claro-search.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/daemon-search.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/digg.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/dir.gigablast.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/dmoz.org.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/duckduckgo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ecosia.org.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/encrypted.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/eo.st.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/forestle.org.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/fr.dir.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/fr.wedoo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/friendfeed.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/gais.cs.ccu.edu.tw.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/geona.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/go.mail.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/googlesyndicatedsearch.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/holmes.ge.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/images.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/images.search.yahoo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/images.yandex.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/infospace.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/iwon.ask.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ixquick.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/junglekey.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/jyxo.1188.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ko.search.need2find.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/lo.st.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/maps.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/meta.rrzn.uni-hannover.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/meta.ua.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/metager2.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/news.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/nigma.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/nova.rambler.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/online.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/otsing.delfi.ee.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/p.zhongsou.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/pesquisa.clix.pt.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/pesquisa.sapo.pt.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/plusnetwork.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/poisk.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/recherche.francite.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/rechercher.aliceadsl.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/req.hit-parade.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/ricerca.virgilio.it.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/rpmfind.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/s1.metacrawler.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/scholar.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/scour.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.aol.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.babylon.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.bluewin.ch.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.centrum.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.comcast.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.conduit.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.daum.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.earthlink.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.excite.it.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.free.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.freecause.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.goo.ne.jp.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.imesh.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.ke.voila.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.lycos.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.nate.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.naver.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.nifty.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.peoplepc.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.qip.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.rr.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.seznam.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.smartaddressbar.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.snap.do.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.softonic.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.tiscali.it.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.winamp.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.www.ee.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.yahoo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.yam.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/search.yippy.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/searchalot.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/searchatlas.centrum.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/searchservice.myspace.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/sm.aport.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/smart.delfi.lv.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/so.360.cn.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/start.iplay.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/startgoogle.startpagina.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/suche.freenet.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/suche.info.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/suche.t-online.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/suche.web.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/surfcanyon.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/szukaj.onet.pl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/szukaj.wp.pl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/technorati.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/translate.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/video.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/web.canoe.ca.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/web.volny.cz.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/websearch.cs.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/websearch.rakuten.co.jp.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.123people.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.1881.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.abacho.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.acoon.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.allesklar.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.alltheweb.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.altavista.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.arcor.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.baidu.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.blogdigger.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.blogpulse.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.charter.net.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.crawler.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.cuil.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.dasoertliche.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.eniro.se.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.eurip.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.euroseek.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.everyclick.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.exalead.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.facebook.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.fastbrowsersearch.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.fireball.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.firstsfind.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.fixsuche.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.flix.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.gigablast.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.gnadenmeer.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.gomeo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.google.interia.pl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.goyellow.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.gulesider.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.highbeam.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.hooseek.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.hotbot.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.icq.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.ilse.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.jungle-spider.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.kataweb.it.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.kvasir.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.latne.lv.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.looksmart.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.maailm.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.mamma.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.meinestadt.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.mister-wong.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.monstercrawler.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.mozbot.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.mysearch.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.najdi.si.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.neti.ee.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.paperball.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.picsearch.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.plazoo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.qualigo.at.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.search.ch.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.search.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.searchcanvas.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.searchy.co.uk.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.sharelook.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.skynet.be.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.sogou.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.soso.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.startsiden.no.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.suchmaschine.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.suchnase.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.talimba.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.talktalk.co.uk.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.teoma.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.tixuma.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.toile.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.toolbarhome.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.trouvez.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.trovarapido.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.trusted-search.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.twingly.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.url.org.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.vinden.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.vindex.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.walhello.info.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.web.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.weborama.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.websearch.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.witch.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.x-recherche.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.yasni.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.yatedo.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.yougoo.fr.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.zapmeta.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.zoeken.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www.zoznam.sk.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www1.dastelefonbuch.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www2.austronaut.at.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www2.inbox.com.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/www3.zoek.nl.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/xx.gif create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/xx.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/yandex.ru.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/yellowmap.de.png create mode 100644 www/analytics/plugins/Referrers/images/searchEngines/zoohoo.cz.png create mode 100644 www/analytics/plugins/Referrers/images/socials/badoo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/bebo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/blackplanet.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/buzznet.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/classmates.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/douban.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/facebook.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/flickr.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/flixster.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/fotolog.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/foursquare.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/friendsreunited.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/friendster.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/gaiaonline.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/geni.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/github.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/habbo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/hi5.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/hyves.nl.png create mode 100644 www/analytics/plugins/Referrers/images/socials/identi.ca.png create mode 100644 www/analytics/plugins/Referrers/images/socials/last.fm.png create mode 100644 www/analytics/plugins/Referrers/images/socials/linkedin.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/livejournal.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/login.live.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/login.tagged.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/meinvz.net.png create mode 100644 www/analytics/plugins/Referrers/images/socials/mixi.jp.png create mode 100644 www/analytics/plugins/Referrers/images/socials/moikrug.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/multiply.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/my.mail.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/myheritage.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/mylife.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/myspace.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/myyearbook.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/netlog.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/news.ycombinator.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/nk.pl.png create mode 100644 www/analytics/plugins/Referrers/images/socials/odnoklassniki.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/orkut.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/pinterest.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/plaxo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/qzone.qq.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/reddit.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/renren.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/ru.netlog.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/skyrock.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/sonico.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/sourceforge.net.png create mode 100644 www/analytics/plugins/Referrers/images/socials/stackoverflow.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/studivz.net.png create mode 100644 www/analytics/plugins/Referrers/images/socials/stumbleupon.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/tagged.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/taringa.net.png create mode 100644 www/analytics/plugins/Referrers/images/socials/tuenti.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/tumblr.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/twitter.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/url.google.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/viadeo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/vimeo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/vk.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/vkontakte.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/vkrugudruzei.ru.png create mode 100644 www/analytics/plugins/Referrers/images/socials/wayn.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/weeworld.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/weibo.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/xanga.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/xing.com.png create mode 100644 www/analytics/plugins/Referrers/images/socials/xx.png create mode 100644 www/analytics/plugins/Referrers/images/socials/youtube.com.png create mode 100644 www/analytics/plugins/Referrers/templates/getSearchEnginesAndKeywords.twig create mode 100644 www/analytics/plugins/Referrers/templates/index.twig create mode 100644 www/analytics/plugins/Referrers/templates/indexWebsites.twig create mode 100644 www/analytics/plugins/SEO/API.php create mode 100644 www/analytics/plugins/SEO/Controller.php create mode 100644 www/analytics/plugins/SEO/MajesticClient.php create mode 100644 www/analytics/plugins/SEO/RankChecker.php create mode 100644 www/analytics/plugins/SEO/SEO.php create mode 100644 www/analytics/plugins/SEO/images/majesticseo.png create mode 100644 www/analytics/plugins/SEO/images/whois.png create mode 100644 www/analytics/plugins/SEO/javascripts/rank.js create mode 100644 www/analytics/plugins/SEO/templates/getRank.twig create mode 100644 www/analytics/plugins/ScheduledReports/API.php create mode 100644 www/analytics/plugins/ScheduledReports/Controller.php create mode 100644 www/analytics/plugins/ScheduledReports/ScheduledReports.php create mode 100644 www/analytics/plugins/ScheduledReports/config/tcpdf_config.php create mode 100644 www/analytics/plugins/ScheduledReports/javascripts/pdf.js create mode 100644 www/analytics/plugins/ScheduledReports/templates/_addReport.twig create mode 100644 www/analytics/plugins/ScheduledReports/templates/_listReports.twig create mode 100644 www/analytics/plugins/ScheduledReports/templates/index.twig create mode 100644 www/analytics/plugins/ScheduledReports/templates/reportParametersScheduledReports.twig create mode 100644 www/analytics/plugins/SegmentEditor/API.php create mode 100644 www/analytics/plugins/SegmentEditor/Controller.php create mode 100644 www/analytics/plugins/SegmentEditor/Model.php create mode 100644 www/analytics/plugins/SegmentEditor/SegmentEditor.php create mode 100644 www/analytics/plugins/SegmentEditor/SegmentSelectorControl.php create mode 100644 www/analytics/plugins/SegmentEditor/images/ajax-loader.gif create mode 100644 www/analytics/plugins/SegmentEditor/images/bg-inverted-corners.png create mode 100644 www/analytics/plugins/SegmentEditor/images/bg-segment-search.png create mode 100644 www/analytics/plugins/SegmentEditor/images/bg-select.png create mode 100644 www/analytics/plugins/SegmentEditor/images/close.png create mode 100644 www/analytics/plugins/SegmentEditor/images/close_btn.png create mode 100644 www/analytics/plugins/SegmentEditor/images/dashboard_h_bg_hover.png create mode 100644 www/analytics/plugins/SegmentEditor/images/icon-users.png create mode 100644 www/analytics/plugins/SegmentEditor/images/reset_search.png create mode 100644 www/analytics/plugins/SegmentEditor/images/search_btn.png create mode 100644 www/analytics/plugins/SegmentEditor/images/segment-close.png create mode 100644 www/analytics/plugins/SegmentEditor/images/segment-move.png create mode 100644 www/analytics/plugins/SegmentEditor/javascripts/Segmentation.js create mode 100644 www/analytics/plugins/SegmentEditor/stylesheets/segmentation.less create mode 100644 www/analytics/plugins/SegmentEditor/templates/_segmentSelector.twig create mode 100644 www/analytics/plugins/SitesManager/API.php create mode 100644 www/analytics/plugins/SitesManager/Controller.php create mode 100644 www/analytics/plugins/SitesManager/SitesManager.php create mode 100644 www/analytics/plugins/SitesManager/javascripts/SitesManager.js create mode 100644 www/analytics/plugins/SitesManager/stylesheets/SitesManager.less create mode 100644 www/analytics/plugins/SitesManager/templates/_displayJavascriptCode.twig create mode 100644 www/analytics/plugins/SitesManager/templates/displayJavascriptCode.twig create mode 100644 www/analytics/plugins/SitesManager/templates/index.twig create mode 100644 www/analytics/plugins/Transitions/API.php create mode 100644 www/analytics/plugins/Transitions/Controller.php create mode 100644 www/analytics/plugins/Transitions/Transitions.php create mode 100755 www/analytics/plugins/Transitions/images/transitions_icon.png create mode 100755 www/analytics/plugins/Transitions/images/transitions_icon_hover.png create mode 100644 www/analytics/plugins/Transitions/javascripts/transitions.js create mode 100644 www/analytics/plugins/Transitions/stylesheets/_transitionColors.less create mode 100644 www/analytics/plugins/Transitions/stylesheets/transitions.less create mode 100644 www/analytics/plugins/Transitions/templates/renderPopover.twig create mode 100644 www/analytics/plugins/UserCountry/API.php create mode 100644 www/analytics/plugins/UserCountry/Archiver.php create mode 100644 www/analytics/plugins/UserCountry/Controller.php create mode 100755 www/analytics/plugins/UserCountry/GeoIPAutoUpdater.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider/Default.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider/GeoIp.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider/GeoIp/Php.php create mode 100755 www/analytics/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php create mode 100644 www/analytics/plugins/UserCountry/UserCountry.php create mode 100644 www/analytics/plugins/UserCountry/functions.php create mode 100644 www/analytics/plugins/UserCountry/images/flags/a1.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/a2.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ac.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ad.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ae.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/af.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ag.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ai.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/al.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/am.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/an.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ao.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ap.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/aq.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ar.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/as.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/at.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/au.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/aw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ax.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/az.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ba.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bb.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bd.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/be.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bi.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bj.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bo.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bq.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/br.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bs.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/by.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/bz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ca.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cat.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cd.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ch.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ci.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ck.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/co.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cs.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cx.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cy.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/cz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/de.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/dg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/dj.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/dk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/dm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/do.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/dz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ea.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ec.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ee.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/eg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/eh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/er.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/es.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/et.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/eu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fi.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fj.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fo.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/fx.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ga.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gb.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gd.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ge.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gi.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gq.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gs.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/gy.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/hk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/hm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/hn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/hr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ht.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/hu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ic.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/id.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ie.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/il.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/im.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/in.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/io.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/iq.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ir.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/is.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/it.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/je.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/jm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/jo.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/jp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ke.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ki.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/km.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ky.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/kz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/la.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lb.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/li.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ls.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/lv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ly.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ma.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/md.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/me.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ml.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mo.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mq.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ms.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mx.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/my.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/mz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/na.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ne.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ng.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ni.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/no.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/np.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/nz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/o1.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/om.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pa.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pe.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ph.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ps.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/pw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/py.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/qa.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/re.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ro.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/rs.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ru.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/rw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sa.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sb.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sd.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/se.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sh.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/si.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sj.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/so.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ss.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/st.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/su.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sx.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sy.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/sz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ta.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/td.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/th.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ti.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tj.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tl.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/to.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tp.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tv.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tw.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/tz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ua.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ug.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/uk.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/um.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/us.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/uy.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/uz.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/va.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/vc.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ve.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/vg.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/vi.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/vn.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/vu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/wf.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ws.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/xx.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/ye.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/yt.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/yu.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/za.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/zm.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/zr.png create mode 100644 www/analytics/plugins/UserCountry/images/flags/zw.png create mode 100755 www/analytics/plugins/UserCountry/javascripts/userCountry.js create mode 100755 www/analytics/plugins/UserCountry/stylesheets/userCountry.less create mode 100755 www/analytics/plugins/UserCountry/templates/_updaterManage.twig create mode 100644 www/analytics/plugins/UserCountry/templates/_updaterNextRunTime.twig create mode 100755 www/analytics/plugins/UserCountry/templates/adminIndex.twig create mode 100755 www/analytics/plugins/UserCountry/templates/getGeoIpUpdaterManageScreen.twig create mode 100644 www/analytics/plugins/UserCountry/templates/index.twig create mode 100644 www/analytics/plugins/UserCountryMap/Controller.php create mode 100644 www/analytics/plugins/UserCountryMap/UserCountryMap.php create mode 100644 www/analytics/plugins/UserCountryMap/images/cities.png create mode 100644 www/analytics/plugins/UserCountryMap/images/realtimemap-loading.gif create mode 100644 www/analytics/plugins/UserCountryMap/images/regions.png create mode 100644 www/analytics/plugins/UserCountryMap/images/zoom-out-disabled.png create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/realtime-map.js create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/vendor/chroma.min.js create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/vendor/jquery.qtip.min.js create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/vendor/kartograph.min.js create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/vendor/raphael.min.js create mode 100644 www/analytics/plugins/UserCountryMap/javascripts/visitor-map.js create mode 100644 www/analytics/plugins/UserCountryMap/stylesheets/map.css create mode 100644 www/analytics/plugins/UserCountryMap/stylesheets/realtime-map.less create mode 100644 www/analytics/plugins/UserCountryMap/stylesheets/visitor-map.less create mode 100644 www/analytics/plugins/UserCountryMap/svg/AF.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AFG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AGO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ALB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ARE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ARG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ARM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AUS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AUT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/AZE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BDI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BEL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BEN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BFA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BGD.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BGR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BIH.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BLR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BLZ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BOL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BRA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BRB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BRN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BTN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/BWA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CAF.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CAN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CHE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CHL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CHN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CIV.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CMR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/COD.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/COG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/COL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CRI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CUB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CYP.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/CZE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DEU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DJI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DMA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DNK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DOM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/DZA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ECU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/EGY.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ERI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ESP.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/EST.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ETH.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/EU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/FIN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/FJI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/FRA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/FRO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GAB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GBR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GEO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GHA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GIN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GMB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GNB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GNQ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GRC.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GRL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GTM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/GUY.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/HND.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/HRV.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/HTI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/HUN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/IDN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/IND.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/IRL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/IRN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/IRQ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ISL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ISR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ITA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/JAM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/JOR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/JPN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KAZ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KEN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KGZ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KHM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KOR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/KWT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LAO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LBN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LBR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LBY.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LKA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LSO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LTU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LUX.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/LVA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MAR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MDA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MDG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MEX.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MKD.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MLI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MMR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MNE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MNG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MOZ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MRT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MWI.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/MYS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NAM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NCL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NER.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NFK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NGA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NIC.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NLD.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NOR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NPL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/NZL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/OC.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/OMN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PAK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PAN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PER.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PHL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PNG.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/POL.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PRK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PRT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/PRY.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/QAT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ROU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/RUS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/RWA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SAU.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SDN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SDS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SEN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SLB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SLE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SLV.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SOM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SRB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SUR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SVK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SVN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SWE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SWZ.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/SYR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TCD.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TGO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/THA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TIB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TJK.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TKM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TLS.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TTO.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TUN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TUR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TWN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/TZA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/UGA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/UKR.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/URY.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/USA.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/UZB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/VEN.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/VNM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/VUT.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/YEM.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ZAF.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ZMB.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/ZWE.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/tmp.svg create mode 100644 www/analytics/plugins/UserCountryMap/svg/world.svg create mode 100644 www/analytics/plugins/UserCountryMap/templates/realtimeMap.twig create mode 100644 www/analytics/plugins/UserCountryMap/templates/visitorMap.twig create mode 100644 www/analytics/plugins/UserSettings/API.php create mode 100644 www/analytics/plugins/UserSettings/Archiver.php create mode 100644 www/analytics/plugins/UserSettings/Controller.php create mode 100644 www/analytics/plugins/UserSettings/UserSettings.php create mode 100644 www/analytics/plugins/UserSettings/functions.php create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AG.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AM.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AN.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AR.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AV.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/AW.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/B2.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/BB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/BD.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/BE.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/BP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/BX.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CD.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CF.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CH.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CK.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CM.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CN.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CO.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/CS.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/DF.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/DI.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/EL.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/EP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/ES.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FD.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FE.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FF.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FL.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/FN.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/GA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/GE.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/HA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/HJ.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IC.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/ID.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IE.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IR.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/IW.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/KI.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/KM.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/KO.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/KP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/KZ.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/LI.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/LS.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/LX.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/MC.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/MI.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/MO.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/MS.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/MX.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/NB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/NF.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/NL.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/NP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/NS.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/OB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/ON.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/OP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/OR.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/OV.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/OW.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PL.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PM.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PO.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PU.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PW.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/PX.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/RK.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/SA.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/SF.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/SL.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/SM.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/TB.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/TI.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/TZ.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/UC.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/UN.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/UNK.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/WE.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/WO.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/WP.gif create mode 100644 www/analytics/plugins/UserSettings/images/browsers/YA.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/3DS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/AIX.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/AMG.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/AMI.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/AND.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/ARL.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/BBX.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/BEO.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/BLB.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/BSD.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/BTR.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/CES.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/COS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/DFB.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/DSI.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/FED.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/FOS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/GNT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/GTV.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/HPX.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/IOS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/IPA.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/IPD.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/IPH.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/IRI.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/KBT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/KNO.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/LBT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/LIN.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/MAC.gif create mode 100755 www/analytics/plugins/UserSettings/images/os/MAE.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/MDR.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/MIN.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/NBS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/NDS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/OBS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/OS2.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/POS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/PPY.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/PS3.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/PSP.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/PSV.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/QNX.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/RHT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/ROS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SAF.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SBA.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SLW.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SOS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SSE.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SYL.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/SYM.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/T64.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/TIZ.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/UBT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/UNK.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/VMS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W2K.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W61.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W65.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W75.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W95.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/W98.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WCE.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WI7.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WI8.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WII.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WIN.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WIU.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WME.gif create mode 100755 www/analytics/plugins/UserSettings/images/os/WMO.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WNT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WOS.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WP7.gif create mode 100755 www/analytics/plugins/UserSettings/images/os/WPH.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WRT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WS3.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WVI.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/WXP.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/XBT.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/XBX.gif create mode 100644 www/analytics/plugins/UserSettings/images/os/YNS.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/cookie.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/director.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/flash.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/gears.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/java.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/pdf.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/quicktime.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/realplayer.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/silverlight.gif create mode 100644 www/analytics/plugins/UserSettings/images/plugins/windowsmedia.gif create mode 100644 www/analytics/plugins/UserSettings/images/screens/dual.gif create mode 100644 www/analytics/plugins/UserSettings/images/screens/mobile.gif create mode 100644 www/analytics/plugins/UserSettings/images/screens/normal.gif create mode 100644 www/analytics/plugins/UserSettings/images/screens/unknown.gif create mode 100644 www/analytics/plugins/UserSettings/images/screens/wide.gif create mode 100644 www/analytics/plugins/UserSettings/templates/index.twig create mode 100644 www/analytics/plugins/UsersManager/API.php create mode 100644 www/analytics/plugins/UsersManager/Controller.php create mode 100644 www/analytics/plugins/UsersManager/LastSeenTimeLogger.php create mode 100644 www/analytics/plugins/UsersManager/Model.php create mode 100644 www/analytics/plugins/UsersManager/UsersManager.php create mode 100644 www/analytics/plugins/UsersManager/images/add.png create mode 100644 www/analytics/plugins/UsersManager/images/no-access.png create mode 100644 www/analytics/plugins/UsersManager/images/ok.png create mode 100644 www/analytics/plugins/UsersManager/javascripts/usersManager.js create mode 100644 www/analytics/plugins/UsersManager/javascripts/usersSettings.js create mode 100644 www/analytics/plugins/UsersManager/stylesheets/usersManager.less create mode 100644 www/analytics/plugins/UsersManager/templates/index.twig create mode 100644 www/analytics/plugins/UsersManager/templates/userSettings.twig create mode 100644 www/analytics/plugins/VisitFrequency/API.php create mode 100644 www/analytics/plugins/VisitFrequency/Controller.php create mode 100644 www/analytics/plugins/VisitFrequency/VisitFrequency.php create mode 100644 www/analytics/plugins/VisitFrequency/templates/_sparklines.twig create mode 100644 www/analytics/plugins/VisitFrequency/templates/getSparklines.twig create mode 100644 www/analytics/plugins/VisitFrequency/templates/index.twig create mode 100644 www/analytics/plugins/VisitTime/API.php create mode 100644 www/analytics/plugins/VisitTime/Archiver.php create mode 100644 www/analytics/plugins/VisitTime/Controller.php create mode 100644 www/analytics/plugins/VisitTime/VisitTime.php create mode 100644 www/analytics/plugins/VisitTime/functions.php create mode 100644 www/analytics/plugins/VisitTime/templates/index.twig create mode 100644 www/analytics/plugins/VisitorInterest/API.php create mode 100644 www/analytics/plugins/VisitorInterest/Archiver.php create mode 100644 www/analytics/plugins/VisitorInterest/Controller.php create mode 100644 www/analytics/plugins/VisitorInterest/VisitorInterest.php create mode 100644 www/analytics/plugins/VisitorInterest/templates/index.twig create mode 100644 www/analytics/plugins/VisitsSummary/API.php create mode 100644 www/analytics/plugins/VisitsSummary/Controller.php create mode 100644 www/analytics/plugins/VisitsSummary/VisitsSummary.php create mode 100644 www/analytics/plugins/VisitsSummary/stylesheets/datatable.less create mode 100644 www/analytics/plugins/VisitsSummary/templates/_sparklines.twig create mode 100644 www/analytics/plugins/VisitsSummary/templates/getSparklines.twig create mode 100644 www/analytics/plugins/VisitsSummary/templates/index.twig create mode 100644 www/analytics/plugins/Widgetize/Controller.php create mode 100644 www/analytics/plugins/Widgetize/Widgetize.php create mode 100644 www/analytics/plugins/Widgetize/javascripts/widgetize.js create mode 100644 www/analytics/plugins/Widgetize/stylesheets/widgetize.less create mode 100644 www/analytics/plugins/Widgetize/templates/iframe.twig create mode 100644 www/analytics/plugins/Widgetize/templates/iframe_empty.twig create mode 100644 www/analytics/plugins/Widgetize/templates/index.twig create mode 100644 www/analytics/plugins/Widgetize/templates/testJsInclude1.twig create mode 100644 www/analytics/plugins/Widgetize/templates/testJsInclude2.twig create mode 100644 www/analytics/plugins/Zeitgeist/images/affix-arrow.png create mode 100644 www/analytics/plugins/Zeitgeist/images/annotations.png create mode 100644 www/analytics/plugins/Zeitgeist/images/annotations_starred.png create mode 100644 www/analytics/plugins/Zeitgeist/images/arr_r.png create mode 100644 www/analytics/plugins/Zeitgeist/images/background-submit.png create mode 100644 www/analytics/plugins/Zeitgeist/images/chart_bar.png create mode 100755 www/analytics/plugins/Zeitgeist/images/chart_line_edit.png create mode 100644 www/analytics/plugins/Zeitgeist/images/chart_pie.png create mode 100644 www/analytics/plugins/Zeitgeist/images/close.png create mode 100644 www/analytics/plugins/Zeitgeist/images/collapsed_arrows.gif create mode 100755 www/analytics/plugins/Zeitgeist/images/configure-highlight.png create mode 100755 www/analytics/plugins/Zeitgeist/images/configure.png create mode 100644 www/analytics/plugins/Zeitgeist/images/dashboard_h_bg.png create mode 100644 www/analytics/plugins/Zeitgeist/images/dashboard_h_bg_hover.png create mode 100644 www/analytics/plugins/Zeitgeist/images/data_table_footer_active_item.png create mode 100644 www/analytics/plugins/Zeitgeist/images/datepicker_arr_l.png create mode 100644 www/analytics/plugins/Zeitgeist/images/datepicker_arr_r.png create mode 100644 www/analytics/plugins/Zeitgeist/images/delete.png create mode 100644 www/analytics/plugins/Zeitgeist/images/download.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ecommerceAbandonedCart.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/ecommerceOrder.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/email.png create mode 100644 www/analytics/plugins/Zeitgeist/images/error.png create mode 100644 www/analytics/plugins/Zeitgeist/images/error_medium.png create mode 100644 www/analytics/plugins/Zeitgeist/images/event.png create mode 100644 www/analytics/plugins/Zeitgeist/images/expanded_arrows.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/export.png create mode 100644 www/analytics/plugins/Zeitgeist/images/feed.png create mode 100755 www/analytics/plugins/Zeitgeist/images/fullscreen.png create mode 100644 www/analytics/plugins/Zeitgeist/images/goal.png create mode 100644 www/analytics/plugins/Zeitgeist/images/help.png create mode 100644 www/analytics/plugins/Zeitgeist/images/html_icon.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ico_alert.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ico_delete.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ico_edit.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ico_info.png create mode 100644 www/analytics/plugins/Zeitgeist/images/icon-calendar.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/image.png create mode 100644 www/analytics/plugins/Zeitgeist/images/inp_bg.png create mode 100644 www/analytics/plugins/Zeitgeist/images/li_dbl_gray.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/link.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/loading-blue.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/login-sprite.png create mode 100644 www/analytics/plugins/Zeitgeist/images/logo-header.png create mode 100644 www/analytics/plugins/Zeitgeist/images/logo-marketplace.png create mode 100644 www/analytics/plugins/Zeitgeist/images/logo.png create mode 100644 www/analytics/plugins/Zeitgeist/images/logo.svg create mode 100644 www/analytics/plugins/Zeitgeist/images/maximise.png create mode 100644 www/analytics/plugins/Zeitgeist/images/minimise.png create mode 100644 www/analytics/plugins/Zeitgeist/images/minus.png create mode 100755 www/analytics/plugins/Zeitgeist/images/newtab.png create mode 100644 www/analytics/plugins/Zeitgeist/images/ok.png create mode 100755 www/analytics/plugins/Zeitgeist/images/paypal_subscribe.gif create mode 100644 www/analytics/plugins/Zeitgeist/images/plus.png create mode 100755 www/analytics/plugins/Zeitgeist/images/plus_blue.png create mode 100644 www/analytics/plugins/Zeitgeist/images/refresh.png create mode 100755 www/analytics/plugins/Zeitgeist/images/reload.png create mode 100644 www/analytics/plugins/Zeitgeist/images/row_evolution.png create mode 100755 www/analytics/plugins/Zeitgeist/images/row_evolution_hover.png create mode 100644 www/analytics/plugins/Zeitgeist/images/search_bg.png create mode 100644 www/analytics/plugins/Zeitgeist/images/search_ico.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sites_selection.png create mode 100755 www/analytics/plugins/Zeitgeist/images/smileyprog_0.png create mode 100755 www/analytics/plugins/Zeitgeist/images/smileyprog_1.png create mode 100755 www/analytics/plugins/Zeitgeist/images/smileyprog_2.png create mode 100755 www/analytics/plugins/Zeitgeist/images/smileyprog_3.png create mode 100755 www/analytics/plugins/Zeitgeist/images/smileyprog_4.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sort_subtable_asc.png create mode 100755 www/analytics/plugins/Zeitgeist/images/sort_subtable_asc_light.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sort_subtable_desc.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sort_subtable_desc_light.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sortasc.png create mode 100644 www/analytics/plugins/Zeitgeist/images/sortdesc.png create mode 100755 www/analytics/plugins/Zeitgeist/images/star.png create mode 100755 www/analytics/plugins/Zeitgeist/images/star_empty.png create mode 100644 www/analytics/plugins/Zeitgeist/images/success_medium.png create mode 100644 www/analytics/plugins/Zeitgeist/images/table.png create mode 100644 www/analytics/plugins/Zeitgeist/images/table_more.png create mode 100644 www/analytics/plugins/Zeitgeist/images/tagcloud.png create mode 100755 www/analytics/plugins/Zeitgeist/images/video_play.png create mode 100644 www/analytics/plugins/Zeitgeist/images/warning.png create mode 100644 www/analytics/plugins/Zeitgeist/images/warning_medium.png create mode 100644 www/analytics/plugins/Zeitgeist/images/warning_small.png create mode 100644 www/analytics/plugins/Zeitgeist/images/zoom-out.png create mode 100644 www/analytics/plugins/Zeitgeist/javascripts/ajaxHelper.js create mode 100644 www/analytics/plugins/Zeitgeist/javascripts/piwikHelper.js create mode 100644 www/analytics/plugins/Zeitgeist/plugin.json create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/base.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/general/_default.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/general/_form.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/general/_jqueryUI.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/general/_misc.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/general/_utils.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ieonly.css create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/rtl.css create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/simple_structure.css create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_dataTable.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_header.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_headerMessage.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_languageSelect.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_loading.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_periodSelect.less create mode 100644 www/analytics/plugins/Zeitgeist/stylesheets/ui/_siteSelect.less create mode 100644 www/analytics/plugins/Zeitgeist/templates/_iframeBuster.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/_jsCssIncludes.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/_jsGlobalVariables.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/_piwikTag.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/_sparklineFooter.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/admin.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/ajaxMacros.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/dashboard.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/empty.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/genericForm.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/javascriptCode.tpl create mode 100644 www/analytics/plugins/Zeitgeist/templates/macros.twig create mode 100644 www/analytics/plugins/Zeitgeist/templates/simpleLayoutFooter.tpl create mode 100644 www/analytics/plugins/Zeitgeist/templates/simpleLayoutHeader.tpl create mode 100644 www/analytics/robots.txt create mode 100644 www/analytics/tests/README.md create mode 100644 www/analytics/tmp/.htaccess create mode 100644 www/analytics/vendor/.htaccess create mode 100644 www/analytics/vendor/autoload.php create mode 100644 www/analytics/vendor/composer/ClassLoader.php create mode 100644 www/analytics/vendor/composer/autoload_classmap.php create mode 100644 www/analytics/vendor/composer/autoload_files.php create mode 100644 www/analytics/vendor/composer/autoload_namespaces.php create mode 100644 www/analytics/vendor/composer/autoload_psr4.php create mode 100644 www/analytics/vendor/composer/autoload_real.php create mode 100644 www/analytics/vendor/composer/installed.json create mode 100644 www/analytics/vendor/leafo/lessphp/.gitignore create mode 100644 www/analytics/vendor/leafo/lessphp/.travis.yml create mode 100644 www/analytics/vendor/leafo/lessphp/LICENSE create mode 100644 www/analytics/vendor/leafo/lessphp/Makefile create mode 100644 www/analytics/vendor/leafo/lessphp/README.md create mode 100644 www/analytics/vendor/leafo/lessphp/composer.json create mode 100644 www/analytics/vendor/leafo/lessphp/docs/docs.md create mode 100644 www/analytics/vendor/leafo/lessphp/lessc.inc.php create mode 100755 www/analytics/vendor/leafo/lessphp/lessify create mode 100644 www/analytics/vendor/leafo/lessphp/lessify.inc.php create mode 100755 www/analytics/vendor/leafo/lessphp/package.sh create mode 100755 www/analytics/vendor/leafo/lessphp/plessc create mode 100644 www/analytics/vendor/mustangostang/spyc/COPYING create mode 100644 www/analytics/vendor/mustangostang/spyc/README create mode 100644 www/analytics/vendor/mustangostang/spyc/Spyc.php create mode 100644 www/analytics/vendor/mustangostang/spyc/composer.json create mode 100644 www/analytics/vendor/mustangostang/spyc/examples/yaml-dump.php create mode 100644 www/analytics/vendor/mustangostang/spyc/examples/yaml-load.php create mode 100644 www/analytics/vendor/mustangostang/spyc/php4/5to4.php create mode 100644 www/analytics/vendor/mustangostang/spyc/php4/spyc.php4 create mode 100644 www/analytics/vendor/mustangostang/spyc/php4/test.php4 create mode 100644 www/analytics/vendor/mustangostang/spyc/spyc.yaml create mode 100644 www/analytics/vendor/piwik/device-detector/.gitignore create mode 100644 www/analytics/vendor/piwik/device-detector/.travis.yml create mode 100644 www/analytics/vendor/piwik/device-detector/DeviceDetector.php create mode 100644 www/analytics/vendor/piwik/device-detector/README.md create mode 100644 www/analytics/vendor/piwik/device-detector/composer.json create mode 100644 www/analytics/vendor/piwik/device-detector/regexes/browsers.yml create mode 100644 www/analytics/vendor/piwik/device-detector/regexes/mobiles.yml create mode 100644 www/analytics/vendor/piwik/device-detector/regexes/oss.yml create mode 100644 www/analytics/vendor/piwik/device-detector/regexes/televisions.yml create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/.gitignore create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Application.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Command/Command.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/InputAwareHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/Input.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/InputAwareInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/LICENSE create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/BufferedOutput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/Output.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/README.md create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Shell.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/composer.json create mode 100644 www/analytics/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist create mode 100644 www/analytics/vendor/tedivm/jshrink/.gitignore create mode 100644 www/analytics/vendor/tedivm/jshrink/.travis.yml create mode 100644 www/analytics/vendor/tedivm/jshrink/LICENSE create mode 100644 www/analytics/vendor/tedivm/jshrink/README.md create mode 100644 www/analytics/vendor/tedivm/jshrink/composer.json create mode 100644 www/analytics/vendor/tedivm/jshrink/src/JShrink/Minifier.php create mode 100644 www/analytics/vendor/twig/twig/.editorconfig create mode 100644 www/analytics/vendor/twig/twig/.gitignore create mode 100644 www/analytics/vendor/twig/twig/.travis.yml create mode 100644 www/analytics/vendor/twig/twig/CHANGELOG create mode 100644 www/analytics/vendor/twig/twig/LICENSE create mode 100644 www/analytics/vendor/twig/twig/README.rst create mode 100644 www/analytics/vendor/twig/twig/composer.json create mode 100644 www/analytics/vendor/twig/twig/ext/twig/.gitignore create mode 100644 www/analytics/vendor/twig/twig/ext/twig/LICENSE create mode 100644 www/analytics/vendor/twig/twig/ext/twig/config.m4 create mode 100644 www/analytics/vendor/twig/twig/ext/twig/config.w32 create mode 100644 www/analytics/vendor/twig/twig/ext/twig/php_twig.h create mode 100644 www/analytics/vendor/twig/twig/ext/twig/twig.c create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Autoloader.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Compiler.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/CompilerInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Environment.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Error.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Error/Loader.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Error/Runtime.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Error/Syntax.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/ExpressionParser.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Core.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Debug.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Escaper.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Optimizer.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Sandbox.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/Staging.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Extension/StringLoader.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/ExtensionInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Filter.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Filter/Function.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Filter/Method.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Filter/Node.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/FilterCallableInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/FilterInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Function.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Function/Function.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Function/Method.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Function/Node.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/FunctionInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Lexer.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/LexerInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Loader/Array.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Loader/Chain.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Loader/Filesystem.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Loader/String.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/LoaderInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Markup.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/AutoEscape.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Block.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/BlockReference.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Body.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Do.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Embed.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Array.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Call.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Function.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Name.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Flush.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/For.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/ForLoop.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/If.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Import.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Include.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Macro.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Module.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Print.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Sandbox.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Set.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/SetTemp.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Spaceless.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Node/Text.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeOutputInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeTraverser.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Parser.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/ParserInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/SimpleFilter.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/SimpleFunction.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/SimpleTest.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Template.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TemplateInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test/Function.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test/Method.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test/Node.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TestCallableInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TestInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/Token.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Block.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Do.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Embed.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Extends.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Filter.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Flush.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/For.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/From.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/If.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Import.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Include.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Macro.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Set.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParser/Use.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParserBroker.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenParserInterface.php create mode 100644 www/analytics/vendor/twig/twig/lib/Twig/TokenStream.php create mode 100644 www/analytics/vendor/twig/twig/phpunit.xml.dist create mode 100644 www/css/desktop.css create mode 100644 www/css/ol.css create mode 100644 www/error403.html create mode 100644 www/error404.html create mode 100644 www/error500.html create mode 100644 www/favicon.ico create mode 100644 www/grafics/charactergroup.jpg create mode 100644 www/grafics/lvlup.jpg create mode 100644 www/grafics/paper.jpg create mode 100644 www/grafics/questlab.jpg create mode 100644 www/index.php create mode 100644 www/js/dnd.js create mode 100644 www/js/imagelightbox.min.js create mode 100644 www/js/jquery.nicescroll.min.js create mode 100644 www/js/misc.js create mode 100644 www/js/ol.js diff --git a/.hgignore b/.hgignore new file mode 100644 index 00000000..776ca1b5 --- /dev/null +++ b/.hgignore @@ -0,0 +1,9 @@ +syntax: regexp +^logs/* +^media/* +^tmp/* +^uploads/* +^seminarymedia/* +^seminaryuploads/* +^www/analytics/config/config.ini.php* +^www/analytics/temp/* diff --git a/.htaccess b/.htaccess new file mode 100644 index 00000000..c1167dbf --- /dev/null +++ b/.htaccess @@ -0,0 +1,44 @@ +Options -Indexes -MultiViews + +ErrorDocument 403 /www/error403.html +ErrorDocument 404 /www/error404.html +ErrorDocument 500 /www/error500.html + + + + Require all granted + + + Require all denied + + + Require all denied + + + Require all denied + + + + Allow From All + + + Order Deny,Allow + Deny From All + + + Order Deny,Allow + Deny From All + + + Order Deny,Allow + Deny From All + + + + + + RewriteEngine On + + RewriteBase / + RewriteRule ^(.*)$ www/$1 [L] + diff --git a/agents/BottomlevelAgent.inc b/agents/BottomlevelAgent.inc new file mode 100644 index 00000000..648c1fb7 --- /dev/null +++ b/agents/BottomlevelAgent.inc @@ -0,0 +1,25 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\agents; + + + /** + * The BottomlevelAgent is the standard Agent and can have indefinite + * SubAgents. + * + * @author coderkun + */ + abstract class BottomlevelAgent extends \nre\core\Agent + { + } + +?> diff --git a/agents/IntermediateAgent.inc b/agents/IntermediateAgent.inc new file mode 100644 index 00000000..4828cfbb --- /dev/null +++ b/agents/IntermediateAgent.inc @@ -0,0 +1,49 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\agents; + + + /** + * The IntermediateAgent assumes the task of a module. There is only one + * IntermediateAgent per request. + * + * @author coderkun + */ + abstract class IntermediateAgent extends \nre\core\Agent + { + + + + + /** + * Get the layout if it was explicitly defined. + * + * @param string $agentName Agent name + * @return string Layout of the IntermediateAgent + */ + public static function getLayout($agentName) + { + // Determine classname + $className = Autoloader::concatClassNames($agentName, 'Agent'); + + // Check property + if(isset($className::$layout)) { + return $className::$layout; + } + + + return null; + } + + } + +?> diff --git a/agents/ToplevelAgent.inc b/agents/ToplevelAgent.inc new file mode 100644 index 00000000..0c4e64ea --- /dev/null +++ b/agents/ToplevelAgent.inc @@ -0,0 +1,395 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\agents; + + + /** + * The ToplevelAgent assumes the task of a FrontController. There is + * only one per request. + * + * @author coderkun + */ + class ToplevelAgent extends \nre\core\Agent + { + /** + * Stage: Load + * + * @var string + */ + const STAGE_LOAD = 'load'; + /** + * Stage: Run + * + * @var string + */ + const STAGE_RUN = 'run'; + + /** + * Current request + * + * @var \nre\core\Request + */ + private $request; + /** + * Current response + * + * @var \nre\core\Response + */ + private $response; + /** + * Layout instace + * + * @var \nre\core\Layout + */ + private $layout = null; + /** + * IntermediateAgent instance + * + * @var IntermediateAgent + */ + private $intermediateAgent = null; + + + + + /** + * Construct a ToplevelAgent. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @throws \nre\exceptions\ControllerNotFoundException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Log-system + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + // Store values + $this->request = $request; + $this->response = $response; + + + // Create response + $response = clone $response; + $response->clearParams(1); + $response->addParams( + null, + \nre\configs\CoreConfig::$defaults['action'] + ); + + // Call parent constructor + parent::__construct($request, $response, $log, true); + + + // Load IntermediateAgent + $this->loadIntermediateAgent(); + } + + + + + /** + * Run the Controller of this Agent and its SubAgents. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @return \Exception Last occurred exception of SubAgents + */ + public function run(\nre\core\Request $request, \nre\core\Response $response) + { + try { + return $this->_run($request, $response); + } + catch(\nre\exceptions\AccessDeniedException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_FORBIDDEN, self::STAGE_RUN); + } + catch(\nre\exceptions\ParamsNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); + } + catch(\nre\exceptions\IdNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); + } + catch(\nre\exceptions\DatamodelException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE, self::STAGE_RUN); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN); + } + } + + + /** + * Generate output of the Controller of this Agent and its + * SubAgents. + * + * @param array $data View data + * @return string Generated output + */ + public function render($data=array()) + { + // Render IntermediateAgent + $data = array(); + $data['intermediate'] = $this->intermediateAgent->render(); + + + // Render ToplevelAgent + return parent::render($data); + } + + + /** + * Return the IntermediateAgent. + * + * @return \nre\agents\IntermediateAgent IntermediateAgent + */ + public function getIntermediateAgent() + { + return $this->intermediateAgent; + } + + + + + /** + * Load a SubAgent and add it. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\FatalDatamodelException + * @throws \nre\exceptions\AgentNotFoundException + * @throws \nre\exceptions\AgentNotValidException + * @param string $agentName Name of the Agent to load + * @param mixed … Additional parameters for the agent + */ + protected function addSubAgent($agentName) + { + try { + call_user_func_array( + array( + $this, + '_addSubAgent' + ), + func_get_args() + ); + } + catch(\nre\exceptions\DatamodelException $e) { + throw new \nre\exceptions\FatalDatamodelException($e->getDatamodelMessage(), $e->getDatamodelErrorNumber()); + } + } + + + + + /** + * Load IntermediateAgent defined by the current request. + * + * @throws \nre\exceptions\ServiceUnavailableException + */ + private function loadIntermediateAgent() + { + try { + $this->_loadIntermediateAgent(); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\DatamodelException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\DriverNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\DriverNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ModelNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ModelNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ControllerNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ControllerNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\AgentNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\AgentNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + } + + + /** + * Load IntermediateAgent defined by the current request. + * + * @throws \nre\exceptions\ServiceUnavailableException + */ + private function _loadIntermediateAgent() + { + // Determine IntermediateAgent + $agentName = $this->response->getParam(1); + if(is_null($agentName)) { + $agentName = $this->request->getParam(1, 'intermediate'); + $this->response->addParam($agentName); + } + + // Load IntermediateAgent + IntermediateAgent::load($agentName); + + + // Determine Action + $action = $this->response->getParam(2); + if(is_null($action)) { + $action = $this->request->getParam(2, 'action'); + $this->response->addParam($action); + } + + // Construct IntermediateAgent + $this->intermediateAgent = \nre\agents\IntermediateAgent::factory( + $agentName, + $this->request, + $this->response, + $this->log + ); + } + + + /** + * Run the Controller of this Agent and its SubAgents. + * + * @throws \nre\exceptions\AccessDeniedException + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\DatamodelException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @return \Exception Last occurred exception of SubAgents + */ + private function _run(\nre\core\Request $request, \nre\core\Response $response) + { + // Run IntermediateAgent + $this->runIntermediateAgent(); + + + // TODO Request instead of response? + $response = clone $response; + $response->clearParams(2); + $response->addParam(\nre\configs\CoreConfig::$defaults['action']); + + + // Run ToplevelAgent + return parent::run($request, $response); + } + + + /** + * Run IntermediateAgent. + * + * @throws \nre\exceptions\AccessDeniedException + * @throws \nre\exceptions\ParamsNotValidException + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\DatamodelException + */ + private function runIntermediateAgent() + { + $this->intermediateAgent->run( + $this->request, + $this->response + ); + } + + + /** + * Handle an error that occurred during + * loading/cnostructing/running of the IntermediateAgent. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @param \Exception $exception Occurred exception + * @param int $httpStatusCode HTTP-statuscode + * @param string $stage Stage of execution + */ + private function error($exception, $httpStatusCode, $stage=self::STAGE_LOAD) + { + // Log error + $this->log($exception, \nre\core\Logger::LOGMODE_AUTO); + + + try { + // Define ErrorAgent + $this->response->clearParams(1); + $this->response->addParams( + \nre\configs\AppConfig::$defaults['intermediate-error'], + \nre\configs\CoreConfig::$defaults['action'], + $httpStatusCode + ); + + // Load ErrorAgent + $this->_loadIntermediateAgent(); + + // Run ErrorAgent + if($stage == self::STAGE_RUN) { + $this->_run($this->request, $this->response); + } + } + catch(\nre\exceptions\ActionNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\DatamodelException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\DriverNotValidException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\DriverNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\ModelNotValidException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\ModelNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\ControllerNotValidException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\ControllerNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\AgentNotValidException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(\nre\exceptions\AgentNotFoundException $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + catch(Exception $e) { + throw new \nre\exceptions\ServiceUnavailableException($e); + } + } + + + } + +?> diff --git a/agents/bottomlevel/MailreceiverAgent.inc b/agents/bottomlevel/MailreceiverAgent.inc new file mode 100644 index 00000000..5ebffd3a --- /dev/null +++ b/agents/bottomlevel/MailreceiverAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to generate a mail receiver salutation. + * + * @author Oliver Hanraths + */ + class MailreceiverAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/bottomlevel/MenuAgent.inc b/agents/bottomlevel/MenuAgent.inc new file mode 100644 index 00000000..0f0dc60d --- /dev/null +++ b/agents/bottomlevel/MenuAgent.inc @@ -0,0 +1,40 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display a menu. + * + * @author Oliver Hanraths + */ + class MenuAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + // Add Seminary menu + $this->addSubAgent('Seminarymenu'); + } + + } + +?> diff --git a/agents/bottomlevel/QuestgroupshierarchypathAgent.inc b/agents/bottomlevel/QuestgroupshierarchypathAgent.inc new file mode 100644 index 00000000..36b84474 --- /dev/null +++ b/agents/bottomlevel/QuestgroupshierarchypathAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display the Questgroups hierarchy path. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchypathAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/bottomlevel/SeminarybarAgent.inc b/agents/bottomlevel/SeminarybarAgent.inc new file mode 100644 index 00000000..2f43e474 --- /dev/null +++ b/agents/bottomlevel/SeminarybarAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display a sidebar with Seminary related information. + * + * @author Oliver Hanraths + */ + class SeminarybarAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/bottomlevel/SeminarymenuAgent.inc b/agents/bottomlevel/SeminarymenuAgent.inc new file mode 100644 index 00000000..1c55e419 --- /dev/null +++ b/agents/bottomlevel/SeminarymenuAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display a menu with Seminary related links. + * + * @author Oliver Hanraths + */ + class SeminarymenuAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/bottomlevel/UserrolesAgent.inc b/agents/bottomlevel/UserrolesAgent.inc new file mode 100644 index 00000000..1186eff4 --- /dev/null +++ b/agents/bottomlevel/UserrolesAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display and manage userroles. + * + * @author Oliver Hanraths + */ + class UserrolesAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: user. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function user(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/bottomlevel/empty b/agents/bottomlevel/empty new file mode 100644 index 00000000..e69de29b diff --git a/agents/intermediate/AchievementsAgent.inc b/agents/intermediate/AchievementsAgent.inc new file mode 100644 index 00000000..de829ee1 --- /dev/null +++ b/agents/intermediate/AchievementsAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to list Achievements. + * + * @author Oliver Hanraths + */ + class AchievementsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/CharactergroupsAgent.inc b/agents/intermediate/CharactergroupsAgent.inc new file mode 100644 index 00000000..02b8244a --- /dev/null +++ b/agents/intermediate/CharactergroupsAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Character groups. + * + * @author Oliver Hanraths + */ + class CharactergroupsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/CharactergroupsquestsAgent.inc b/agents/intermediate/CharactergroupsquestsAgent.inc new file mode 100644 index 00000000..3e5e17d1 --- /dev/null +++ b/agents/intermediate/CharactergroupsquestsAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Character groups Quests. + * + * @author Oliver Hanraths + */ + class CharactergroupsquestsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/CharactersAgent.inc b/agents/intermediate/CharactersAgent.inc new file mode 100644 index 00000000..0bbfa315 --- /dev/null +++ b/agents/intermediate/CharactersAgent.inc @@ -0,0 +1,49 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to list registered Characters and their data. + * + * @author Oliver Hanraths + */ + class CharactersAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + + /** + * Action: character. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function character(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/CharactertypesAgent.inc b/agents/intermediate/CharactertypesAgent.inc new file mode 100644 index 00000000..8c2693bb --- /dev/null +++ b/agents/intermediate/CharactertypesAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to handle Charactertyes of a Seminary. + * + * @author Oliver Hanraths + */ + class CharactertypesAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/ErrorAgent.inc b/agents/intermediate/ErrorAgent.inc new file mode 100644 index 00000000..5554c417 --- /dev/null +++ b/agents/intermediate/ErrorAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to show an error page. + * + * @author Oliver Hanraths + */ + class ErrorAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/IntroductionAgent.inc b/agents/intermediate/IntroductionAgent.inc new file mode 100644 index 00000000..1ee6483a --- /dev/null +++ b/agents/intermediate/IntroductionAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to show an introduction page. + * + * @author Oliver Hanraths + */ + class IntroductionAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/LibraryAgent.inc b/agents/intermediate/LibraryAgent.inc new file mode 100644 index 00000000..b3105be9 --- /dev/null +++ b/agents/intermediate/LibraryAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to list Quest topics. + * + * @author Oliver Hanraths + */ + class LibraryAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/MailAgent.inc b/agents/intermediate/MailAgent.inc new file mode 100644 index 00000000..34dcc512 --- /dev/null +++ b/agents/intermediate/MailAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to generate a mail-message. + * + * @author Oliver Hanraths + */ + class MailAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/MapAgent.inc b/agents/intermediate/MapAgent.inc new file mode 100644 index 00000000..1fd0eb00 --- /dev/null +++ b/agents/intermediate/MapAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display a map. + * + * @author Oliver Hanraths + */ + class MapAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/MediaAgent.inc b/agents/intermediate/MediaAgent.inc new file mode 100644 index 00000000..550380a8 --- /dev/null +++ b/agents/intermediate/MediaAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to process and show media. + * + * @author Oliver Hanraths + */ + class MediaAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/QuestgroupsAgent.inc b/agents/intermediate/QuestgroupsAgent.inc new file mode 100644 index 00000000..7f71eafa --- /dev/null +++ b/agents/intermediate/QuestgroupsAgent.inc @@ -0,0 +1,99 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: questgroup. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function questgroup(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + + /** + * Action: edit. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function edit(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + + /** + * Action: edittexts. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function edittexts(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + + /** + * Action: moveup. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function moveup(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + + /** + * Action: movedown. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function movedown(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + + /** + * Action: delete. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function delete(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + } + +?> diff --git a/agents/intermediate/QuestgroupshierarchyAgent.inc b/agents/intermediate/QuestgroupshierarchyAgent.inc new file mode 100644 index 00000000..b84f3953 --- /dev/null +++ b/agents/intermediate/QuestgroupshierarchyAgent.inc @@ -0,0 +1,24 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to manage Questgroupshierarchy. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchyAgent extends \nre\agents\IntermediateAgent + { + } + +?> diff --git a/agents/intermediate/QuestsAgent.inc b/agents/intermediate/QuestsAgent.inc new file mode 100644 index 00000000..1485d090 --- /dev/null +++ b/agents/intermediate/QuestsAgent.inc @@ -0,0 +1,123 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Quests. + * + * @author Oliver Hanraths + */ + class QuestsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: quest. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function quest(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: submissions. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function submissions(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: submission. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function submission(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: create. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function create(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: edit. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function edit(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: edittask. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function edittask(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: edittexts. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function edittexts(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + + /** + * Action: delete. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function delete(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + } + +?> diff --git a/agents/intermediate/SeminariesAgent.inc b/agents/intermediate/SeminariesAgent.inc new file mode 100644 index 00000000..79901cfe --- /dev/null +++ b/agents/intermediate/SeminariesAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to list registered seminaries. + * + * @author Oliver Hanraths + */ + class SeminariesAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/UploadsAgent.inc b/agents/intermediate/UploadsAgent.inc new file mode 100644 index 00000000..ef01077e --- /dev/null +++ b/agents/intermediate/UploadsAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to process and show user uploads. + * + * @author Oliver Hanraths + */ + class UploadsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/UsersAgent.inc b/agents/intermediate/UsersAgent.inc new file mode 100644 index 00000000..9ba74df3 --- /dev/null +++ b/agents/intermediate/UsersAgent.inc @@ -0,0 +1,50 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to list registered users and their data. + * + * @author Oliver Hanraths + */ + class UsersAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + + /** + * Action: user. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function user(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Userroles', 'user'); + } + + } + +?> diff --git a/agents/intermediate/XplevelsAgent.inc b/agents/intermediate/XplevelsAgent.inc new file mode 100644 index 00000000..dff540f3 --- /dev/null +++ b/agents/intermediate/XplevelsAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to handle XP-levels of a Seminary. + * + * @author Oliver Hanraths + */ + class XplevelsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/empty b/agents/intermediate/empty new file mode 100644 index 00000000..e69de29b diff --git a/agents/toplevel/AjaxAgent.inc b/agents/toplevel/AjaxAgent.inc new file mode 100644 index 00000000..1ced33f1 --- /dev/null +++ b/agents/toplevel/AjaxAgent.inc @@ -0,0 +1,80 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent to return a JSON-string used by AJAX. + * + * @author Oliver Hanraths + */ + class AjaxAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new AjaxAgent. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + + + $this->setLanguage($request); + } + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + + + + /** + * Set requested language. + * + * @param \nre\core\Request $request Current request + */ + private function setLanguage(\nre\core\Request $request) + { + // Set domain + $domain = \nre\configs\AppConfig::$app['genericname']; + + // Get language + $locale = $request->getGetParam('lang', 'language'); + if(is_null($locale)) { + return; + } + + // Load translation + putenv("LC_ALL=$locale"); + setlocale(LC_ALL, $locale); + bindtextdomain($domain, ROOT.DS.\nre\configs\AppConfig::$dirs['locale']); + textdomain($domain); + } + + } + +?> diff --git a/agents/toplevel/BinaryAgent.inc b/agents/toplevel/BinaryAgent.inc new file mode 100644 index 00000000..55d494e3 --- /dev/null +++ b/agents/toplevel/BinaryAgent.inc @@ -0,0 +1,51 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent to display binary data (e. g. images). + * + * @author Oliver Hanraths + */ + class BinaryAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new BinaryAgent. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + } + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/toplevel/FaultAgent.inc b/agents/toplevel/FaultAgent.inc new file mode 100644 index 00000000..d289c041 --- /dev/null +++ b/agents/toplevel/FaultAgent.inc @@ -0,0 +1,38 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent to display a toplevel error page. + * + * @author Oliver Hanraths + */ + class FaultAgent extends \nre\agents\ToplevelAgent + { + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/toplevel/HtmlAgent.inc b/agents/toplevel/HtmlAgent.inc new file mode 100644 index 00000000..34abd31d --- /dev/null +++ b/agents/toplevel/HtmlAgent.inc @@ -0,0 +1,156 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent to display a HTML-page. + * + * @author Oliver Hanraths + */ + class HtmlAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new HtmlAgent. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + + + $this->setLanguage($request); + } + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + // Add menu + $this->addSubAgent('Menu'); + + // Add Seminary sidebar + $this->addSubAgent('Seminarybar'); + } + + + + + /** + * Set requested language. + * + * @param \nre\core\Request $request Current request + */ + private function setLanguage(\nre\core\Request $request) + { + // Set domain + $domain = \nre\configs\AppConfig::$app['genericname']; + + // Get language + $locale = $this->determineLanguage($request); + + // Set Locale and Load translation + if(!is_null($locale)) + { + //$locale = sprintf('%s_%s.UTF-8', $locale, strtoupper($locale)); + putenv("LC_ALL=$locale"); + setlocale(LC_ALL, $locale); + \Locale::setDefault($locale); + + bindtextdomain($domain, ROOT.DS.\nre\configs\AppConfig::$dirs['locale']); + textdomain($domain); + } + } + + + /** + * Determine which language is either requested directly or by browser + * setting. + * + * @param \nre\core\Request $request Current request + * @return string Requested language or default one + */ + private function determineLanguage(\nre\core\Request $request) + { + // Get supported languages + $supportedLanguages = \nre\configs\AppConfig::$app['languages']; + if(empty($supportedLanguages)) { + return null; + } + + // Get requested language + $language = $request->getGetParam('lang', 'language'); + if(!is_null($language) && array_key_exists($language, $supportedLanguages)) { + return $language; + } + + // Negotiate language + return $this->negotiateLanguage($supportedLanguages, $request->getBrowserLanguages()); + } + + + /** + * Negotiate which language the browser wants most out of the supported + * languages. + * + * @param array $supportedLanguages List of supported languages + * @param array $browserLanguages List of browser languages + * @return string Negotiated language or default one + */ + private function negotiateLanguage($supportedLanguages, $browserLanguages) + { + if(!is_null($browserLanguages)) + { + // Create array with languages and their ratings + $parsedLanguages = array(); + $languages = explode(',', $browserLanguages); + foreach($languages as &$language) + { + if(($pos = strpos($language, ';q=')) !== false) { + $parsedLanguages[substr($language, 1, min(2, $pos-1))] = floatval(substr($language, $pos+3)); + } + else { + $parsedLanguages[$language] = 1.0; + } + } + + // Sort languages by their ratings + arsort($parsedLanguages); + + // Get highest supported language + foreach($parsedLanguages as $language => $rating) { + if(array_key_exists($language, $supportedLanguages)) { + return $supportedLanguages[$language]; + } + } + } + + + // Return default language + return $supportedLanguages[array_keys($supportedLanguages)[0]]; + } + + } + +?> diff --git a/agents/toplevel/HtmlmailAgent.inc b/agents/toplevel/HtmlmailAgent.inc new file mode 100644 index 00000000..001886cd --- /dev/null +++ b/agents/toplevel/HtmlmailAgent.inc @@ -0,0 +1,52 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent for generating a HTML-mail message. + * + * @author Oliver Hanraths + */ + class HtmlmailAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new HtmlmailAgent. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + } + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubagent('mailreceiver', 'index', $request->getParam(3)); + } + + } + +?> diff --git a/agents/toplevel/TextmailAgent.inc b/agents/toplevel/TextmailAgent.inc new file mode 100644 index 00000000..ec4c34b2 --- /dev/null +++ b/agents/toplevel/TextmailAgent.inc @@ -0,0 +1,54 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\toplevel; + + + /** + * Agent for generating a simple text-mail message. + * + * @author Oliver Hanraths + */ + class TextmailAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new TextmailAgent. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + } + + + + + /** + * Action: index. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubagent('mailreceiver', 'index', $request->getParam(3)); + } + + } + +?> diff --git a/agents/toplevel/empty b/agents/toplevel/empty new file mode 100644 index 00000000..e69de29b diff --git a/apis/WebApi.inc b/apis/WebApi.inc new file mode 100644 index 00000000..eafde955 --- /dev/null +++ b/apis/WebApi.inc @@ -0,0 +1,250 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\apis; + + + /** + * WebApi-implementation. + * + * This class runs and renders an web-applictaion. + * + * @author coderkun + */ + class WebApi extends \nre\core\Api + { + + + + + /** + * Construct a new WebApi. + */ + public function __construct() + { + parent::__construct( + new \nre\requests\WebRequest(), + new \nre\responses\WebResponse() + ); + + // Add routes + $this->addRoutes(); + + // Disable screen logging for AJAX requests + if($this->request->getParam(0, 'toplevel') == 'ajax') { + $this->log->disableAutoLogToScreen(); + } + } + + + + + /** + * Run application. + * + * This method runs the application and handles all errors. + */ + public function run() + { + try { + $exception = parent::run(); + + if(!is_null($exception)) { + $this->errorService($exception); + } + } + catch(\nre\exceptions\ServiceUnavailableException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\FatalDatamodelException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\DatamodelException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\DriverNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\DriverNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ModelNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ModelNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\ControllerNotValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\ControllerNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\AgentNoaatValidException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE); + } + catch(\nre\exceptions\AgentNotFoundException $e) { + $this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND); + } + catch(\nre\exceptions\ClassNotValidException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + $this->errorService($e); + } + } + + + /** + * Render output. + */ + public function render() + { + // Generate output + parent::render(); + + + // Set HTTP-header + $this->response->header(); + + // Show output + echo $this->response->getOutput(); + } + + + + + /** + * Add routes (normal and reverse) defined in the AppConfig. + */ + private function addRoutes() + { + // Normal routes + if(property_exists('\nre\configs\AppConfig', 'routes')) { + foreach(\nre\configs\AppConfig::$routes as &$route) { + $this->request->addRoute($route[0], $route[1], $route[2]); + } + } + + // Reverse routes + if(property_exists('\nre\configs\AppConfig', 'reverseRoutes')) { + foreach(\nre\configs\AppConfig::$reverseRoutes as &$route) { + $this->request->addReverseRoute($route[0], $route[1], $route[2]); + } + } + + // Revalidate request + $this->request->revalidate(); + } + + + /** + * Handle an error that orrcurred during the + * loading/constructing/running of the ToplevelAgent. + * + * @param \Exception $exception Occurred exception + * @param int $httpStatusCode HTTP-statuscode + */ + private function error(\nre\core\Exception $exception, $httpStatusCode) + { + // Log error message + $this->log($exception, \nre\core\Logger::LOGMODE_AUTO); + + try { + // Set agent for handling errors + $this->response->clearParams(); + $this->response->addParams( + \nre\configs\AppConfig::$defaults['toplevel-error'], + \nre\configs\AppConfig::$defaults['intermediate-error'], + \nre\configs\CoreConfig::$defaults['action'], + $httpStatusCode + ); + + // Run this agent + parent::run(); + } + catch(\nre\exceptions\ServiceUnavailableException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\DatamodelException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\DriverNotValidException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\DriverNotFoundException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ModelNotValidException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ModelNotFoundException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ControllerNotValidException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\ControllerNotFoundException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\AgentNotValidException $e) { + $this->errorService($e); + } + catch(\nre\exceptions\AgentNotFoundException $e) { + $this->errorService($e); + } + catch(Exception $e) { + $this->errorService($e); + } + } + + + /** + * Handle a error which cannot be handles by the system (and + * HTTP 503). + * + * @param \Exception $exception Occurred exception + */ + private function errorService($exception) + { + // Log error message + $this->log($exception, \nre\core\Logger::LOGMODE_AUTO); + + // Set HTTP-rtatuscode + $this->response->addHeader(\nre\core\WebUtils::getHttpHeader(503)); + + + // Read and print static error file + $fileName = ROOT.DS.\nre\configs\CoreConfig::getClassDir('views').DS.\nre\configs\CoreConfig::$defaults['errorFile'].\nre\configs\CoreConfig::getFileExt('views'); + ob_start(); + include($fileName); + $this->response->setOutput(ob_get_clean()); + + + // Prevent further execution + $this->response->setExit(); + } + + } + +?> diff --git a/app/Controller.inc b/app/Controller.inc new file mode 100644 index 00000000..3603db23 --- /dev/null +++ b/app/Controller.inc @@ -0,0 +1,134 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z; + + + /** + * Abstract class for implementing an application Controller. + * + * @author Oliver Hanraths + */ + abstract class Controller extends \nre\core\Controller + { + /** + * Required components + * + * @var array + */ + public $components = array('auth'); + + /** + * Logger instance + * + * @var \nre\core\Logger + */ + protected $log = null; + /** + * Linker instance + * + * @var \nre\core\Linker + */ + protected $linker = null; + + + + + /** + * Construct a new application Controller. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param \nre\core\Agent $agent Corresponding Agent + */ + public function __construct($layoutName, $action, $agent) + { + parent::__construct($layoutName, $action, $agent); + + // Create logger + $this->log = new \nre\core\Logger(); + } + + + + /** + * Prefilter that is executed before running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Create linker + $this->linker = new \nre\core\Linker($request); + $this->set('linker', $this->linker); + + // Create text formatter + $this->set('t', new \hhu\z\TextFormatter($this->linker)); + + // Create date and time and number formatter + $this->set('dateFormatter', new \IntlDateFormatter( + //\nre\core\Config::getDefault('locale'), + \Locale::getDefault(), + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::NONE, + NULL + )); + $this->set('timeFormatter', new \IntlDateFormatter( + //\nre\core\Config::getDefault('locale'), + \Locale::getDefault(), + \IntlDateFormatter::NONE, + \IntlDateFormatter::SHORT, + NULL + )); + $this->set('numberFormatter', new \NumberFormatter( + //\nre\core\Config::getDefault('locale'), + \Locale::getDefault(), + \NumberFormatter::DEFAULT_STYLE + )); + } + + + /** + * Postfilter that is executed after running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function postFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::postFilter($request, $response); + } + + + + + /** + * Log an error. + * + * @param string $message Error message to log + * @param int $logMode Log mode (optional) + */ + protected function log($message, $logMode=\nre\core\Logger::LOGMODE_AUTO) + { + $this->log->log($message, $logMode); + } + + } + +?> diff --git a/app/Model.inc b/app/Model.inc new file mode 100644 index 00000000..84ccb7d7 --- /dev/null +++ b/app/Model.inc @@ -0,0 +1,42 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z; + + + /** + * Abstract class for implementing an application Model. + * + * @author Oliver Hanraths + */ + class Model extends \nre\models\DatabaseModel + { + + + + + /** + * Construct a new application Model. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + */ + public function __construct() + { + parent::__construct('mysqli', \nre\configs\AppConfig::$database); + } + + } + +?> diff --git a/app/TextFormatter.inc b/app/TextFormatter.inc new file mode 100644 index 00000000..71adba90 --- /dev/null +++ b/app/TextFormatter.inc @@ -0,0 +1,149 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z; + + + /** + * Class to format text with different syntax tags. + * + * @author Oliver Hanraths + */ + class TextFormatter + { + /** + * Linker to create links. + * + * @var \nre\core\Linker + */ + private $linker; + /** + * Media-Model to retrieve media data + * + * @static + * @var \nre\core\Model + */ + private static $Media = null; + + + + + /** + * Create a new text formatter. + * + * @param \nre\core\Linker $linker Linker to create links with + */ + public function __construct(\nre\core\Linker $linker) + { + $this->linker = $linker; + } + + + + + /** + * Format a string. + * + * @param string $string String to format + * @return string Formatted string + */ + public function t($string) + { + // Remove chars + $string = htmlspecialchars($string, ENT_NOQUOTES); + + // Important text + $string = str_replace('[strong]', '', $string); + $string = str_replace('[/strong]', '', $string); + + // Create tables + $string = preg_replace('/(\[table\])\s+/u', '$1', $string); + $string = preg_replace('/\s*(\[tr\])\s*/u', '$1', $string); + $string = preg_replace('%\s+(\[/table\])%u', '$1', $string); + $string = preg_replace('%\s*(\[/tr\])\s*%u', '$1', $string); + $string = str_replace('[table]', '

', $string); + $string = str_replace('[/table]', '

', $string); + $string = str_replace('[tr]', '', $string); + $string = str_replace('[/tr]', '', $string); + $string = str_replace('[th]', '', $string); + $string = str_replace('[/th]', '', $string); + $string = str_replace('[td]', '', $string); + $string = str_replace('[/td]', '', $string); + + // Create links + $string = preg_replace('!(^|\s)"([^"]+)":(https?://[^\s]+)(\s|$)!i', '$1$2$4', $string); + $string = preg_replace('!(^|\s)(https?://[^\s]+)(\s|$)!i', '$1$2$3', $string); + + // Handle Seminarymedia + $seminarymedia = array(); + preg_match_all('/\[seminarymedia:(\d+)\]/iu', $string, $matches); //, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); + $seminarymediaIds = array_unique($matches[1]); + foreach($seminarymediaIds as &$seminarymediaId) + { + $replacement = null; + if(!is_null(\hhu\z\controllers\SeminaryController::$seminary) && $this->loadMediaModel()) + { + try { + $medium = self::$Media->getSeminaryMediaById($seminarymediaId); + $replacement = sprintf( + '%s', + $this->linker->link(array('media','seminary', \hhu\z\controllers\SeminaryController::$seminary['url'],$medium['url'])), + $medium['description'] + ); + } + catch(\nre\exceptions\IdNotFoundException $e) { + } + } + + $seminarymedia[$seminarymediaId] = $replacement; + } + foreach($seminarymedia as $seminarymediaId => $replacement) { + $string = str_replace("[seminarymedia:$seminarymediaId]", $replacement, $string); + } + + + // Return processed string + return nl2br($string); + } + + + + + /** + * Load the Media-Model if it is not loaded + * + * @return boolean Whether the Media-Model has been loaded or not + */ + private function loadMediaModel() + { + // Do not load Model if it has already been loaded + if(!is_null(self::$Media)) { + return true; + } + + try { + // Load class + Model::load('media'); + + // Construct Model + self::$Media = Model::factory('media'); + } + catch(\Exception $e) { + } + + + // Return whether Media-Model has been loaded or not + return !is_null(self::$Media); + } + + } + +?> diff --git a/app/Utils.inc b/app/Utils.inc new file mode 100644 index 00000000..397eb029 --- /dev/null +++ b/app/Utils.inc @@ -0,0 +1,214 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z; + + + /** + * Class for implementing utility methods. + * + * @author Oliver Hanraths + */ + class Utils + { + + + /** + * Mask HTML-chars for save output. + * + * @static + * @param string $string String to be masked + * @return string Masked string + */ + public static function t($string) + { + return nl2br(htmlspecialchars($string)); + } + + + /** + * ‚htmlspecialchars‘ with support for UTF-8. + * + * @static + * @param string $string String to be masked + * @return string Masked string + */ + public static function htmlspecialchars_utf8($string) + { + return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); + } + + + /** + * Cut a string to the given length but only word boundaries. + * + * @static + * @param string $string String to cut + * @param int $length Length to cut string + * @param int $scope Maximum length to cut string regardless word boundaries + * @return string Cutted string + */ + public static function shortenString($string, $length, $scope) + { + // Determine length + $length = min($length, strlen($string)); + + // Look for word boundary + if(($pos = strpos($string, ' ', $length)) !== false) + { + // Check if boundary is outside of scope + if($pos > $length + $scope) { + $pos = strrpos(substr($string, 0, $pos), ' '); + } + } + else { + $pos = strlen($string); + } + + + // Cut string and return it + return substr($string, 0, $pos); + } + + + /** + * Send an e‑mail. + * + * @throws \hhu\z\exceptions\MailingException + * @param mixed $to One (string) or many (array) receivers + * @param string $messageAction Message Action + * @param boolean $html Whether mail should be formatted as HTML or not + * @param array $params Parameters to pass + * @param \nre\core\Linker $linker Linker instance + */ + public static function sendMail($to, $messageAction, $html=false, $params=null, $linker=null) + { + // Check configuration + if( + empty(\nre\configs\AppConfig::$mail['host']) || + empty(\nre\configs\AppConfig::$mail['port']) || + empty(\nre\configs\AppConfig::$mail['username']) + ) { + return; + } + + // Load classes + \hhu\z\lib\PHPMailerAutoload::load(); + \hhu\z\lib\PHPMailer::load(); + \hhu\z\lib\SMTP::load(); + + // Create mailer + $mail = new \PHPMailer(); + + // Configure mailer + $mail->isSMTP(); + $mail->Host = \nre\configs\AppConfig::$mail['host']; + $mail->Port = \nre\configs\AppConfig::$mail['port']; + $mail->SMTPAuth = true; + $mail->Username = \nre\configs\AppConfig::$mail['username']; + $mail->Password = \nre\configs\AppConfig::$mail['password']; + $mail->SMTPSecure = \nre\configs\AppConfig::$mail['secure']; + + // Set properties + $mail->CharSet = 'UTF-8'; + $mail->From = \nre\configs\AppConfig::$app['mailsender']; + $mail->FromName = \nre\configs\AppConfig::$app['name']; + if(!is_array($to)) { + $to = array($to); + } + foreach($to as &$receiver) { + $mail->addAddress($receiver); + } + if($html) { + $mail->isHTML(true); + } + + // Create message + try { + // Create MailApi + $mailApi = new \hhu\z\apis\MailApi(); + if(!is_null($linker)) { + $mailApi->setLinker($linker); + } + $mailApi->setMessage($messageAction); + $mailApi->setParams($params); + if($html) { + $mailApi->setHTML(); + } + + // Render message + $exception = $mailApi->run(); + if(!is_null($exception)) { + return $exception; + } + $mail->Subject = $mailApi->getSubject(); + $mail->Body = $mailApi->render(); + + // Try to render alternativ plaintext message + if($html) + { + $mailApi->setHTML(false); + + // Render message + $exception = $mailApi->run(); + if(is_null($exception)) + { + try { + $mail->AltBody = $mailApi->render(); + } + catch(\nre\core\Exception $e) { + // No alternative plaintext available + } + } + } + } + catch(\nre\core\Exception $e) { + throw new \hhu\z\exceptions\MailingException($e->getMessage()); + } + + + // Return status + if(!$mail->send()) { + throw new \hhu\z\exceptions\MailingException($mail->ErrorInfo); + } + } + + + /** + * Detect Mimetype of a file. + * + * @param string $filename Name of file to detect Mimetype of + * @param string $defaultMimetype Default Mimetype to use + * @return string Detected Mimetype of file + */ + public static function getMimetype($filename, $defaultMimetype=null) + { + $mimetype = (!is_null($defaultMimetype)) ? $defaultMimetype : 'application/octet-stream'; + // Use Fileinfo + if(class_exists('\finfo')) + { + $finfo = new \finfo(FILEINFO_MIME_TYPE); + if(!is_null($finfo)) { + $mimetype = $finfo->file($filename); + } + } + // Use deprecated mime_content_type() + elseif(function_exists('mime_content_type')) { + $mimetype = mime_content_type($filename); + } + + + return $mimetype; + } + + } + +?> diff --git a/app/agents/QuesttypeAgent.inc b/app/agents/QuesttypeAgent.inc new file mode 100644 index 00000000..60a8d9ac --- /dev/null +++ b/app/agents/QuesttypeAgent.inc @@ -0,0 +1,268 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents; + + + /** + * Abstract class for implementing a QuesttypeAgent. + * + * @author Oliver Hanraths + */ + abstract class QuesttypeAgent extends \nre\agents\BottomlevelAgent + { + /** + * Current request + * + * @var \nre\core\Request + */ + private $request; + /** + * Current response + * + * @var \nre\core\Response + */ + private $response; + + + + + /** + * Load a QuesttypeAgent. + * + * @static + * @throws \hhu\z\exceptions\QuesttypeAgentNotFoundException + * @throws \hhu\z\exceptions\QuesttypeAgentNotValidException + * @param string $questtypeName Name of the QuesttypeAgent to load + */ + public static function load($questtypeName) + { + // Determine full classname + $className = self::getClassName($questtypeName); + + try { + // Load class + static::loadClass($questtypeName, $className); + + // Validate class + static::checkClass($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \hhu\z\exceptions\QuesttypeAgentNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \hhu\z\exceptions\QuesttypeAgentNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a QuesttypeAgent (Factory Pattern). + * + * @static + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeControllerNotValidException + * @throws \hhu\z\exceptions\QuesttypeControllerNotFoundException + * @param string $questtypeName Name of the QuesttypeAgent to instantiate + * @param Request $request Current request + * @param Response $response Current respone + * @param Logger $log Log-system + */ + public static function factory($questtypeName, \nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + // Determine full classname + $className = self::getClassName($questtypeName); + + // Construct and return Questmodule + return new $className($request, $response, $log); + } + + + /** + * Determine the Agent-classname for the given Questtype-name. + * + * @static + * @param string $questtypeName Questtype-name to get Agent-classname of + * @param string $agentType Agent type of given Agent name + * @return string Classname for the Questtype-name + */ + private static function getClassName($questtypeName, $agentType=null) + { + $className = \nre\core\ClassLoader::concatClassNames($questtypeName, \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class())), 'agent'); + + + return \nre\configs\AppConfig::$app['namespace']."questtypes\\$className"; + } + + + /** + * Load the class of a QuesttypeAgent. + * + * @static + * @throws \nre\exceptions\ClassNotFoundException + * @param string $questtypeName Name of the QuesttypeAgent to load + * @param string $fullClassName Name of the class to load + */ + private static function loadClass($questtypeName, $fullClassName) + { + // Determine folder to look in + $className = explode('\\', $fullClassName); + $className = array_pop($className); + + // Determine filename + $fileName = ROOT.DS.\nre\configs\AppConfig::$dirs['questtypes'].DS.strtolower($questtypeName).DS.$className.\nre\configs\CoreConfig::getFileExt('includes'); + + // Check file + if(!file_exists($fileName)) + { + throw new \nre\exceptions\ClassNotFoundException( + $fullClassName + ); + } + + // Include file + include_once($fileName); + } + + + /** + * Check inheritance of the QuesttypeAgent-class. + * + * @static + * @throws \nre\exceptions\ClassNotValidException + * @param string $className Name of the class to check + * @param string $parentClassName Name of the parent class + */ + public static function checkClass($className, $parentClassName) + { + // Check if class is subclass of parent class + if(!is_subclass_of($className, $parentClassName)) { + throw new \nre\exceptions\ClassNotValidException( + $className + ); + } + } + + + + + /** + * Construct a new QuesttypeAgent. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeControllerNotValidException + * @throws \hhu\z\exceptions\QuesttypeControllerNotFoundException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Log-system + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + // Store values + $this->request = $request; + $this->response = $response; + + + // Call parent constructor + parent::__construct($request, $response, $log); + } + + + + + /** + * Save the answers of a Character for a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param array $answers Character answers for the Quest + */ + public function saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers) + { + $this->controller->saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + } + + + /** + * Check if answers of a Character for a Quest match the correct ones. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param array $answers Character answers for the Quest + */ + public function matchAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers) + { + return $this->controller->matchAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + } + + + + + /** + * Load the Controller of this Agent. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeControllerNotValidException + * @throws \hhu\z\exceptions\QuesttypeControllerNotFoundException + */ + protected function loadController() + { + // Determine Controller name + $controllerName = \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::getClassName(get_class($this))); + + // Determine ToplevelAgent + $toplevelAgentName = $this->response->getParam(0); + if(is_null($toplevelAgentName)) { + $toplevelAgentName = $this->request->getParam(0, 'toplevel'); + $this->response->addParam($toplevelAgentName); + } + + // Determine Action + $action = $this->response->getParam(2); + if(is_null($action)) { + $action = $this->request->getParam(2, 'action'); + $this->response->addParam($action); + } + + + // Load Controller + \hhu\z\controllers\QuesttypeController::load($controllerName); + + // Construct Controller + $this->controller = \hhu\z\controllers\QuesttypeController::factory($controllerName, $toplevelAgentName, $action, $this); + } + + } + +?> diff --git a/app/agents/ToplevelAgent.inc b/app/agents/ToplevelAgent.inc new file mode 100644 index 00000000..c77c8b21 --- /dev/null +++ b/app/agents/ToplevelAgent.inc @@ -0,0 +1,43 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents; + + + /** + * Abstract class for implementing an application Controller. + * + * @author Oliver Hanraths + */ + abstract class ToplevelAgent extends \nre\agents\ToplevelAgent + { + + + + + /** + * Construct a new ToplevlAgent + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param \nre\core\Logger $log Logger instance + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + + + // Set timezone + date_default_timezone_set(\nre\configs\AppConfig::$app['timeZone']); + } + } + +?> diff --git a/app/apis/MailApi.inc b/app/apis/MailApi.inc new file mode 100644 index 00000000..721bc547 --- /dev/null +++ b/app/apis/MailApi.inc @@ -0,0 +1,202 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\apis; + + + /** + * MailApi-implementation. + * + * This class runs and renders e‑mail text and subject. + * + * @author Oliver Hanraths + */ + class MailApi extends \nre\core\Api + { + + + + + /** + * Construct a new MailApi. + */ + public function __construct() + { + parent::__construct( + new \hhu\z\requests\MailRequest(), + new \hhu\z\responses\MailResponse() + ); + + // Set ToplevelAgent + $this->request->addParam(\nre\configs\AppConfig::$defaults['toplevel-mail']); + $this->request->addParam(\nre\configs\AppConfig::$defaults['intermediate-mail']); + } + + + + + /** + * Set linker instance for creating links. + * + * @param \nre\core\Linker $linker Linker instance for creating links + */ + public function setLinker(\nre\core\Linker $linker) + { + $this->request->setLinker($linker); + } + + + /** + * Use a ToplevelAgent for HTML-mail + * + * @param bool $html Whether to use HTML or not + */ + public function setHTML($html=true) + { + // Save params + $params = $this->request->getParams(1); + + // Set ToplevelAgent + $this->request->clearParams(); + if($html) { + $this->request->addParam(\nre\configs\AppConfig::$defaults['toplevel-htmlmail']); + } + else { + $this->request->addParam(\nre\configs\AppConfig::$defaults['toplevel-mail']); + } + + // Restore params + if(!empty($params)) { + $this->addParams($params); + } + } + + + /** + * Set the Action for the message to render. + * + * @param string $messageAgent Agent to handle the message + */ + public function setMessage($messageAgent) + { + // Save params + $params = $this->request->getParams(3); + + // Set messageAgent + $this->request->clearParams(2); + $this->request->addParam($messageAgent); + + // Restore params + if(!empty($params)) { + $this->addParams($params); + } + } + + + /** + * Set additional params to pass to the Action. + * + * @param array $params Additional params to set + */ + public function setParams($params) + { + // Add placeholder params + for($i=3; $irequest->getParams()); $i++) { + $this->request->addParam(null); + } + + // Set params + call_user_func_array( + array( + $this->request, + 'addParams' + ), + $params + ); + } + + + /** + * Return the subject set by the Controller. + * + * @return string Subject set by Controller + */ + public function getSubject() + { + return $this->response->getSubject(); + } + + + /** + * Run mailtext generation. + * + * This method runs the generation of mailtext. + * + * @return \Exception Occured exception or null + */ + public function run() + { + // Set response + $this->response->clearParams(); + foreach($this->request->getParams() as $param) { + $this->response->addParam($param); + } + + // Run + try { + $exception = parent::run(); + + + return $exception; + } + catch(\nre\Exception $e) { + return $e; + } + } + + + /** + * Render output. + * + * @return string Rendered output + */ + public function render() + { + // Generate output + parent::render(); + + + // Return output + return $this->response->getOutput(); + } + + + + + /** + * Add multiple request params. + * + * @param array $params Request params to add + */ + private function addParams($params) + { + call_user_func_array( + array( + $this->request, + 'addParams' + ), + $params + ); + } + + } + +?> diff --git a/app/controllers/IntermediateController.inc b/app/controllers/IntermediateController.inc new file mode 100644 index 00000000..49da3fc2 --- /dev/null +++ b/app/controllers/IntermediateController.inc @@ -0,0 +1,197 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Abstract class for implementing a Controller of an IntermediateAgent. + * + * @author Oliver Hanraths + */ + abstract class IntermediateController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('users', 'userroles', 'seminaries', 'characters'); + /** + * Current user + * + * @var array + */ + public static $user = null; + /** + * Title information + * + * @var array + */ + private $title = array(); + + + + + /** + * Construct a new IntermediateController. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param \nre\core\Agent $agent Corresponding Agent + */ + public function __construct($layoutName, $action, $agent) + { + parent::__construct($layoutName, $action, $agent); + } + + + + /** + * Prefilter that is executed before running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Get userdata + try { + self::$user = $this->Users->getUserById($this->Auth->getUserId()); + self::$user['roles'] = array_map(function($r) { return $r['name']; }, $this->Userroles->getUserrolesForUserById(self::$user['id'])); + } + catch(\nre\exceptions\IdNotFoundException $e) { + } + + // Check permissions + $this->checkPermission($request, $response); + + // Set userdata + $this->set('loggedUser', self::$user); + } + + + /** + * Postfilter that is executed after running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function postFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::postFilter($request, $response); + } + + + /** + * Return current title information. + * + * @return string Title information + */ + public function getTitle() + { + return $this->title; + } + + + + + /** + * Add a piece of information to the current title. + * + * @param string $title Title information + */ + protected function addTitle($title) + { + $this->title[] = $title; + } + + + /** + * Add a piece of information to the current title and localize + * it. + * + * @param string $title Title information + */ + protected function addTitleLocalized($title) + { + $title = gettext($title); + + $args = func_get_args(); + if(count($args) > 0) { + $title = call_user_func_array( + 'sprintf', + array_merge( + array($title), + array_slice($args, 1) + ) + ); + } + + + $this->title[] = $title; + } + + + + + /** + * Check user permissions. + * + * @throws \nre\exceptions\AccessDeniedException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + private function checkPermission(\nre\core\Request $request, \nre\core\Response $response) + { + // Determine user + $userRoles = array('guest'); + if(!is_null(self::$user)) { + $userRoles = self::$user['roles']; + } + + + // Do not check error pages + if($response->getParam(0, 'toplevel') == \nre\core\Config::getDefault('toplevel-error')) { + return; + } + if($response->getParam(1, 'intermediate') == \nre\core\Config::getDefault('intermediate-error')) { + return; + } + + // Determine permissions of Intermediate Controller for current action + $controller = $this->agent->controller; + $action = $this->request->getParam(2, 'action'); + if(!property_exists($controller, 'permissions')) { + return; // Allow if nothing is specified + } + if(!array_key_exists($action, $controller->permissions)) { + return; // Allow if Action is not specified + } + $permissions = $controller->permissions[$action]; + + + // Check permissions + if(count(array_intersect($userRoles, $permissions)) == 0) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + + } + +?> diff --git a/app/controllers/QuesttypeController.inc b/app/controllers/QuesttypeController.inc new file mode 100644 index 00000000..bdccb4cd --- /dev/null +++ b/app/controllers/QuesttypeController.inc @@ -0,0 +1,320 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Abstract class for implementing a QuesttypeController. + * + * @author Oliver Hanraths + */ + abstract class QuesttypeController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'quests', 'characters'); + + + + + /** + * Save the answers of a Character for a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param array $answers Character answers for the Quest + */ + public abstract function saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + + + /** + * Save additional data for the answers of a Character for a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param array $data Additional (POST-) data + */ + public abstract function saveDataForCharacterAnswers($seminary, $questgroup, $quest, $character, $data); + + + /** + * Check if answers of a Character for a Quest match the correct ones. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param array $answers Character answers for the Quest + * @return boolean True/false for a right/wrong answer or null for moderator evaluation + */ + public abstract function matchAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + + + /** + * Action: quest. + * + * Show the task of a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + * @param \Exception $exception Character submission exception + */ + public abstract function quest($seminary, $questgroup, $quest, $character, $exception); + + + /** + * Action: submission. + * + * Show the submission of a Character for a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + * @param array $character Current Character data + */ + public abstract function submission($seminary, $questgroup, $quest, $character); + + + /** + * Action: edittask. + * + * Edit the task of a Quest. + * + * @param array $seminary Current Seminary data + * @param array $questgroup Current Questgroup data + * @param array $quest Current Quest data + */ + public abstract function edittask($seminary, $questgroup, $quest); + + + + + /** + * Load a QuesttypeController. + * + * @static + * @throws \hhu\z\exceptions\QuesttypeControllerNotFoundException + * @throws \hhu\z\exceptions\QuesttypeControllerNotValidException + * @param string $controllerName Name of the QuesttypeController to load + */ + public static function load($controllerName) + { + // Determine full classname + $className = self::getClassName($controllerName); + + try { + // Load class + static::loadClass($controllerName, $className); + + // Validate class + static::checkClass($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \hhu\z\exceptions\QuesttypeControllerNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \hhu\z\exceptions\QuesttypeControllerNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a QuesttypeController (Factory Pattern). + * + * @static + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @param string $controllerName Name of the QuesttypeController to instantiate + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param \nre\core\Agent $agent Corresponding Agent + */ + public static function factory($controllerName, $layoutName, $action, $agent) + { + // Determine full classname + $className = self::getClassName($controllerName); + + // Construct and return Controller + return new $className($layoutName, $action, $agent); + } + + + /** + * Determine the Controller-classname for the given Questtype-name. + * + * @static + * @param string $questtypeName Questtype-name to get Controller-classname of + * @return string Classname for the Questtype-name + */ + private static function getClassName($questtypeName) + { + $className = \nre\core\ClassLoader::concatClassNames($questtypeName, \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class())), 'controller'); + + + return \nre\configs\AppConfig::$app['namespace']."questtypes\\$className"; + } + + + /** + * Load the class of a QuesttypeController + * + * @static + * @throws \nre\exceptions\ClassNotFoundException + * @param string $questtypeName Name of the QuesttypeController to load + * @param string $fullClassName Name of the class to load + */ + private static function loadClass($questtypeName, $fullClassName) + { + // Determine folder to look in + $className = explode('\\', $fullClassName); + $className = array_pop($className); + + // Determine filename + $fileName = ROOT.DS.\nre\configs\AppConfig::$dirs['questtypes'].DS.strtolower($questtypeName).DS.$className.\nre\configs\CoreConfig::getFileExt('includes'); + + // Check file + if(!file_exists($fileName)) + { + throw new \nre\exceptions\ClassNotFoundException( + $fullClassName + ); + } + + // Include file + include_once($fileName); + } + + + /** + * Check inheritance of the QuesttypeController-class. + * + * @static + * @throws \nre\exceptions\ClassNotValidException + * @param string $className Name of the class to check + * @param string $parentClassName Name of the parent class + */ + public static function checkClass($className, $parentClassName) + { + // Check if class is subclass of parent class + if(!is_subclass_of($className, $parentClassName)) { + throw new \nre\exceptions\ClassNotValidException( + $className + ); + } + } + + + + + /** + * Construct a new application Controller. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param Agent $agent Corresponding Agent + */ + public function __construct($layoutName, $action, $agent) + { + parent::__construct($layoutName, $action, $agent); + } + + + + + /** + * Load the Models of this Controller. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + */ + protected function loadModels() + { + // Load default models + parent::loadModels(); + + // Load QuesttypeModel + $this->loadModel(); + } + + + /** + * Load the Model of the Questtype. + * + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + */ + private function loadModel() + { + // Determine Model + $model = \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class($this)))); + + // Load class + \hhu\z\models\QuesttypeModel::load($model); + + // Construct Model + $modelName = ucfirst(strtolower($model)); + $this->$modelName = \hhu\z\models\QuesttypeModel::factory($model); + } + + + /** + * Load the View of this QuesttypeController. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + */ + protected function loadView($layoutName, $action) + { + // Check Layout name + if(is_null($layoutName)) { + return; + } + + // Determine controller name + $controllerName = \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::getClassName(get_class($this))); + + + // Load view + $this->view = \hhu\z\views\QuesttypeView::loadAndFactory($layoutName, $controllerName, $action); + } + + } + +?> diff --git a/app/controllers/SeminaryController.inc b/app/controllers/SeminaryController.inc new file mode 100644 index 00000000..34fbcb44 --- /dev/null +++ b/app/controllers/SeminaryController.inc @@ -0,0 +1,328 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Abstract class for implementing a Controller for a Seminary and its + * concepts. + * + * @author Oliver Hanraths + */ + abstract class SeminaryController extends \hhu\z\controllers\IntermediateController + { + /** + * Required components + * + * @var array + */ + public $components = array('achievement', 'auth', 'notification'); + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'characters', 'characterroles', 'xplevels', 'avatars', 'achievements'); + /** + * Current Seminary + * + * var array + */ + public static $seminary = null; + /** + * Character of current user and Seminary + * + * @var array + */ + public static $character = null; + + + + + /** + * Construct a new Seminary Controller. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param \nre\core\Agent $agent Corresponding Agent + */ + public function __construct($layoutName, $action, $agent) + { + parent::__construct($layoutName, $action, $agent); + } + + + + /** + * Prefilter that is executed before running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Get Seminary and Character data + try { + self::$seminary = $this->Seminaries->getSeminaryByUrl($this->request->getParam(3)); + if(!is_null(self::$user)) + { + self::$character = $this->Characters->getCharacterForUserAndSeminary(self::$user['id'], self::$seminary['id']); + self::$character['characterroles'] = array_map(function($r) { return $r['name']; }, $this->Characterroles->getCharacterrolesForCharacterById(self::$character['id'])); + try { + self::$character['xplevel'] = $this->Xplevels->getXPLevelById(self::$character['xplevel_id']); + self::$character['avatar'] = $this->Avatars->getAvatarByTypeAndLevel(self::$seminary['id'], self::$character['charactertype_url'], self::$character['xplevel']['level']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No Avatar available + } + } + } + catch(\nre\exceptions\IdNotFoundException $e) { + } + + // Check permissions + $this->checkPermission($request, $response); + + // Check achievements + $this->checkAchievements($request, $response, 'date'); + $this->checkAchievements($request, $response, 'achievement'); + + // Set Seminary and Character data + $this->set('loggedSeminary', self::$seminary); + $this->set('loggedCharacter', self::$character); + } + + + /** + * Postfilter that is executed after running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function postFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::postFilter($request, $response); + } + + + + /** + * Check user permissions. + * + * @throws AccessDeniedException + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + private function checkPermission(\nre\core\Request $request, \nre\core\Response $response) + { + // Do not check index page + if(is_null($request->getParam(3))) { + return; + } + + + // Determine permissions for current action + $action = $this->request->getParam(2, 'action'); + if(!property_exists($this, 'seminaryPermissions')) { + return; // Allow if nothing is specified + } + if(!array_key_exists($action, $this->seminaryPermissions)) { + return; // Allow if Action is not specified + } + $permissions = $this->seminaryPermissions[$action]; + + + // Check permissions + if(is_null(self::$character) || !array_key_exists('characterroles', self::$character) || count(array_intersect(self::$character['characterroles'], $permissions)) == 0) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + + + /** + * Check for newly achieved Achievements. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + * @param array $checkConditions Conditions to check + */ + protected function checkAchievements(\nre\core\Request $request, \nre\core\Response $response, $checkConditions=null) + { + // Do not check MediaController + if($this->request->getParam(0, 'toplevel') != \nre\configs\AppConfig::$defaults['toplevel']) { + return; + } + + // Check if Character is present + if(is_null(self::$character)) { + return; + } + + // Set conditions to check + if(!is_null($checkConditions) && !is_array($checkConditions)) { + $checkConditions = array($checkConditions); + } + + // Get unachieved Achievments + $achievements = $this->Achievements->getUnachhievedAchievementsForCharacter(self::$seminary['id'], self::$character['id']); + if(in_array('user', self::$character['characterroles'])) { + $achievements = array_merge($achievements, $this->Achievements->getUnachievedOnlyOnceAchievementsForSeminary(self::$seminary['id'])); + } + + // Check conditions + foreach($achievements as &$achievement) + { + // Check condition to test + if(!is_null($checkConditions) && !in_array($achievement['condition'], $checkConditions)) { + continue; + } + + // Check deadline + if(!is_null($achievement['deadline']) && $achievement['deadline'] < date('Y-m-d H:i:s')) { + continue; + } + + // Get conditions + $conditions = array(); + $progress = 0; + switch($achievement['condition']) + { + // Date conditions + case 'date': + $conditionsDate = $this->Achievements->getAchievementConditionsDate($achievement['id']); + foreach($conditionsDate as &$condition) + { + $conditions[] = array( + 'func' => 'checkAchievementConditionDate', + 'params' => array( + $condition['select'] + ) + ); + } + break; + // Character conditions + case 'character': + $conditionsCharacter = $this->Achievements->getAchievementConditionsCharacter($achievement['id']); + foreach($conditionsCharacter as &$condition) + { + $conditions[] = array( + 'func' => 'checkAchievementConditionCharacter', + 'params' => array( + $condition['field'], + $condition['value'], + self::$character['id'] + ) + ); + } + break; + // Quest conditions + case 'quest': + $conditionsQuest = $this->Achievements->getAchievementConditionsQuest($achievement['id']); + foreach($conditionsQuest as &$condition) + { + $conditions[] = array( + 'func' => 'checkAchievementConditionQuest', + 'params' => array( + $condition['field'], + $condition['count'], + $condition['value'], + $condition['status'], + $condition['groupby'], + $condition['quest_id'], + self::$character['id'] + ) + ); + } + break; + // Achievement conditions + case 'achievement': + $conditionsAchievement = $this->Achievements->getAchievementConditionsAchievement($achievement['id']); + foreach($conditionsAchievement as &$condition) + { + $conditions[] = array( + 'func' => 'checkAchievementConditionAchievement', + 'params' => array( + $condition['field'], + $condition['count'], + $condition['value'], + $condition['groupby'], + $condition['meta_achievement_id'], + self::$character['id'] + ) + ); + } + break; + } + + // Do not achieve Achievements without conditions + if(empty($conditions)) { + continue; + } + + // Check conditions + $achieved = ($achievement['all_conditions'] == 1); + foreach($conditions as &$condition) + { + // Calculate result of condition + $result = call_user_func_array( + array( + $this->Achievements, + $condition['func'] + ), + $condition['params'] + ); + + // The overall result and abort if possible + if($achievement['all_conditions']) + { + if(!$result) { + $achieved = false; + break; + } + } + else + { + if($result) { + $achieved = true; + break; + } + } + + } + + // Achievement achieved + if($achieved) + { + // Set status + $this->Achievements->setAchievementAchieved($achievement['id'], self::$character['id']); + + // Add notification + $this->Notification->addNotification( + \hhu\z\controllers\components\NotificationComponent::TYPE_ACHIEVEMENT, + $achievement['title'], + $this->linker->link(array('achievements', 'index', self::$seminary['url']), 0, true, null, true, $achievement['url']), + (!is_null($achievement['achieved_achievementsmedia_id']) ? $this->linker->link(array('media','achievement',self::$seminary['url'],$achievement['url'])) : null) + ); + } + } + } + + } + +?> diff --git a/app/empty b/app/empty new file mode 100644 index 00000000..e69de29b diff --git a/app/exceptions/FileCopyException.inc b/app/exceptions/FileCopyException.inc new file mode 100644 index 00000000..898cb7b1 --- /dev/null +++ b/app/exceptions/FileCopyException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: File copy went wrong + * + * @author Oliver Hanraths + */ + class FileCopyException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 204; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'File copy went wrong'; + + /** + * Nested error + * + * @var array + */ + private $nestedError; + + + + + /** + * Construct a new exception. + * + * @param array $nestedError Nested error + * @param string $message Error message + * @param int $code Error code + */ + function __construct($nestedError, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $nestedError['message'] + ); + + // Store values + $this->nestedError = $nestedError; + } + + + + + /** + * Get nested error. + * + * @return Nested error + */ + public function getNestedError() + { + return $this->nestedError; + } + + } + +?> diff --git a/app/exceptions/FileUploadException.inc b/app/exceptions/FileUploadException.inc new file mode 100644 index 00000000..c4c6b922 --- /dev/null +++ b/app/exceptions/FileUploadException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: File upload went wrong + * + * @author Oliver Hanraths + */ + class FileUploadException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 203; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'File upload went wrong'; + + /** + * Nested message + * + * @var string + */ + private $nestedMessage; + + + + + /** + * Construct a new exception. + * + * @param string $nestedMessage Nested message + * @param string $message Error message + * @param int $code Error code + */ + function __construct($nestedMessage=null, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $nestedMessage + ); + + // Store values + $this->nestedMessage = $nestedMessage; + } + + + + + /** + * Get nested message. + * + * @return Nested message + */ + public function getNestedMessage() + { + return $this->nestedMessage; + } + + } + +?> diff --git a/app/exceptions/MailingException.inc b/app/exceptions/MailingException.inc new file mode 100644 index 00000000..d68f8149 --- /dev/null +++ b/app/exceptions/MailingException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception during sending of an e‑mail. + * + * @author Oliver Hanraths + */ + class MailingException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 300; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'Error sending e‑mail'; + + /** + * Nested error message + * + * @var string + */ + private $error; + + + + + /** + * Construct a new exception. + * + * @param int $error Nested error message + * @param string $message Error message + * @param int $code Error code + */ + function __construct($error, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $error + ); + + // Store values + $this->error = $error; + } + + + + + /** + * Get nested error message. + * + * @return string Nested error message + */ + public function getError() + { + return $this->error; + } + + } + +?> diff --git a/app/exceptions/MaxFilesizeException.inc b/app/exceptions/MaxFilesizeException.inc new file mode 100644 index 00000000..bc7a1383 --- /dev/null +++ b/app/exceptions/MaxFilesizeException.inc @@ -0,0 +1,54 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: File exceeds size maximum. + * + * @author Oliver Hanraths + */ + class MaxFilesizeException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 202; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'File exceeds size maximum'; + + + + + /** + * Construct a new exception. + * + * @param string $message Error message + * @param int $code Error code + */ + function __construct($message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code + ); + } + + } + +?> diff --git a/app/exceptions/QuesttypeAgentNotFoundException.inc b/app/exceptions/QuesttypeAgentNotFoundException.inc new file mode 100644 index 00000000..0aeaf298 --- /dev/null +++ b/app/exceptions/QuesttypeAgentNotFoundException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeAgent not found. + * + * @author Oliver Hanraths + */ + class QuesttypeAgentNotFoundException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 101; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeAgent not found'; + + /** + * Name of the class that was not found + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the QuesttypeAgent that was not found + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store values + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the QuesttypeAgent that was not found. + * + * @return string Name of the QuesttypeAgent that was not found + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/QuesttypeAgentNotValidException.inc b/app/exceptions/QuesttypeAgentNotValidException.inc new file mode 100644 index 00000000..5efc8c3e --- /dev/null +++ b/app/exceptions/QuesttypeAgentNotValidException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeAgent not valid. + * + * @author Oliver Hanraths + */ + class QuesttypeAgentNotValidException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 102; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeAgent not valid'; + + /** + * Name of the invalid class + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the invalid QuesttypeAgent + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store value + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the invalid QuesttypeAgent. + * + * @return string Name of the invalid QuesttypeAgent + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/QuesttypeControllerNotFoundException.inc b/app/exceptions/QuesttypeControllerNotFoundException.inc new file mode 100644 index 00000000..e0447cc9 --- /dev/null +++ b/app/exceptions/QuesttypeControllerNotFoundException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeController not found. + * + * @author Oliver Hanraths + */ + class QuesttypeControllerNotFoundException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 103; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeController not found'; + + /** + * Name of the class that was not found + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the QuesttypeController that was not found + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store values + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the QuesttypeController that was not found. + * + * @return string Name of the QuesttypeController that was not found + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/QuesttypeControllerNotValidException.inc b/app/exceptions/QuesttypeControllerNotValidException.inc new file mode 100644 index 00000000..f4ccbee1 --- /dev/null +++ b/app/exceptions/QuesttypeControllerNotValidException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeController not valid. + * + * @author Oliver Hanraths + */ + class QuesttypeControllerNotValidException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 104; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeController not valid'; + + /** + * Name of the invalid class + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the invalid QuesttypeController + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store value + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the invalid QuesttypeController. + * + * @return string Name of the invalid QuesttypeController + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/QuesttypeModelNotFoundException.inc b/app/exceptions/QuesttypeModelNotFoundException.inc new file mode 100644 index 00000000..9a6d2294 --- /dev/null +++ b/app/exceptions/QuesttypeModelNotFoundException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeModel not found. + * + * @author Oliver Hanraths + */ + class QuesttypeModelNotFoundException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 105; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeModel not found'; + + /** + * Name of the class that was not found + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the QuesttypeModel that was not found + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store values + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the QuesttypeModel that was not found. + * + * @return string Name of the QuesttypeModel that was not found + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/QuesttypeModelNotValidException.inc b/app/exceptions/QuesttypeModelNotValidException.inc new file mode 100644 index 00000000..911701e8 --- /dev/null +++ b/app/exceptions/QuesttypeModelNotValidException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: QuesttypeModel not valid. + * + * @author Oliver Hanraths + */ + class QuesttypeModelNotValidException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 106; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'QuesttypeModel not valid'; + + /** + * Name of the invalid class + * + * @var string + */ + private $questtypeName; + + + + + /** + * Construct a new exception. + * + * @param string $questtypeName Name of the invalid QuesttypeModel + * @param string $message Error message + * @param int $code Error code + */ + function __construct($questtypeName, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $questtypeName + ); + + // Store value + $this->questtypeName = $questtypeName; + } + + + + + /** + * Get the name of the invalid QuesttypeModel. + * + * @return string Name of the invalid QuesttypeModel + */ + public function getClassName() + { + return $this->questtypeName; + } + + } + +?> diff --git a/app/exceptions/SubmissionNotValidException.inc b/app/exceptions/SubmissionNotValidException.inc new file mode 100644 index 00000000..0902c78a --- /dev/null +++ b/app/exceptions/SubmissionNotValidException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: Character submission not valid. + * + * @author Oliver Hanraths + */ + class SubmissionNotValidException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 200; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'Character submission not valid'; + + /** + * Nested exception + * + * @var Exception + */ + private $nestedException; + + + + + /** + * Construct a new exception. + * + * @param string $nestedException Nested exception + * @param string $message Error message + * @param int $code Error code + */ + function __construct($nestedException, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $nestedException + ); + + // Store value + $this->nestedException = $nestedException; + } + + + + + /** + * Get Nested exception. + * + * @return string Nested exception + */ + public function getNestedException() + { + return $this->nestedException; + } + + } + +?> diff --git a/app/exceptions/WrongFiletypeException.inc b/app/exceptions/WrongFiletypeException.inc new file mode 100644 index 00000000..13eb91df --- /dev/null +++ b/app/exceptions/WrongFiletypeException.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\exceptions; + + + /** + * Exception: File has wrong filetype. + * + * @author Oliver Hanraths + */ + class WrongFiletypeException extends \nre\core\Exception + { + /** + * Error code + * + * @var int + */ + const CODE = 201; + /** + * Error message + * + * @var string + */ + const MESSAGE = 'File has wrong type “%s”'; + + /** + * Type of file + * + * @var string + */ + private $type; + + + + + /** + * Construct a new exception. + * + * @param string $type Type of file + * @param string $message Error message + * @param int $code Error code + */ + function __construct($type, $message=self::MESSAGE, $code=self::CODE) + { + parent::__construct( + $message, + $code, + $type + ); + + // Store values + $this->type = $type; + } + + + + + /** + * Get type of file. + * + * @return Type of file + */ + public function getType() + { + return $this->type; + } + + } + +?> diff --git a/app/lib/PHPMailer.inc b/app/lib/PHPMailer.inc new file mode 100644 index 00000000..157db77a --- /dev/null +++ b/app/lib/PHPMailer.inc @@ -0,0 +1,3453 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\lib + { + + + /** + * Class to ensure that Compatibility library below is loaded. + * + * @author Oliver Hanraths + */ + class PHPMailer + { + + /** + * Call this function to ensure this file is loaded. + */ + public static function load() + { + } + + } + + } + + namespace { + +/** + * PHPMailer - PHP email creation and transport class. + * PHP Version 5 + * @package PHPMailer + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * PHPMailer - PHP email creation and transport class. + * @package PHPMailer + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + /** + * The PHPMailer Version number. + * @type string + */ + public $Version = '5.2.8'; + + /** + * Email priority. + * Options: 1 = High, 3 = Normal, 5 = low. + * @type int + */ + public $Priority = 3; + + /** + * The character set of the message. + * @type string + */ + public $CharSet = 'iso-8859-1'; + + /** + * The MIME Content-type of the message. + * @type string + */ + public $ContentType = 'text/plain'; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * @type string + */ + public $Encoding = '8bit'; + + /** + * Holds the most recent mailer error message. + * @type string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * @type string + */ + public $From = 'root@localhost'; + + /** + * The From name of the message. + * @type string + */ + public $FromName = 'Root User'; + + /** + * The Sender email (Return-Path) of the message. + * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. + * @type string + */ + public $Sender = ''; + + /** + * The Return-Path of the message. + * If empty, it will be set to either From or Sender. + * @type string + * @deprecated Email senders should never set a return-path header; + * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. + * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference + */ + public $ReturnPath = ''; + + /** + * The Subject of the message. + * @type string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * @type string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * @type string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator + * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @link http://kigkonsult.se/iCalcreator/ + * @type string + */ + public $Ical = ''; + + /** + * The complete compiled MIME message body. + * @access protected + * @type string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * @type string + * @access protected + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * @type string + * @access protected + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * @type int + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * @type string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * @type string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * @type bool + */ + public $UseSendmailOptions = true; + + /** + * Path to PHPMailer plugins. + * Useful if the SMTP class is not in the PHP include path. + * @type string + * @deprecated Should not be needed now there is an autoloader. + */ + public $PluginDir = ''; + + /** + * The email address that a reading confirmation should be sent to. + * @type string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in Message-Id and Received headers + * and as default HELO string. + * If empty, the value returned + * by SERVER_NAME is used or 'localhost.localdomain'. + * @type string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-Id header. + * If empty, a unique id will be generated. + * @type string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * @type string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * Hosts will be tried in order. + * @type string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * @type int + * @Todo Why is this needed when the SMTP class takes care of it? + */ + public $Port = 25; + + /** + * The SMTP HELO of the message. + * Default is $Hostname. + * @type string + * @see PHPMailer::$Hostname + */ + public $Helo = ''; + + /** + * The secure connection prefix. + * Options: "", "ssl" or "tls" + * @type string + */ + public $SMTPSecure = ''; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * @type bool + * @see PHPMailer::$Username + * @see PHPMailer::$Password + */ + public $SMTPAuth = false; + + /** + * SMTP username. + * @type string + */ + public $Username = ''; + + /** + * SMTP password. + * @type string + */ + public $Password = ''; + + /** + * SMTP auth type. + * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5 + * @type string + */ + public $AuthType = ''; + + /** + * SMTP realm. + * Used for NTLM auth + * @type string + */ + public $Realm = ''; + + /** + * SMTP workstation. + * Used for NTLM auth + * @type string + */ + public $Workstation = ''; + + /** + * The SMTP server timeout in seconds. + * @type int + */ + public $Timeout = 10; + + /** + * SMTP class debug output mode. + * Options: + * 0: no output + * 1: commands + * 2: data and commands + * 3: as 2 plus connection status + * 4: low level data output + * @type int + * @see SMTP::$do_debug + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * 'echo': Output plain-text as-is, appropriate for CLI + * 'html': Output escaped, line breaks converted to
, appropriate for browser output + * 'error_log': Output to error log as configured in php.ini + * @type string + * @see SMTP::$Debugoutput + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep SMTP connection open after each message. + * If this is set to true then to close the connection + * requires an explicit call to smtpClose(). + * @type bool + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * @type bool + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * @type array + * @todo This should really not be public + */ + public $SingleToArray = array(); + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Postfix VERP info + * @type bool + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * @type bool + */ + public $AllowEmpty = false; + + /** + * The default line ending. + * @note The default remains "\n". We force CRLF where we know + * it must be used via self::CRLF. + * @type string + */ + public $LE = "\n"; + + /** + * DKIM selector. + * @type string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email + * @type string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * @type string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * @example 'example.com' + * @type string + */ + public $DKIM_domain = ''; + + /** + * DKIM private key file path. + * @type string + */ + public $DKIM_private = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * bool $result result of the send action + * string $to email address of the recipient + * string $cc cc email addresses + * string $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * @type string + */ + public $action_function = ''; + + /** + * What to use in the X-Mailer header. + * Options: null for default, whitespace for none, or a string to use + * @type string + */ + public $XMailer = ''; + + /** + * An instance of the SMTP sender class. + * @type SMTP + * @access protected + */ + protected $smtp = null; + + /** + * The array of 'to' addresses. + * @type array + * @access protected + */ + protected $to = array(); + + /** + * The array of 'cc' addresses. + * @type array + * @access protected + */ + protected $cc = array(); + + /** + * The array of 'bcc' addresses. + * @type array + * @access protected + */ + protected $bcc = array(); + + /** + * The array of reply-to names and addresses. + * @type array + * @access protected + */ + protected $ReplyTo = array(); + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc, $replyto + * @type array + * @access protected + */ + protected $all_recipients = array(); + + /** + * The array of attachments. + * @type array + * @access protected + */ + protected $attachment = array(); + + /** + * The array of custom headers. + * @type array + * @access protected + */ + protected $CustomHeader = array(); + + /** + * The most recent Message-ID (including angular brackets). + * @type string + * @access protected + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * @type string + * @access protected + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * @type array + * @access protected + */ + protected $boundary = array(); + + /** + * The array of available languages. + * @type array + * @access protected + */ + protected $language = array(); + + /** + * The number of errors encountered. + * @type integer + * @access protected + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * @type string + * @access protected + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * @type string + * @access protected + */ + protected $sign_key_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * @type string + * @access protected + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * @type bool + * @access protected + */ + protected $exceptions = false; + + /** + * Error severity: message only, continue processing + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached + */ + const STOP_CRITICAL = 2; + + /** + * SMTP RFC standard line ending + */ + const CRLF = "\r\n"; + + /** + * Constructor + * @param bool $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = false) + { + $this->exceptions = ($exceptions == true); + //Make sure our autoloader is loaded + if (version_compare(PHP_VERSION, '5.1.2', '>=')) { + $autoload = spl_autoload_functions(); + if ($autoload === false or !in_array('PHPMailerAutoload', $autoload)) { + require 'PHPMailerAutoload.php'; + } + } + } + + /** + * Destructor. + */ + public function __destruct() + { + if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely + $this->smtpClose(); + } + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do) + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string $params Params + * @access private + * @return bool + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if (ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + if (ini_get('safe_mode') || !($this->UseSendmailOptions)) { + $result = @mail($to, $subject, $body, $header); + } else { + $result = @mail($to, $subject, $body, $header, $params); + } + return $result; + } + + /** + * Output debugging info via user-defined method. + * Only if debug output is enabled. + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * @param string $str + */ + protected function edebug($str) + { + if (!$this->SMTPDebug) { + return; + } + switch ($this->Debugoutput) { + case 'error_log': + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking display that's HTML-safe + echo htmlentities(preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, $this->CharSet) . "
\n"; + break; + case 'echo': + default: + echo $str."\n"; + } + } + + /** + * Sets message type to HTML or plain. + * @param bool $ishtml True for HTML mode. + * @return void + */ + public function isHTML($ishtml = true) + { + if ($ishtml) { + $this->ContentType = 'text/html'; + } else { + $this->ContentType = 'text/plain'; + } + } + + /** + * Send messages using SMTP. + * @return void + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + * @return void + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + * @return void + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + * @return void + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * @param string $address + * @param string $name + * @return bool true on success, false if address already used + */ + public function addAddress($address, $name = '') + { + return $this->addAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address + * @param string $name + * @return bool true on success, false if address already used + */ + public function addCC($address, $name = '') + { + return $this->addAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address + * @param string $name + * @return bool true on success, false if address already used + */ + public function addBCC($address, $name = '') + { + return $this->addAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-to" address. + * @param string $address + * @param string $name + * @return bool + */ + public function addReplyTo($address, $name = '') + { + return $this->addAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays. + * Addresses that have been added already return false, but do not throw exceptions + * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' + * @param string $address The email address to send to + * @param string $name + * @throws phpmailerException + * @return bool true on success, false if address already used or invalid in some way + * @access protected + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { + $this->setError($this->lang('Invalid recipient array') . ': ' . $kind); + $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); + if ($this->exceptions) { + throw new phpmailerException('Invalid recipient array: ' . $kind); + } + return false; + } + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!$this->validateAddress($address)) { + $this->setError($this->lang('invalid_address') . ': ' . $address); + $this->edebug($this->lang('invalid_address') . ': ' . $address); + if ($this->exceptions) { + throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); + } + return false; + } + if ($kind != 'Reply-To') { + if (!isset($this->all_recipients[strtolower($address)])) { + array_push($this->$kind, array($address, $name)); + $this->all_recipients[strtolower($address)] = true; + return true; + } + } else { + if (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = array($address, $name); + return true; + } + } + return false; + } + + /** + * Set the From and FromName properties. + * @param string $address + * @param string $name + * @param bool $auto Whether to also set the Sender address, defaults to true + * @throws phpmailerException + * @return bool + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!$this->validateAddress($address)) { + $this->setError($this->lang('invalid_address') . ': ' . $address); + $this->edebug($this->lang('invalid_address') . ': ' . $address); + if ($this->exceptions) { + throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); + } + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto) { + if (empty($this->Sender)) { + $this->Sender = $address; + } + } + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * @param string $address The email address to check + * @param string $patternselect A selector for the validation pattern to use : + * * `auto` Pick strictest one automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * @return bool + * @static + * @access public + */ + public static function validateAddress($address, $patternselect = 'auto') + { + if (!$patternselect or $patternselect == 'auto') { + if (defined('PCRE_VERSION')) { //Check this constant so it works when extension_loaded() is disabled + if (version_compare(PCRE_VERSION, '8.0') >= 0) { + $patternselect = 'pcre8'; + } else { + $patternselect = 'pcre'; + } + } else { + //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension + if (version_compare(PHP_VERSION, '5.2.0') >= 0) { + $patternselect = 'php'; + } else { + $patternselect = 'noregex'; + } + } + } + switch ($patternselect) { + case 'pcre8': + /** + * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. + * @link http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (bool)preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + break; + case 'pcre': + //An older regex that doesn't need a recent PCRE + return (bool)preg_match( + '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . + '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . + '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . + '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . + '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . + '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . + '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . + '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . + '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', + $address + ); + break; + case 'html5': + /** + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) + */ + return (bool)preg_match('/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address); + break; + case 'php': + default: + return (bool)filter_var($address, FILTER_VALIDATE_EMAIL); + break; + case 'noregex': + //No PCRE! Do something _very_ approximate! + //Check the address is 3 chars or longer and contains an @ that's not the first or last char + return (strlen($address) >= 3 + and strpos($address, '@') >= 1 + and strpos($address, '@') != strlen($address) - 1); + break; + } + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * @throws phpmailerException + * @return bool false on error - See the ErrorInfo property for details of the error. + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + return $this->postSend(); + } catch (phpmailerException $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + } + + /** + * Prepare a message for sending. + * @throws phpmailerException + * @return bool + */ + public function preSend() + { + try { + $this->mailHeader = ''; + if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { + throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); + } + + // Set whether the message is multipart/alternative + if (!empty($this->AltBody)) { + $this->ContentType = 'multipart/alternative'; + } + + $this->error_count = 0; // reset errors + $this->setMessageType(); + // Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty and empty($this->Body)) { + throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); + } + + $this->MIMEHeader = $this->createHeader(); + $this->MIMEBody = $this->createBody(); + + // To capture the complete message when using mail(), create + // an extra header list which createHeader() doesn't fold in + if ($this->Mailer == 'mail') { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader(trim($this->Subject))) + ); + } + + // Sign with DKIM if enabled + if (!empty($this->DKIM_domain) + && !empty($this->DKIM_private) + && !empty($this->DKIM_selector) + && !empty($this->DKIM_domain) + && file_exists($this->DKIM_private)) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . + str_replace("\r\n", "\n", $header_dkim) . self::CRLF; + } + return true; + + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + } + + /** + * Actually send a message. + * Send the email via the selected mechanism + * @throws phpmailerException + * @return bool + */ + public function postSend() + { + try { + // Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer.'Send'; + if (method_exists($this, $sendMethod)) { + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + } + return false; + } + + /** + * Send mail using the $Sendmail program. + * @param string $header The message headers + * @param string $body The message body + * @see PHPMailer::$Sendmail + * @throws phpmailerException + * @access protected + * @return bool + */ + protected function sendmailSend($header, $body) + { + if ($this->Sender != '') { + if ($this->Mailer == 'qmail') { + $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } else { + $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } + } else { + if ($this->Mailer == 'qmail') { + $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail)); + } else { + $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail)); + } + } + if ($this->SingleTo === true) { + foreach ($this->SingleToArray as $val) { + if (!@$mail = popen($sendmail, 'w')) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fputs($mail, 'To: ' . $val . "\n"); + fputs($mail, $header); + fputs($mail, $body); + $result = pclose($mail); + // implement call back function if it exists + $isSent = ($result == 0) ? 1 : 0; + $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body, $this->From); + if ($result != 0) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + if (!@$mail = popen($sendmail, 'w')) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fputs($mail, $header); + fputs($mail, $body); + $result = pclose($mail); + // implement call back function if it exists + $isSent = ($result == 0) ? 1 : 0; + $this->doCallback($isSent, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); + if ($result != 0) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + return true; + } + + /** + * Send mail using the PHP mail() function. + * @param string $header The message headers + * @param string $body The message body + * @link http://www.php.net/manual/en/book.mail.php + * @throws phpmailerException + * @access protected + * @return bool + */ + protected function mailSend($header, $body) + { + $toArr = array(); + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = implode(', ', $toArr); + + if (empty($this->Sender)) { + $params = ' '; + } else { + $params = sprintf('-f%s', $this->Sender); + } + if ($this->Sender != '' and !ini_get('safe_mode')) { + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $val) { + $result = $this->mailPassthru($val, $this->Subject, $body, $header, $params); + // implement call back function if it exists + $isSent = ($result == 1) ? 1 : 0; + $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body, $this->From); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + // implement call back function if it exists + $isSent = ($result == 1) ? 1 : 0; + $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); + } + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP; + } + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * Uses the PHPMailerSMTP class by default. + * @see PHPMailer::getSMTPInstance() to use a different class. + * @param string $header The message headers + * @param string $body The message body + * @throws phpmailerException + * @uses SMTP + * @access protected + * @return bool + */ + protected function smtpSend($header, $body) + { + $bad_rcpt = array(); + + if (!$this->smtpConnect()) { + throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); + } + + // Attempt to send to all recipients + foreach ($this->to as $to) { + if (!$this->smtp->recipient($to[0])) { + $bad_rcpt[] = $to[0]; + $isSent = 0; + } else { + $isSent = 1; + } + $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body, $this->From); + } + foreach ($this->cc as $cc) { + if (!$this->smtp->recipient($cc[0])) { + $bad_rcpt[] = $cc[0]; + $isSent = 0; + } else { + $isSent = 1; + } + $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body, $this->From); + } + foreach ($this->bcc as $bcc) { + if (!$this->smtp->recipient($bcc[0])) { + $bad_rcpt[] = $bcc[0]; + $isSent = 0; + } else { + $isSent = 1; + } + $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body, $this->From); + } + + //Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { + throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + if ($this->SMTPKeepAlive == true) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + if (count($bad_rcpt) > 0) { //Create error message for any bad addresses + throw new phpmailerException( + $this->lang('recipients_failed') . implode(', ', $bad_rcpt), + self::STOP_CONTINUE + ); + } + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * @param array $options An array of options compatible with stream_context_create() + * @uses SMTP + * @access public + * @throws phpmailerException + * @return bool + */ + public function smtpConnect($options = array()) + { + if (is_null($this->smtp)) { + $this->smtp = $this->getSMTPInstance(); + } + + //Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = array(); + if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { + //Not a valid host entry + continue; + } + //$hostinfo[2]: optional ssl or tls prefix + //$hostinfo[3]: the hostname + //$hostinfo[4]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used + $prefix = ''; + $tls = ($this->SMTPSecure == 'tls'); + if ($hostinfo[2] == 'ssl' or ($hostinfo[2] == '' and $this->SMTPSecure == 'ssl')) { + $prefix = 'ssl://'; + $tls = false; //Can't have SSL and TLS at once + } elseif ($hostinfo[2] == 'tls') { + $tls = true; + //tls doesn't use a prefix + } + $host = $hostinfo[3]; + $port = $this->Port; + $tport = (integer)$hostinfo[4]; + if ($tport > 0 and $tport < 65536) { + $port = $tport; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + + if ($tls) { + if (!$this->smtp->startTLS()) { + throw new phpmailerException($this->lang('connect_host')); + } + //We must resend HELO after tls negotiation + $this->smtp->hello($hello); + } + if ($this->SMTPAuth) { + if (!$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->Realm, + $this->Workstation + ) + ) { + throw new phpmailerException($this->lang('authenticate')); + } + } + return true; + } catch (phpmailerException $exc) { + $lastexception = $exc; + //We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + //If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + //As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions and !is_null($lastexception)) { + throw $lastexception; + } + return false; + } + + /** + * Close the active SMTP session if one exists. + * @return void + */ + public function smtpClose() + { + if ($this->smtp !== null) { + if ($this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + } + + /** + * Set the language for error messages. + * Returns false if it cannot load the language file. + * The default language is English. + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * @return bool + * @access public + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + //Define full set of translatable strings in English + $PHPMAILER_LANG = array( + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ' + ); + if (empty($lang_path)) { + //Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; + } + $foundlang = true; + $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + if ($langcode != 'en') { //There is no English translation file + //Make sure language file path is readable + if (!is_readable($lang_file)) { + $foundlang = false; + } else { + //Overwrite language-specific strings. + //This way we'll never have missing translations. + $foundlang = include $lang_file; + } + } + $this->language = $PHPMAILER_LANG; + return ($foundlang == true); //Returns false if language not found + } + + /** + * Get the array of strings for the current language. + * @return array + */ + public function getTranslations() + { + return $this->language; + } + + /** + * Create recipient headers. + * @access public + * @param string $type + * @param array $addr An array of recipient, + * where each recipient is a 2-element indexed array with element 0 containing an address + * and element 1 containing a name, like: + * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) + * @return string + */ + public function addrAppend($type, $addr) + { + $addresses = array(); + foreach ($addr as $address) { + $addresses[] = $this->addrFormat($address); + } + return $type . ': ' . implode(', ', $addresses) . $this->LE; + } + + /** + * Format an address for use in a message header. + * @access public + * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name + * like array('joe@example.com', 'Joe User') + * @return string + */ + public function addrFormat($addr) + { + if (empty($addr[1])) { // No name provided + return $this->secureHeader($addr[0]); + } else { + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( + $addr[0] + ) . '>'; + } + } + + /** + * Word-wrap message. + * For use with mailers that do not automatically perform wrapping + * and for quoted-printable encoded messages. + * Original written by philippe. + * @param string $message The message to wrap + * @param integer $length The line length to wrap to + * @param bool $qp_mode Whether to run in Quoted-Printable mode + * @access public + * @return string + */ + public function wrapText($message, $length, $qp_mode = false) + { + $soft_break = ($qp_mode) ? sprintf(' =%s', $this->LE) : $this->LE; + // If utf-8 encoding is used, we will need to make sure we don't + // split multibyte characters when we wrap + $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); + $lelen = strlen($this->LE); + $crlflen = strlen(self::CRLF); + + $message = $this->fixEOL($message); + if (substr($message, -$lelen) == $this->LE) { + $message = substr($message, 0, -$lelen); + } + + $line = explode($this->LE, $message); // Magic. We know fixEOL uses $LE + $message = ''; + for ($i = 0; $i < count($line); $i++) { + $line_part = explode(' ', $line[$i]); + $buf = ''; + for ($e = 0; $e < count($line_part); $e++) { + $word = $line_part[$e]; + if ($qp_mode and (strlen($word) > $length)) { + $space_left = $length - strlen($buf) - $crlflen; + if ($e != 0) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == '=') { + $len--; + } elseif (substr($word, $len - 2, 1) == '=') { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf('=%s', self::CRLF); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while (strlen($word) > 0) { + if ($length <= 0) { + break; + } + $len = $length; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == '=') { + $len--; + } elseif (substr($word, $len - 2, 1) == '=') { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + + if (strlen($word) > 0) { + $message .= $part . sprintf('=%s', self::CRLF); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + $buf .= ($e == 0) ? $word : (' ' . $word); + + if (strlen($buf) > $length and $buf_o != '') { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + } + $message .= $buf . self::CRLF; + } + + return $message; + } + + /** + * Find the last character boundary prior to $maxLength in a utf-8 + * quoted (printable) encoded string. + * Original written by Colin Brown. + * @access public + * @param string $encodedText utf-8 QP text + * @param int $maxLength find last character boundary prior to this length + * @return int + */ + public function utf8CharBoundary($encodedText, $maxLength) + { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, '='); + if ($encodedCharPos !== false) { + // Found start of encoded character byte within $lookBack block. + // Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { // Single byte character. + // If the encoded char was found at pos 0, it will fit + // otherwise reduce maxLength to start of the encoded char + $maxLength = ($encodedCharPos == 0) ? $maxLength : + $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec >= 192) { // First byte of a multi byte character + // Reduce maxLength to split at start of character + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + // No encoded character found + $foundSplitPos = true; + } + } + return $maxLength; + } + + /** + * Set the body wrapping. + * @access public + * @return void + */ + public function setWordWrap() + { + if ($this->WordWrap < 1) { + return; + } + + switch ($this->message_type) { + case 'alt': + case 'alt_inline': + case 'alt_attach': + case 'alt_inline_attach': + $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->wrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assemble message headers. + * @access public + * @return string The assembled headers + */ + public function createHeader() + { + $result = ''; + + // Set the boundaries + $uniq_id = md5(uniqid(time())); + $this->boundary[1] = 'b1_' . $uniq_id; + $this->boundary[2] = 'b2_' . $uniq_id; + $this->boundary[3] = 'b3_' . $uniq_id; + + if ($this->MessageDate == '') { + $this->MessageDate = self::rfcDate(); + } + $result .= $this->headerLine('Date', $this->MessageDate); + + + // To be created automatically by mail() + if ($this->SingleTo === true) { + if ($this->Mailer != 'mail') { + foreach ($this->to as $toaddr) { + $this->SingleToArray[] = $this->addrFormat($toaddr); + } + } + } else { + if (count($this->to) > 0) { + if ($this->Mailer != 'mail') { + $result .= $this->addrAppend('To', $this->to); + } + } elseif (count($this->cc) == 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + } + + $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); + + // sendmail and mail() extract Cc from the header before sending + if (count($this->cc) > 0) { + $result .= $this->addrAppend('Cc', $this->cc); + } + + // sendmail and mail() extract Bcc from the header before sending + if (( + $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' + ) + and count($this->bcc) > 0 + ) { + $result .= $this->addrAppend('Bcc', $this->bcc); + } + + if (count($this->ReplyTo) > 0) { + $result .= $this->addrAppend('Reply-To', $this->ReplyTo); + } + + // mail() sets the subject itself + if ($this->Mailer != 'mail') { + $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); + } + + if ($this->MessageID != '') { + $this->lastMessageID = $this->MessageID; + } else { + $this->lastMessageID = sprintf('<%s@%s>', $uniq_id, $this->ServerHostname()); + } + $result .= $this->HeaderLine('Message-ID', $this->lastMessageID); + $result .= $this->headerLine('X-Priority', $this->Priority); + if ($this->XMailer == '') { + $result .= $this->headerLine( + 'X-Mailer', + 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)' + ); + } else { + $myXmailer = trim($this->XMailer); + if ($myXmailer) { + $result .= $this->headerLine('X-Mailer', $myXmailer); + } + } + + if ($this->ConfirmReadingTo != '') { + $result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); + } + + // Add custom headers + for ($index = 0; $index < count($this->CustomHeader); $index++) { + $result .= $this->headerLine( + trim($this->CustomHeader[$index][0]), + $this->encodeHeader(trim($this->CustomHeader[$index][1])) + ); + } + if (!$this->sign_key_file) { + $result .= $this->headerLine('MIME-Version', '1.0'); + $result .= $this->getMailMIME(); + } + + return $result; + } + + /** + * Get the message MIME type headers. + * @access public + * @return string + */ + public function getMailMIME() + { + $result = ''; + $ismultipart = true; + switch ($this->message_type) { + case 'inline': + $result .= $this->headerLine('Content-Type', 'multipart/related;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + case 'attach': + case 'inline_attach': + case 'alt_attach': + case 'alt_inline_attach': + $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + case 'alt': + case 'alt_inline': + $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + default: + // Catches case 'plain': and case '': + $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); + $ismultipart = false; + break; + } + //RFC1341 part 5 says 7bit is assumed if not specified + if ($this->Encoding != '7bit') { + //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + if ($ismultipart) { + if ($this->Encoding == '8bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); + } + //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + } else { + $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + } + } + + if ($this->Mailer != 'mail') { + $result .= $this->LE; + } + + return $result; + } + + /** + * Returns the whole MIME message. + * Includes complete headers and body. + * Only valid post preSend(). + * @see PHPMailer::preSend() + * @access public + * @return string + */ + public function getSentMIMEMessage() + { + return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody; + } + + + /** + * Assemble the message body. + * Returns an empty string on failure. + * @access public + * @throws phpmailerException + * @return string The assembled message body + */ + public function createBody() + { + $body = ''; + + if ($this->sign_key_file) { + $body .= $this->getMailMIME() . $this->LE; + } + + $this->setWordWrap(); + + $bodyEncoding = $this->Encoding; + $bodyCharSet = $this->CharSet; + if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { + $bodyEncoding = '7bit'; + $bodyCharSet = 'us-ascii'; + } + $altBodyEncoding = $this->Encoding; + $altBodyCharSet = $this->CharSet; + if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { + $altBodyEncoding = '7bit'; + $altBodyCharSet = 'us-ascii'; + } + switch ($this->message_type) { + case 'inline': + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[1]); + break; + case 'attach': + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'inline_attach': + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt': + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + if (!empty($this->Ical)) { + $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); + $body .= $this->encodeString($this->Ical, $this->Encoding); + $body .= $this->LE . $this->LE; + } + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_inline': + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= $this->LE; + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_attach': + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt_inline_attach': + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->textLine('--' . $this->boundary[2]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[3]); + $body .= $this->LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + default: + // catch case 'plain' and case '' + $body .= $this->encodeString($this->Body, $bodyEncoding); + break; + } + + if ($this->isError()) { + $body = ''; + } elseif ($this->sign_key_file) { + try { + if (!defined('PKCS7_TEXT')) { + throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); + } + //TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 + $file = tempnam(sys_get_temp_dir(), 'mail'); + file_put_contents($file, $body); //TODO check this worked + $signed = tempnam(sys_get_temp_dir(), 'signed'); + if (@openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), + null + ) + ) { + @unlink($file); + $body = file_get_contents($signed); + @unlink($signed); + } else { + @unlink($file); + @unlink($signed); + throw new phpmailerException($this->lang('signing') . openssl_error_string()); + } + } catch (phpmailerException $exc) { + $body = ''; + if ($this->exceptions) { + throw $exc; + } + } + } + return $body; + } + + /** + * Return the start of a message boundary. + * @access protected + * @param string $boundary + * @param string $charSet + * @param string $contentType + * @param string $encoding + * @return string + */ + protected function getBoundary($boundary, $charSet, $contentType, $encoding) + { + $result = ''; + if ($charSet == '') { + $charSet = $this->CharSet; + } + if ($contentType == '') { + $contentType = $this->ContentType; + } + if ($encoding == '') { + $encoding = $this->Encoding; + } + $result .= $this->textLine('--' . $boundary); + $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); + $result .= $this->LE; + //RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + } + $result .= $this->LE; + + return $result; + } + + /** + * Return the end of a message boundary. + * @access protected + * @param string $boundary + * @return string + */ + protected function endBoundary($boundary) + { + return $this->LE . '--' . $boundary . '--' . $this->LE; + } + + /** + * Set the message type. + * PHPMailer only supports some preset message types, + * not arbitrary MIME structures. + * @access protected + * @return void + */ + protected function setMessageType() + { + $this->message_type = array(); + if ($this->alternativeExists()) { + $this->message_type[] = 'alt'; + } + if ($this->inlineImageExists()) { + $this->message_type[] = 'inline'; + } + if ($this->attachmentExists()) { + $this->message_type[] = 'attach'; + } + $this->message_type = implode('_', $this->message_type); + if ($this->message_type == '') { + $this->message_type = 'plain'; + } + } + + /** + * Format a header line. + * @access public + * @param string $name + * @param string $value + * @return string + */ + public function headerLine($name, $value) + { + return $name . ': ' . $value . $this->LE; + } + + /** + * Return a formatted mail line. + * @access public + * @param string $value + * @return string + */ + public function textLine($value) + { + return $value . $this->LE; + } + + /** + * Add an attachment from a path on the filesystem. + * Returns false if the file could not be found or read. + * @param string $path Path to the attachment. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @param string $disposition Disposition to use + * @throws phpmailerException + * @return bool + */ + public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') + { + try { + if (!@is_file($path)) { + throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + //If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($path); + } + + $filename = basename($path); + if ($name == '') { + $name = $filename; + } + + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => 0 + ); + + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + return true; + } + + /** + * Return the array of attachments. + * @return array + */ + public function getAttachments() + { + return $this->attachment; + } + + /** + * Attach all file, string, and binary attachments to the message. + * Returns an empty string on failure. + * @access protected + * @param string $disposition_type + * @param string $boundary + * @return string + */ + protected function attachAll($disposition_type, $boundary) + { + // Return text of body + $mime = array(); + $cidUniq = array(); + $incl = array(); + + // Add all attachments + foreach ($this->attachment as $attachment) { + // Check if it is a valid disposition_filter + if ($attachment[6] == $disposition_type) { + // Check for string attachment + $string = ''; + $path = ''; + $bString = $attachment[5]; + if ($bString) { + $string = $attachment[0]; + } else { + $path = $attachment[0]; + } + + $inclhash = md5(serialize($attachment)); + if (in_array($inclhash, $incl)) { + continue; + } + $incl[] = $inclhash; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + if ($disposition == 'inline' && isset($cidUniq[$cid])) { + continue; + } + $cidUniq[$cid] = true; + + $mime[] = sprintf('--%s%s', $boundary, $this->LE); + $mime[] = sprintf( + 'Content-Type: %s; name="%s"%s', + $type, + $this->encodeHeader($this->secureHeader($name)), + $this->LE + ); + //RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); + } + + if ($disposition == 'inline') { + $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); + } + + // If a filename contains any of these chars, it should be quoted, + // but not otherwise: RFC2183 & RFC2045 5.1 + // Fixes a warning in IETF's msglint MIME checker + // Allow for bypassing the Content-Disposition header totally + if (!(empty($disposition))) { + if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename="%s"%s', + $disposition, + $this->encodeHeader($this->secureHeader($name)), + $this->LE . $this->LE + ); + } else { + $mime[] = sprintf( + 'Content-Disposition: %s; filename=%s%s', + $disposition, + $this->encodeHeader($this->secureHeader($name)), + $this->LE . $this->LE + ); + } + } else { + $mime[] = $this->LE; + } + + // Encode as string attachment + if ($bString) { + $mime[] = $this->encodeString($string, $encoding); + if ($this->isError()) { + return ''; + } + $mime[] = $this->LE . $this->LE; + } else { + $mime[] = $this->encodeFile($path, $encoding); + if ($this->isError()) { + return ''; + } + $mime[] = $this->LE . $this->LE; + } + } + } + + $mime[] = sprintf('--%s--%s', $boundary, $this->LE); + + return implode('', $mime); + } + + /** + * Encode a file attachment in requested format. + * Returns an empty string on failure. + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @throws phpmailerException + * @see EncodeFile(encodeFile + * @access protected + * @return string + */ + protected function encodeFile($path, $encoding = 'base64') + { + try { + if (!is_readable($path)) { + throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $magic_quotes = get_magic_quotes_runtime(); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime(0); + } else { + ini_set('magic_quotes_runtime', 0); + } + } + $file_buffer = file_get_contents($path); + $file_buffer = $this->encodeString($file_buffer, $encoding); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime($magic_quotes); + } else { + ini_set('magic_quotes_runtime', $magic_quotes); + } + } + return $file_buffer; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + return ''; + } + } + + /** + * Encode a string in requested format. + * Returns an empty string on failure. + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @access public + * @return string + */ + public function encodeString($str, $encoding = 'base64') + { + $encoded = ''; + switch (strtolower($encoding)) { + case 'base64': + $encoded = chunk_split(base64_encode($str), 76, $this->LE); + break; + case '7bit': + case '8bit': + $encoded = $this->fixEOL($str); + //Make sure it ends with a line break + if (substr($encoded, -(strlen($this->LE))) != $this->LE) { + $encoded .= $this->LE; + } + break; + case 'binary': + $encoded = $str; + break; + case 'quoted-printable': + $encoded = $this->encodeQP($str); + break; + default: + $this->setError($this->lang('encoding') . $encoding); + break; + } + return $encoded; + } + + /** + * Encode a header string optimally. + * Picks shortest of Q, B, quoted-printable or none. + * @access public + * @param string $str + * @param string $position + * @return string + */ + public function encodeHeader($str, $position = 'text') + { + $matchcount = 0; + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + // Can't use addslashes as we don't know the value of magic_quotes_sybase + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return ($encoded); + } else { + return ("\"$encoded\""); + } + } + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + /** @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $matchcount = preg_match_all('/[()"]/', $str, $matches); + // Intentional fall-through + case 'text': + default: + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($matchcount == 0) { //There are no chars that need encoding + return ($str); + } + + $maxlen = 75 - 7 - strlen($this->CharSet); + // Try to select the encoding which should produce the shortest output + if ($matchcount > strlen($str) / 3) { + //More than a third of the content will need encoding, so B encoding will be most efficient + $encoding = 'B'; + if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character + $encoded = $this->base64EncodeWrapMB($str, "\n"); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + } else { + $encoding = 'Q'; + $encoded = $this->encodeQ($str, $position); + $encoded = $this->wrapText($encoded, $maxlen, true); + $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); + } + + $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); + $encoded = trim(str_replace("\n", $this->LE, $encoded)); + + return $encoded; + } + + /** + * Check if a string contains multi-byte characters. + * @access public + * @param string $str multi-byte text to wrap encode + * @return bool + */ + public function hasMultiBytes($str) + { + if (function_exists('mb_strlen')) { + return (strlen($str) > mb_strlen($str, $this->CharSet)); + } else { // Assume no multibytes (we can't handle without mbstring functions anyway) + return false; + } + } + + /** + * Does a string contain any 8-bit chars (in any charset)? + * @param string $text + * @return bool + */ + public function has8bitChars($text) + { + return (bool)preg_match('/[\x80-\xFF]/', $text); + } + + /** + * Encode and wrap long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid + * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * @access public + * @param string $str multi-byte text to wrap encode + * @param string $linebreak string to use as linefeed/end-of-line + * @return string + */ + public function base64EncodeWrapMB($str, $linebreak = null) + { + $start = '=?' . $this->CharSet . '?B?'; + $end = '?='; + $encoded = ''; + if ($linebreak === null) { + $linebreak = $this->LE; + } + + $mb_length = mb_strlen($str, $this->CharSet); + // Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + // Average multi-byte ratio + $ratio = $mb_length / strlen($str); + // Base64 has a 4:3 ratio + $avgLength = floor($length * $ratio * .75); + + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + $lookBack++; + } while (strlen($chunk) > $length); + $encoded .= $chunk . $linebreak; + } + + // Chomp the last linefeed + $encoded = substr($encoded, 0, -strlen($linebreak)); + return $encoded; + } + + /** + * Encode a string in quoted-printable format. + * According to RFC2045 section 6.7. + * @access public + * @param string $string The text to encode + * @param integer $line_max Number of chars allowed on a line before wrapping + * @return string + * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment + */ + public function encodeQP($string, $line_max = 76) + { + if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) + return $this->fixEOL(quoted_printable_encode($string)); + } + //Fall back to a pure PHP implementation + $string = str_replace( + array('%20', '%0D%0A.', '%0D%0A', '%'), + array(' ', "\r\n=2E", "\r\n", '='), + rawurlencode($string) + ); + $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); + return $this->fixEOL($string); + } + + /** + * Backward compatibility wrapper for an old QP encoding function that was removed. + * @see PHPMailer::encodeQP() + * @access public + * @param string $string + * @param integer $line_max + * @param bool $space_conv + * @return string + * @deprecated Use encodeQP instead. + */ + public function encodeQPphp( + $string, + $line_max = 76, + /** @noinspection PhpUnusedParameterInspection */ $space_conv = false + ) { + return $this->encodeQP($string, $line_max); + } + + /** + * Encode a string using Q encoding. + * @link http://tools.ietf.org/html/rfc2047 + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means + * @access public + * @return string + */ + public function encodeQ($str, $position = 'text') + { + //There should not be any EOL in the string + $pattern = ''; + $encoded = str_replace(array("\r", "\n"), '', $str); + switch (strtolower($position)) { + case 'phrase': + //RFC 2047 section 5.3 + $pattern = '^A-Za-z0-9!*+\/ -'; + break; + /** @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + //RFC 2047 section 5.2 + $pattern = '\(\)"'; + //intentional fall-through + //for this reason we build the $pattern without including delimiters and [] + case 'text': + default: + //RFC 2047 section 5.1 + //Replace every high ascii, control, =, ? and _ characters + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; + break; + } + $matches = array(); + if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { + //If the string contains an '=', make sure it's the first thing we replace + //so as to avoid double-encoding + $eqkey = array_search('=', $matches[0]); + if ($eqkey !== false) { + unset($matches[0][$eqkey]); + array_unshift($matches[0], '='); + } + foreach (array_unique($matches[0]) as $char) { + $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); + } + } + //Replace every spaces to _ (more readable than =20) + return str_replace(' ', '_', $encoded); + } + + + /** + * Add a string or binary attachment (non-filesystem). + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * @param string $string String attachment data. + * @param string $filename Name of the attachment. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @param string $disposition Disposition to use + * @return void + */ + public function addStringAttachment( + $string, + $filename, + $encoding = 'base64', + $type = '', + $disposition = 'attachment' + ) { + //If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($filename); + } + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $filename, + 2 => basename($filename), + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => 0 + ); + } + + /** + * Add an embedded (inline) attachment from a file. + * This can include images, sounds, and just about any other document type. + * These differ from 'regular' attachmants in that they are intended to be + * displayed inline with the message, not just attached for download. + * This is used in HTML messages that embed the images + * the HTML refers to using the $cid value. + * @param string $path Path to the attachment. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File MIME type. + * @param string $disposition Disposition to use + * @return bool True on successfully adding an attachment + */ + public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') + { + if (!@is_file($path)) { + $this->setError($this->lang('file_access') . $path); + return false; + } + + //If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($path); + } + + $filename = basename($path); + if ($name == '') { + $name = $filename; + } + + // Append to $attachment array + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => $cid + ); + return true; + } + + /** + * Add an embedded stringified attachment. + * This can include images, sounds, and just about any other document type. + * Be sure to set the $type to an image type for images: + * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. + * @param string $string The attachment binary data. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. + * @param string $name + * @param string $encoding File encoding (see $Encoding). + * @param string $type MIME type. + * @param string $disposition Disposition to use + * @return bool True on successfully adding an attachment + */ + public function addStringEmbeddedImage( + $string, + $cid, + $name = '', + $encoding = 'base64', + $type = '', + $disposition = 'inline' + ) { + //If a MIME type is not specified, try to work it out from the name + if ($type == '') { + $type = self::filenameToType($name); + } + + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $name, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => $cid + ); + return true; + } + + /** + * Check if an inline attachment is present. + * @access public + * @return bool + */ + public function inlineImageExists() + { + foreach ($this->attachment as $attachment) { + if ($attachment[6] == 'inline') { + return true; + } + } + return false; + } + + /** + * Check if an attachment (non-inline) is present. + * @return bool + */ + public function attachmentExists() + { + foreach ($this->attachment as $attachment) { + if ($attachment[6] == 'attachment') { + return true; + } + } + return false; + } + + /** + * Check if this message has an alternative body set. + * @return bool + */ + public function alternativeExists() + { + return !empty($this->AltBody); + } + + /** + * Clear all To recipients. + * @return void + */ + public function clearAddresses() + { + foreach ($this->to as $to) { + unset($this->all_recipients[strtolower($to[0])]); + } + $this->to = array(); + } + + /** + * Clear all CC recipients. + * @return void + */ + public function clearCCs() + { + foreach ($this->cc as $cc) { + unset($this->all_recipients[strtolower($cc[0])]); + } + $this->cc = array(); + } + + /** + * Clear all BCC recipients. + * @return void + */ + public function clearBCCs() + { + foreach ($this->bcc as $bcc) { + unset($this->all_recipients[strtolower($bcc[0])]); + } + $this->bcc = array(); + } + + /** + * Clear all ReplyTo recipients. + * @return void + */ + public function clearReplyTos() + { + $this->ReplyTo = array(); + } + + /** + * Clear all recipient types. + * @return void + */ + public function clearAllRecipients() + { + $this->to = array(); + $this->cc = array(); + $this->bcc = array(); + $this->all_recipients = array(); + } + + /** + * Clear all filesystem, string, and binary attachments. + * @return void + */ + public function clearAttachments() + { + $this->attachment = array(); + } + + /** + * Clear all custom headers. + * @return void + */ + public function clearCustomHeaders() + { + $this->CustomHeader = array(); + } + + /** + * Add an error message to the error container. + * @access protected + * @param string $msg + * @return void + */ + protected function setError($msg) + { + $this->error_count++; + if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { + $lasterror = $this->smtp->getError(); + if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { + $msg .= '

' . $this->lang('smtp_error') . $lasterror['smtp_msg'] . "

\n"; + } + } + $this->ErrorInfo = $msg; + } + + /** + * Return an RFC 822 formatted date. + * @access public + * @return string + * @static + */ + public static function rfcDate() + { + //Set the time zone to whatever the default is to avoid 500 errors + //Will default to UTC if it's not set properly in php.ini + date_default_timezone_set(@date_default_timezone_get()); + return date('D, j M Y H:i:s O'); + } + + /** + * Get the server hostname. + * Returns 'localhost.localdomain' if unknown. + * @access protected + * @return string + */ + protected function serverHostname() + { + $result = 'localhost.localdomain'; + if (!empty($this->Hostname)) { + $result = $this->Hostname; + } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { + $result = $_SERVER['SERVER_NAME']; + } elseif (function_exists('gethostname') && gethostname() !== false) { + $result = gethostname(); + } elseif (php_uname('n') !== false) { + $result = php_uname('n'); + } + return $result; + } + + /** + * Get an error message in the current language. + * @access protected + * @param string $key + * @return string + */ + protected function lang($key) + { + if (count($this->language) < 1) { + $this->setLanguage('en'); // set the default language + } + + if (isset($this->language[$key])) { + return $this->language[$key]; + } else { + return 'Language string failed to load: ' . $key; + } + } + + /** + * Check if an error occurred. + * @access public + * @return bool True if an error did occur. + */ + public function isError() + { + return ($this->error_count > 0); + } + + /** + * Ensure consistent line endings in a string. + * Changes every end of line from CRLF, CR or LF to $this->LE. + * @access public + * @param string $str String to fixEOL + * @return string + */ + public function fixEOL($str) + { + // Normalise to \n + $nstr = str_replace(array("\r\n", "\r"), "\n", $str); + // Now convert LE as needed + if ($this->LE !== "\n") { + $nstr = str_replace("\n", $this->LE, $nstr); + } + return $nstr; + } + + /** + * Add a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value) + * @access public + * @param string $name Custom header name + * @param string $value Header value + * @return void + */ + public function addCustomHeader($name, $value = null) + { + if ($value === null) { + // Value passed in as name:value + $this->CustomHeader[] = explode(':', $name, 2); + } else { + $this->CustomHeader[] = array($name, $value); + } + } + + /** + * Create a message from an HTML string. + * Automatically makes modifications for inline images and backgrounds + * and creates a plain-text version by converting the HTML. + * Overwrites any existing values in $this->Body and $this->AltBody + * @access public + * @param string $message HTML message string + * @param string $basedir baseline directory for path + * @param bool $advanced Whether to use the advanced HTML to text converter + * @return string $message + */ + public function msgHTML($message, $basedir = '', $advanced = false) + { + preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); + if (isset($images[2])) { + foreach ($images[2] as $imgindex => $url) { + // do not change urls for absolute images (thanks to corvuscorax) + if (!preg_match('#^[A-z]+://#', $url)) { + $filename = basename($url); + $directory = dirname($url); + if ($directory == '.') { + $directory = ''; + } + $cid = md5($url) . '@phpmailer.0'; //RFC2392 S 2 + if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { + $basedir .= '/'; + } + if (strlen($directory) > 1 && substr($directory, -1) != '/') { + $directory .= '/'; + } + if ($this->addEmbeddedImage( + $basedir . $directory . $filename, + $cid, + $filename, + 'base64', + self::_mime_types(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) + ) + ) { + $message = preg_replace( + '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + } + } + } + } + $this->isHTML(true); + //Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better + $this->Body = $this->normalizeBreaks($message); + $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); + if (empty($this->AltBody)) { + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . + self::CRLF . self::CRLF; + } + return $this->Body; + } + + /** + * Convert an HTML string into plain text. + * @param string $html The HTML text to convert + * @param bool $advanced Should this use the more complex html2text converter or just a simple one? + * @return string + */ + public function html2text($html, $advanced = false) + { + if ($advanced) { + require_once 'extras/class.html2text.php'; + $htmlconverter = new html2text($html); + return $htmlconverter->get_text(); + } + return html_entity_decode( + trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), + ENT_QUOTES, + $this->CharSet + ); + } + + /** + * Get the MIME type for a file extension. + * @param string $ext File extension + * @access public + * @return string MIME type of file. + * @static + */ + public static function _mime_types($ext = '') + { + $mimes = array( + 'xl' => 'application/excel', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'bin' => 'application/macbinary', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'class' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'psd' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'so' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mpga' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'eml' => 'message/rfc822', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'log' => 'text/plain', + 'text' => 'text/plain', + 'txt' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'vcf' => 'text/vcard', + 'vcard' => 'text/vcard', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mov' => 'video/quicktime', + 'qt' => 'video/quicktime', + 'rv' => 'video/vnd.rn-realvideo', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie' + ); + return (array_key_exists(strtolower($ext), $mimes) ? $mimes[strtolower($ext)]: 'application/octet-stream'); + } + + /** + * Map a file name to a MIME type. + * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. + * @param string $filename A file name or full path, does not need to exist as a file + * @return string + * @static + */ + public static function filenameToType($filename) + { + //In case the path is a URL, strip any query string before getting extension + $qpos = strpos($filename, '?'); + if ($qpos !== false) { + $filename = substr($filename, 0, $qpos); + } + $pathinfo = self::mb_pathinfo($filename); + return self::_mime_types($pathinfo['extension']); + } + + /** + * Multi-byte-safe pathinfo replacement. + * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. + * Works similarly to the one in PHP >= 5.2.0 + * @link http://www.php.net/manual/en/function.pathinfo.php#107461 + * @param string $path A filename or path, does not need to exist as a file + * @param integer|string $options Either a PATHINFO_* constant, + * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 + * @return string|array + * @static + */ + public static function mb_pathinfo($path, $options = null) + { + $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); + $pathinfo = array(); + preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo); + if (array_key_exists(1, $pathinfo)) { + $ret['dirname'] = $pathinfo[1]; + } + if (array_key_exists(2, $pathinfo)) { + $ret['basename'] = $pathinfo[2]; + } + if (array_key_exists(5, $pathinfo)) { + $ret['extension'] = $pathinfo[5]; + } + if (array_key_exists(3, $pathinfo)) { + $ret['filename'] = $pathinfo[3]; + } + switch ($options) { + case PATHINFO_DIRNAME: + case 'dirname': + return $ret['dirname']; + break; + case PATHINFO_BASENAME: + case 'basename': + return $ret['basename']; + break; + case PATHINFO_EXTENSION: + case 'extension': + return $ret['extension']; + break; + case PATHINFO_FILENAME: + case 'filename': + return $ret['filename']; + break; + default: + return $ret; + } + } + + /** + * Set or reset instance properties. + * + * Usage Example: + * $page->set('X-Priority', '3'); + * + * @access public + * @param string $name + * @param mixed $value + * NOTE: will not work with arrays, there are no arrays to set/reset + * @throws phpmailerException + * @return bool + * @todo Should this not be using __set() magic function? + */ + public function set($name, $value = '') + { + try { + if (isset($this->$name)) { + $this->$name = $value; + } else { + throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL); + } + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($exc->getCode() == self::STOP_CRITICAL) { + return false; + } + } + return true; + } + + /** + * Strip newlines to prevent header injection. + * @access public + * @param string $str + * @return string + */ + public function secureHeader($str) + { + return trim(str_replace(array("\r", "\n"), '', $str)); + } + + /** + * Normalize line breaks in a string. + * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. + * Defaults to CRLF (for message bodies) and preserves consecutive breaks. + * @param string $text + * @param string $breaktype What kind of line break to use, defaults to CRLF + * @return string + * @access public + * @static + */ + public static function normalizeBreaks($text, $breaktype = "\r\n") + { + return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); + } + + + /** + * Set the public and private key files and password for S/MIME signing. + * @access public + * @param string $cert_filename + * @param string $key_filename + * @param string $key_pass Password for private key + */ + public function sign($cert_filename, $key_filename, $key_pass) + { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + } + + /** + * Quoted-Printable-encode a DKIM header. + * @access public + * @param string $txt + * @return string + */ + public function DKIM_QP($txt) + { + $line = ''; + for ($i = 0; $i < strlen($txt); $i++) { + $ord = ord($txt[$i]); + if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { + $line .= $txt[$i]; + } else { + $line .= '=' . sprintf('%02X', $ord); + } + } + return $line; + } + + /** + * Generate a DKIM signature. + * @access public + * @param string $signheader Header + * @throws phpmailerException + * @return string + */ + public function DKIM_Sign($signheader) + { + if (!defined('PKCS7_TEXT')) { + if ($this->exceptions) { + throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); + } + return ''; + } + $privKeyStr = file_get_contents($this->DKIM_private); + if ($this->DKIM_passphrase != '') { + $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); + } else { + $privKey = $privKeyStr; + } + if (openssl_sign($signheader, $signature, $privKey)) { + return base64_encode($signature); + } + return ''; + } + + /** + * Generate a DKIM canonicalization header. + * @access public + * @param string $signheader Header + * @return string + */ + public function DKIM_HeaderC($signheader) + { + $signheader = preg_replace('/\r\n\s+/', ' ', $signheader); + $lines = explode("\r\n", $signheader); + foreach ($lines as $key => $line) { + list($heading, $value) = explode(':', $line, 2); + $heading = strtolower($heading); + $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces + $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value + } + $signheader = implode("\r\n", $lines); + return $signheader; + } + + /** + * Generate a DKIM canonicalization body. + * @access public + * @param string $body Message Body + * @return string + */ + public function DKIM_BodyC($body) + { + if ($body == '') { + return "\r\n"; + } + // stabilize line endings + $body = str_replace("\r\n", "\n", $body); + $body = str_replace("\n", "\r\n", $body); + // END stabilize line endings + while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { + $body = substr($body, 0, strlen($body) - 2); + } + return $body; + } + + /** + * Create the DKIM header and body in a new message header. + * @access public + * @param string $headers_line Header lines + * @param string $subject Subject + * @param string $body Body + * @return string + */ + public function DKIM_Add($headers_line, $subject, $body) + { + $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body + $DKIMquery = 'dns/txt'; // Query method + $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) + $subject_header = "Subject: $subject"; + $headers = explode($this->LE, $headers_line); + $from_header = ''; + $to_header = ''; + $current = ''; + foreach ($headers as $header) { + if (strpos($header, 'From:') === 0) { + $from_header = $header; + $current = 'from_header'; + } elseif (strpos($header, 'To:') === 0) { + $to_header = $header; + $current = 'to_header'; + } else { + if ($current && strpos($header, ' =?') === 0) { + $current .= $header; + } else { + $current = ''; + } + } + } + $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); + $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); + $subject = str_replace( + '|', + '=7C', + $this->DKIM_QP($subject_header) + ); // Copied header fields (dkim-quoted-printable) + $body = $this->DKIM_BodyC($body); + $DKIMlen = strlen($body); // Length of body + $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body + $ident = ($this->DKIM_identity == '') ? '' : ' i=' . $this->DKIM_identity . ';'; + $dkimhdrs = 'DKIM-Signature: v=1; a=' . + $DKIMsignatureType . '; q=' . + $DKIMquery . '; l=' . + $DKIMlen . '; s=' . + $this->DKIM_selector . + ";\r\n" . + "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . + "\th=From:To:Subject;\r\n" . + "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . + "\tz=$from\r\n" . + "\t|$to\r\n" . + "\t|$subject;\r\n" . + "\tbh=" . $DKIMb64 . ";\r\n" . + "\tb="; + $toSign = $this->DKIM_HeaderC( + $from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs + ); + $signed = $this->DKIM_Sign($toSign); + return $dkimhdrs . $signed . "\r\n"; + } + + /** + * Allows for public read access to 'to' property. + * @access public + * @return array + */ + public function getToAddresses() + { + return $this->to; + } + + /** + * Allows for public read access to 'cc' property. + * @access public + * @return array + */ + public function getCcAddresses() + { + return $this->cc; + } + + /** + * Allows for public read access to 'bcc' property. + * @access public + * @return array + */ + public function getBccAddresses() + { + return $this->bcc; + } + + /** + * Allows for public read access to 'ReplyTo' property. + * @access public + * @return array + */ + public function getReplyToAddresses() + { + return $this->ReplyTo; + } + + /** + * Allows for public read access to 'all_recipients' property. + * @access public + * @return array + */ + public function getAllRecipientAddresses() + { + return $this->all_recipients; + } + + /** + * Perform a callback. + * @param bool $isSent + * @param string $to + * @param string $cc + * @param string $bcc + * @param string $subject + * @param string $body + * @param string $from + */ + protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from = null) + { + if (!empty($this->action_function) && is_callable($this->action_function)) { + $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); + call_user_func_array($this->action_function, $params); + } + } +} + +/** + * PHPMailer exception handler + * @package PHPMailer + */ +class phpmailerException extends Exception +{ + /** + * Prettify error message output + * @return string + */ + public function errorMessage() + { + $errorMsg = '' . $this->getMessage() . "
\n"; + return $errorMsg; + } +} + +} diff --git a/app/lib/PHPMailerAutoload.inc b/app/lib/PHPMailerAutoload.inc new file mode 100644 index 00000000..1bfc950e --- /dev/null +++ b/app/lib/PHPMailerAutoload.inc @@ -0,0 +1,86 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\lib + { + + + /** + * Class to ensure that Compatibility library below is loaded. + * + * @author Oliver Hanraths + */ + class PHPMailerAutoload + { + + /** + * Call this function to ensure this file is loaded. + */ + public static function load() + { + } + + } + + } + + namespace { + +/** + * PHPMailer SPL autoloader. + * PHP Version 5 + * @package PHPMailer + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * PHPMailer SPL autoloader. + * @param string $classname The name of the class to load + */ +function PHPMailerAutoload($classname) +{ + //Can't use __DIR__ as it's only in PHP 5.3+ + $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; + if (is_readable($filename)) { + require $filename; + } +} + +if (version_compare(PHP_VERSION, '5.1.2', '>=')) { + //SPL autoloading was introduced in PHP 5.1.2 + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + spl_autoload_register('PHPMailerAutoload', true, true); + } else { + spl_autoload_register('PHPMailerAutoload'); + } +} else { + /** + * Fall back to traditional autoload for old PHP versions + * @param string $classname The name of the class to load + */ + function __autoload($classname) + { + PHPMailerAutoload($classname); + } +} + +} diff --git a/app/lib/Password.inc b/app/lib/Password.inc new file mode 100644 index 00000000..f9acf7d5 --- /dev/null +++ b/app/lib/Password.inc @@ -0,0 +1,316 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\lib + { + + + /** + * Class to ensure that Compatibility library below is loaded. + * + * @author Oliver Hanraths + */ + class Password + { + + /** + * Call this function to ensure this file is loaded. + */ + public static function load() + { + } + + } + + } + + + + +/** + * A Compatibility library with PHP 5.5's simplified password hashing API. + * + * @author Anthony Ferrara + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @copyright 2012 The Authors + */ + +namespace { + +if (!defined('PASSWORD_DEFAULT')) { + + define('PASSWORD_BCRYPT', 1); + define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); + + /** + * Hash the password using the specified algorithm + * + * @param string $password The password to hash + * @param int $algo The algorithm to use (Defined by PASSWORD_* constants) + * @param array $options The options for the algorithm to use + * + * @return string|false The hashed password, or false on error. + */ + function password_hash($password, $algo, array $options = array()) { + if (!function_exists('crypt')) { + trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING); + return null; + } + if (!is_string($password)) { + trigger_error("password_hash(): Password must be a string", E_USER_WARNING); + return null; + } + if (!is_int($algo)) { + trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING); + return null; + } + $resultLength = 0; + switch ($algo) { + case PASSWORD_BCRYPT: + // Note that this is a C constant, but not exposed to PHP, so we don't define it here. + $cost = 10; + if (isset($options['cost'])) { + $cost = $options['cost']; + if ($cost < 4 || $cost > 31) { + trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING); + return null; + } + } + // The length of salt to generate + $raw_salt_len = 16; + // The length required in the final serialization + $required_salt_len = 22; + $hash_format = sprintf("$2y$%02d$", $cost); + // The expected length of the final crypt() output + $resultLength = 60; + break; + default: + trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING); + return null; + } + $salt_requires_encoding = false; + if (isset($options['salt'])) { + switch (gettype($options['salt'])) { + case 'NULL': + case 'boolean': + case 'integer': + case 'double': + case 'string': + $salt = (string) $options['salt']; + break; + case 'object': + if (method_exists($options['salt'], '__tostring')) { + $salt = (string) $options['salt']; + break; + } + case 'array': + case 'resource': + default: + trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING); + return null; + } + if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) { + trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING); + return null; + } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) { + $salt_requires_encoding = true; + } + } else { + $buffer = ''; + $buffer_valid = false; + if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { + $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); + if ($buffer) { + $buffer_valid = true; + } + } + if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { + $buffer = openssl_random_pseudo_bytes($raw_salt_len); + if ($buffer) { + $buffer_valid = true; + } + } + if (!$buffer_valid && @is_readable('/dev/urandom')) { + $f = fopen('/dev/urandom', 'r'); + $read = PasswordCompat\binary\_strlen($buffer); + while ($read < $raw_salt_len) { + $buffer .= fread($f, $raw_salt_len - $read); + $read = PasswordCompat\binary\_strlen($buffer); + } + fclose($f); + if ($read >= $raw_salt_len) { + $buffer_valid = true; + } + } + if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) { + $bl = PasswordCompat\binary\_strlen($buffer); + for ($i = 0; $i < $raw_salt_len; $i++) { + if ($i < $bl) { + $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); + } else { + $buffer .= chr(mt_rand(0, 255)); + } + } + } + $salt = $buffer; + $salt_requires_encoding = true; + } + if ($salt_requires_encoding) { + // encode string with the Base64 variant used by crypt + $base64_digits = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + $bcrypt64_digits = + './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + $base64_string = base64_encode($salt); + $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); + } + $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len); + + $hash = $hash_format . $salt; + + $ret = crypt($password, $hash); + + if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) { + return false; + } + + return $ret; + } + + /** + * Get information about the password hash. Returns an array of the information + * that was used to generate the password hash. + * + * array( + * 'algo' => 1, + * 'algoName' => 'bcrypt', + * 'options' => array( + * 'cost' => 10, + * ), + * ) + * + * @param string $hash The password hash to extract info from + * + * @return array The array of information about the hash. + */ + function password_get_info($hash) { + $return = array( + 'algo' => 0, + 'algoName' => 'unknown', + 'options' => array(), + ); + if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) { + $return['algo'] = PASSWORD_BCRYPT; + $return['algoName'] = 'bcrypt'; + list($cost) = sscanf($hash, "$2y$%d$"); + $return['options']['cost'] = $cost; + } + return $return; + } + + /** + * Determine if the password hash needs to be rehashed according to the options provided + * + * If the answer is true, after validating the password using password_verify, rehash it. + * + * @param string $hash The hash to test + * @param int $algo The algorithm used for new password hashes + * @param array $options The options array passed to password_hash + * + * @return boolean True if the password needs to be rehashed. + */ + function password_needs_rehash($hash, $algo, array $options = array()) { + $info = password_get_info($hash); + if ($info['algo'] != $algo) { + return true; + } + switch ($algo) { + case PASSWORD_BCRYPT: + $cost = isset($options['cost']) ? $options['cost'] : 10; + if ($cost != $info['options']['cost']) { + return true; + } + break; + } + return false; + } + + /** + * Verify a password against a hash using a timing attack resistant approach + * + * @param string $password The password to verify + * @param string $hash The hash to verify against + * + * @return boolean If the password matches the hash + */ + function password_verify($password, $hash) { + if (!function_exists('crypt')) { + trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING); + return false; + } + $ret = crypt($password, $hash); + if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) { + return false; + } + + $status = 0; + for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) { + $status |= (ord($ret[$i]) ^ ord($hash[$i])); + } + + return $status === 0; + } +} + +} + +namespace PasswordCompat\binary { + /** + * Count the number of bytes in a string + * + * We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension. + * In this case, strlen() will count the number of *characters* based on the internal encoding. A + * sequence of bytes might be regarded as a single multibyte character. + * + * @param string $binary_string The input string + * + * @internal + * @return int The number of bytes + */ + function _strlen($binary_string) { + if (function_exists('mb_strlen')) { + return mb_strlen($binary_string, '8bit'); + } + return strlen($binary_string); + } + + /** + * Get a substring based on byte limits + * + * @see _strlen() + * + * @param string $binary_string The input string + * @param int $start + * @param int $length + * + * @internal + * @return string The substring + */ + function _substr($binary_string, $start, $length) { + if (function_exists('mb_substr')) { + return mb_substr($binary_string, $start, $length, '8bit'); + } + return substr($binary_string, $start, $length); + } + +} diff --git a/app/lib/SMTP.inc b/app/lib/SMTP.inc new file mode 100644 index 00000000..b616373e --- /dev/null +++ b/app/lib/SMTP.inc @@ -0,0 +1,972 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\lib + { + + + /** + * Class to ensure that Compatibility library below is loaded. + * + * @author Oliver Hanraths + */ + class SMTP + { + + /** + * Call this function to ensure this file is loaded. + */ + public static function load() + { + } + + } + + } + + namespace { + +/** + * PHPMailer RFC821 SMTP email transport class. + * PHP Version 5 + * @package PHPMailer + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * PHPMailer RFC821 SMTP email transport class. + * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. + * @package PHPMailer + * @author Chris Ryan + * @author Marcus Bointon + */ +class SMTP +{ + /** + * The PHPMailer SMTP version number. + * @type string + */ + const VERSION = '5.2.8'; + + /** + * SMTP line break constant. + * @type string + */ + const CRLF = "\r\n"; + + /** + * The SMTP port to use if one is not specified. + * @type int + */ + const DEFAULT_SMTP_PORT = 25; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1 + * @type int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The PHPMailer SMTP Version number. + * @type string + * @deprecated Use the constant instead + * @see SMTP::VERSION + */ + public $Version = '5.2.8'; + + /** + * SMTP server port number. + * @type int + * @deprecated This is only ever used as a default value, so use the constant instead + * @see SMTP::DEFAULT_SMTP_PORT + */ + public $SMTP_PORT = 25; + + /** + * SMTP reply line ending. + * @type string + * @deprecated Use the constant instead + * @see SMTP::CRLF + */ + public $CRLF = "\r\n"; + + /** + * Debug output level. + * Options: + * * `0` No output + * * `1` Commands + * * `2` Data and commands + * * `3` As 2 plus connection status + * * `4` Low-level data output + * @type int + */ + public $do_debug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to
, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * @type string + */ + public $Debugoutput = 'echo'; + + /** + * Whether to use VERP. + * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Info on VERP + * @type bool + */ + public $do_verp = false; + + /** + * The timeout value for connection, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 + * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. + * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * @type int + */ + public $Timeout = 300; + + /** + * The SMTP timelimit value for reads, in seconds. + * @type int + */ + public $Timelimit = 30; + + /** + * The socket for the server connection. + * @type resource + */ + protected $smtp_conn; + + /** + * Error message, if any, for the last call. + * @type string + */ + protected $error = ''; + + /** + * The reply the server sent to us for HELO. + * @type string + */ + protected $helo_rply = ''; + + /** + * The most recent reply received from the server. + * @type string + */ + protected $last_reply = ''; + + /** + * Constructor. + * @access public + */ + public function __construct() + { + $this->smtp_conn = 0; + $this->error = null; + $this->helo_rply = null; + $this->do_debug = 0; + } + + /** + * Output debugging info via a user-selected method. + * @param string $str Debug string to output + * @return void + */ + protected function edebug($str) + { + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ) + . "
\n"; + break; + case 'echo': + default: + echo gmdate('Y-m-d H:i:s')."\t".trim($str)."\n"; + } + } + + /** + * Connect to an SMTP server. + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to + * @param int $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * @access public + * @return bool + */ + public function connect($host, $port = null, $timeout = 30, $options = array()) + { + // Clear errors to avoid confusion + $this->error = null; + // Make sure we are __not__ connected + if ($this->connected()) { + // Already connected, generate error + $this->error = array('error' => 'Already connected to a server'); + return false; + } + if (empty($port)) { + $port = self::DEFAULT_SMTP_PORT; + } + // Connect to the SMTP server + if ($this->do_debug >= 3) { + $this->edebug('Connection: opening'); + } + $errno = 0; + $errstr = ''; + $socket_context = stream_context_create($options); + //Suppress errors; connection failures are handled at a higher level + $this->smtp_conn = @stream_socket_client( + $host . ":" . $port, + $errno, + $errstr, + $timeout, + STREAM_CLIENT_CONNECT, + $socket_context + ); + // Verify we connected properly + if (empty($this->smtp_conn)) { + $this->error = array( + 'error' => 'Failed to connect to server', + 'errno' => $errno, + 'errstr' => $errstr + ); + if ($this->do_debug >= 1) { + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] + . ": $errstr ($errno)" + ); + } + return false; + } + if ($this->do_debug >= 3) { + $this->edebug('Connection: opened'); + } + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function + if (substr(PHP_OS, 0, 3) != 'WIN') { + $max = ini_get('max_execution_time'); + if ($max != 0 && $timeout > $max) { // Don't bother if unlimited + @set_time_limit($timeout); + } + stream_set_timeout($this->smtp_conn, $timeout, 0); + } + // Get any announcement + $announce = $this->get_lines(); + if ($this->do_debug >= 2) { + $this->edebug('SERVER -> CLIENT: ' . $announce); + } + return true; + } + + /** + * Initiate a TLS (encrypted) session. + * @access public + * @return bool + */ + public function startTLS() + { + if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { + return false; + } + // Begin encrypted connection + if (!stream_socket_enable_crypto( + $this->smtp_conn, + true, + STREAM_CRYPTO_METHOD_TLS_CLIENT + )) { + return false; + } + return true; + } + + /** + * Perform SMTP authentication. + * Must be run after hello(). + * @see hello() + * @param string $username The user name + * @param string $password The password + * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5) + * @param string $realm The auth realm for NTLM + * @param string $workstation The auth workstation for NTLM + * @access public + * @return bool True if successfully authenticated. + */ + public function authenticate( + $username, + $password, + $authtype = 'LOGIN', + $realm = '', + $workstation = '' + ) { + if (empty($authtype)) { + $authtype = 'LOGIN'; + } + switch ($authtype) { + case 'PLAIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { + return false; + } + // Send encoded username and password + if (!$this->sendCommand( + 'User & Password', + base64_encode("\0" . $username . "\0" . $password), + 235 + ) + ) { + return false; + } + break; + case 'LOGIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { + return false; + } + if (!$this->sendCommand("Username", base64_encode($username), 334)) { + return false; + } + if (!$this->sendCommand("Password", base64_encode($password), 235)) { + return false; + } + break; + case 'NTLM': + /* + * ntlm_sasl_client.php + * Bundled with Permission + * + * How to telnet in windows: + * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx + * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication + */ + require_once 'extras/ntlm_sasl_client.php'; + $temp = new stdClass(); + $ntlm_client = new ntlm_sasl_client_class; + //Check that functions are available + if (!$ntlm_client->Initialize($temp)) { + $this->error = array('error' => $temp->error); + if ($this->do_debug >= 1) { + $this->edebug( + 'You need to enable some modules in your php.ini file: ' + . $this->error['error'] + ); + } + return false; + } + //msg1 + $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1 + + if (!$this->sendCommand( + 'AUTH NTLM', + 'AUTH NTLM ' . base64_encode($msg1), + 334 + ) + ) { + return false; + } + //Though 0 based, there is a white space after the 3 digit number + //msg2 + $challenge = substr($this->last_reply, 3); + $challenge = base64_decode($challenge); + $ntlm_res = $ntlm_client->NTLMResponse( + substr($challenge, 24, 8), + $password + ); + //msg3 + $msg3 = $ntlm_client->TypeMsg3( + $ntlm_res, + $username, + $realm, + $workstation + ); + // send encoded username + return $this->sendCommand('Username', base64_encode($msg3), 235); + break; + case 'CRAM-MD5': + // Start authentication + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { + return false; + } + // Get the challenge + $challenge = base64_decode(substr($this->last_reply, 4)); + + // Build the response + $response = $username . ' ' . $this->hmac($challenge, $password); + + // send encoded credentials + return $this->sendCommand('Username', base64_encode($response), 235); + break; + } + return true; + } + + /** + * Calculate an MD5 HMAC hash. + * Works like hash_hmac('md5', $data, $key) + * in case that function is not available + * @param string $data The data to hash + * @param string $key The key to hash with + * @access protected + * @return string + */ + protected function hmac($data, $key) + { + if (function_exists('hash_hmac')) { + return hash_hmac('md5', $data, $key); + } + + // The following borrowed from + // http://php.net/manual/en/function.mhash.php#27225 + + // RFC 2104 HMAC implementation for php. + // Creates an md5 HMAC. + // Eliminates the need to install mhash to compute a HMAC + // Hacked by Lance Rushing + + $bytelen = 64; // byte length for md5 + if (strlen($key) > $bytelen) { + $key = pack('H*', md5($key)); + } + $key = str_pad($key, $bytelen, chr(0x00)); + $ipad = str_pad('', $bytelen, chr(0x36)); + $opad = str_pad('', $bytelen, chr(0x5c)); + $k_ipad = $key ^ $ipad; + $k_opad = $key ^ $opad; + + return md5($k_opad . pack('H*', md5($k_ipad . $data))); + } + + /** + * Check connection state. + * @access public + * @return bool True if connected. + */ + public function connected() + { + if (!empty($this->smtp_conn)) { + $sock_status = stream_get_meta_data($this->smtp_conn); + if ($sock_status['eof']) { + // the socket is valid but we are not connected + if ($this->do_debug >= 1) { + $this->edebug( + 'SMTP NOTICE: EOF caught while checking if connected' + ); + } + $this->close(); + return false; + } + return true; // everything looks good + } + return false; + } + + /** + * Close the socket and clean up the state of the class. + * Don't use this function without first trying to use QUIT. + * @see quit() + * @access public + * @return void + */ + public function close() + { + $this->error = null; // so there is no confusion + $this->helo_rply = null; + if (!empty($this->smtp_conn)) { + // close the connection and cleanup + fclose($this->smtp_conn); + if ($this->do_debug >= 3) { + $this->edebug('Connection: closed'); + } + $this->smtp_conn = 0; + } + } + + /** + * Send an SMTP DATA command. + * Issues a data command and sends the msg_data to the server, + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being separated by and additional . + * Implements rfc 821: DATA + * @param string $msg_data Message data to send + * @access public + * @return bool + */ + public function data($msg_data) + { + if (!$this->sendCommand('DATA', 'DATA', 354)) { + return false; + } + /* The server is ready to accept data! + * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) + * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into + * smaller lines to fit within the limit. + * We will also look for lines that start with a '.' and prepend an additional '.'. + * NOTE: this does not count towards line-length limit. + */ + + // Normalize line breaks before exploding + $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); + + /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field + * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * process all lines before a blank line as headers. + */ + + $field = substr($lines[0], 0, strpos($lines[0], ':')); + $in_headers = false; + if (!empty($field) && strpos($field, ' ') === false) { + $in_headers = true; + } + + foreach ($lines as $line) { + $lines_out = array(); + if ($in_headers and $line == '') { + $in_headers = false; + } + // ok we need to break this line up into several smaller lines + //This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len) + while (isset($line[self::MAX_LINE_LENGTH])) { + //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on + //so as to avoid breaking in the middle of a word + $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); + if (!$pos) { //Deliberately matches both false and 0 + //No nice break found, add a hard break + $pos = self::MAX_LINE_LENGTH - 1; + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos); + } else { + //Break at the found point + $lines_out[] = substr($line, 0, $pos); + //Move along by the amount we dealt with + $line = substr($line, $pos + 1); + } + /* If processing headers add a LWSP-char to the front of new line + * RFC822 section 3.1.1 + */ + if ($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + // Send the lines to the server + foreach ($lines_out as $line_out) { + //RFC2821 section 4.5.2 + if (!empty($line_out) and $line_out[0] == '.') { + $line_out = '.' . $line_out; + } + $this->client_send($line_out . self::CRLF); + } + } + + // Message data has been sent, complete the command + return $this->sendCommand('DATA END', '.', 250); + } + + /** + * Send an SMTP HELO or EHLO command. + * Used to identify the sending server to the receiving server. + * This makes sure that client and server are in a known state. + * Implements RFC 821: HELO + * and RFC 2821 EHLO. + * @param string $host The host name or IP to connect to + * @access public + * @return bool + */ + public function hello($host = '') + { + // Try extended hello first (RFC 2821) + return (bool)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); + } + + /** + * Send an SMTP HELO or EHLO command. + * Low-level implementation used by hello() + * @see hello() + * @param string $hello The HELO string + * @param string $host The hostname to say we are + * @access protected + * @return bool + */ + protected function sendHello($hello, $host) + { + $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); + $this->helo_rply = $this->last_reply; + return $noerror; + } + + /** + * Send an SMTP MAIL command. + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. + * Implements rfc 821: MAIL FROM: + * @param string $from Source address of this message + * @access public + * @return bool + */ + public function mail($from) + { + $useVerp = ($this->do_verp ? ' XVERP' : ''); + return $this->sendCommand( + 'MAIL FROM', + 'MAIL FROM:<' . $from . '>' . $useVerp, + 250 + ); + } + + /** + * Send an SMTP QUIT command. + * Closes the socket if there is no error or the $close_on_error argument is true. + * Implements from rfc 821: QUIT + * @param bool $close_on_error Should the connection close if an error occurs? + * @access public + * @return bool + */ + public function quit($close_on_error = true) + { + $noerror = $this->sendCommand('QUIT', 'QUIT', 221); + $err = $this->error; //Save any error + if ($noerror or $close_on_error) { + $this->close(); + $this->error = $err; //Restore any error from the quit command + } + return $noerror; + } + + /** + * Send an SMTP RCPT command. + * Sets the TO argument to $toaddr. + * Returns true if the recipient was accepted false if it was rejected. + * Implements from rfc 821: RCPT TO: + * @param string $toaddr The address the message is being sent to + * @access public + * @return bool + */ + public function recipient($toaddr) + { + return $this->sendCommand( + 'RCPT TO', + 'RCPT TO:<' . $toaddr . '>', + array(250, 251) + ); + } + + /** + * Send an SMTP RSET command. + * Abort any transaction that is currently in progress. + * Implements rfc 821: RSET + * @access public + * @return bool True on success. + */ + public function reset() + { + return $this->sendCommand('RSET', 'RSET', 250); + } + + /** + * Send a command to an SMTP server and check its return code. + * @param string $command The command name - not sent to the server + * @param string $commandstring The actual command to send + * @param int|array $expect One or more expected integer success codes + * @access protected + * @return bool True on success. + */ + protected function sendCommand($command, $commandstring, $expect) + { + if (!$this->connected()) { + $this->error = array( + 'error' => "Called $command without being connected" + ); + return false; + } + $this->client_send($commandstring . self::CRLF); + + $reply = $this->get_lines(); + $code = substr($reply, 0, 3); + + if ($this->do_debug >= 2) { + $this->edebug('SERVER -> CLIENT: ' . $reply); + } + + if (!in_array($code, (array)$expect)) { + $this->last_reply = null; + $this->error = array( + 'error' => "$command command failed", + 'smtp_code' => $code, + 'detail' => substr($reply, 4) + ); + if ($this->do_debug >= 1) { + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] . ': ' . $reply + ); + } + return false; + } + + $this->last_reply = $reply; + $this->error = null; + return true; + } + + /** + * Send an SMTP SAML command. + * Starts a mail transaction from the email address specified in $from. + * Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * Implements rfc 821: SAML FROM: + * @param string $from The address the message is from + * @access public + * @return bool + */ + public function sendAndMail($from) + { + return $this->sendCommand('SAML', "SAML FROM:$from", 250); + } + + /** + * Send an SMTP VRFY command. + * @param string $name The name to verify + * @access public + * @return bool + */ + public function verify($name) + { + return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); + } + + /** + * Send an SMTP NOOP command. + * Used to keep keep-alives alive, doesn't actually do anything + * @access public + * @return bool + */ + public function noop() + { + return $this->sendCommand('NOOP', 'NOOP', 250); + } + + /** + * Send an SMTP TURN command. + * This is an optional command for SMTP that this class does not support. + * This method is here to make the RFC821 Definition complete for this class + * and _may_ be implemented in future + * Implements from rfc 821: TURN + * @access public + * @return bool + */ + public function turn() + { + $this->error = array( + 'error' => 'The SMTP TURN command is not implemented' + ); + if ($this->do_debug >= 1) { + $this->edebug('SMTP NOTICE: ' . $this->error['error']); + } + return false; + } + + /** + * Send raw data to the server. + * @param string $data The data to send + * @access public + * @return int|bool The number of bytes sent to the server or false on error + */ + public function client_send($data) + { + if ($this->do_debug >= 1) { + $this->edebug("CLIENT -> SERVER: $data"); + } + return fwrite($this->smtp_conn, $data); + } + + /** + * Get the latest error. + * @access public + * @return array + */ + public function getError() + { + return $this->error; + } + + /** + * Get the last reply from the server. + * @access public + * @return string + */ + public function getLastReply() + { + return $this->last_reply; + } + + /** + * Read the SMTP server's response. + * Either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access protected + * @return string + */ + protected function get_lines() + { + // If the connection is bad, give up straight away + if (!is_resource($this->smtp_conn)) { + return ''; + } + $data = ''; + $endtime = 0; + stream_set_timeout($this->smtp_conn, $this->Timeout); + if ($this->Timelimit > 0) { + $endtime = time() + $this->Timelimit; + } + while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { + $str = @fgets($this->smtp_conn, 515); + if ($this->do_debug >= 4) { + $this->edebug("SMTP -> get_lines(): \$data was \"$data\""); + $this->edebug("SMTP -> get_lines(): \$str is \"$str\""); + } + $data .= $str; + if ($this->do_debug >= 4) { + $this->edebug("SMTP -> get_lines(): \$data is \"$data\""); + } + // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen + if ((isset($str[3]) and $str[3] == ' ')) { + break; + } + // Timed-out? Log and break + $info = stream_get_meta_data($this->smtp_conn); + if ($info['timed_out']) { + if ($this->do_debug >= 4) { + $this->edebug( + 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)' + ); + } + break; + } + // Now check if reads took too long + if ($endtime and time() > $endtime) { + if ($this->do_debug >= 4) { + $this->edebug( + 'SMTP -> get_lines(): timelimit reached ('. + $this->Timelimit . ' sec)' + ); + } + break; + } + } + return $data; + } + + /** + * Enable or disable VERP address generation. + * @param bool $enabled + */ + public function setVerp($enabled = false) + { + $this->do_verp = $enabled; + } + + /** + * Get VERP address generation mode. + * @return bool + */ + public function getVerp() + { + return $this->do_verp; + } + + /** + * Set debug output method. + * @param string $method The function/method to use for debugging output. + */ + public function setDebugOutput($method = 'echo') + { + $this->Debugoutput = $method; + } + + /** + * Get debug output method. + * @return string + */ + public function getDebugOutput() + { + return $this->Debugoutput; + } + + /** + * Set debug output level. + * @param int $level + */ + public function setDebugLevel($level = 0) + { + $this->do_debug = $level; + } + + /** + * Get debug output level. + * @return int + */ + public function getDebugLevel() + { + return $this->do_debug; + } + + /** + * Set SMTP timeout. + * @param int $timeout + */ + public function setTimeout($timeout = 0) + { + $this->Timeout = $timeout; + } + + /** + * Get SMTP timeout. + * @return int + */ + public function getTimeout() + { + return $this->Timeout; + } +} + +} diff --git a/app/models/QuesttypeModel.inc b/app/models/QuesttypeModel.inc new file mode 100644 index 00000000..fdeafe81 --- /dev/null +++ b/app/models/QuesttypeModel.inc @@ -0,0 +1,165 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\models; + + + /** + * Abstract class for implementing a QuesttypeModel. + * + * @author Oliver Hanraths + */ + abstract class QuesttypeModel extends \hhu\z\Model + { + + + + + /** + * Copy a Quest. + * + * @param int $userId ID of creating user + * @param int $sourceQuestId ID of Quest to copy from + * @param int $targetQuestId ID of Quest to copy to + * @param int $seminaryMediaIds Mapping of SeminaryMedia-IDs from source Seminary to targetSeminary + */ + public abstract function copyQuest($userId, $sourceQuestId, $targetQuestId, $seminaryMediaIds); + + + /** + * Load a Model. + * + * @static + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @param string $modelName Name of the QuesttypeModel to load + */ + public static function load($modelName) + { + // Determine full classname + $className = self::getClassName($modelName); + + try { + // Load class + static::loadClass($modelName, $className); + + // Validate class + static::checkClass($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \hhu\z\exceptions\QuesttypeModelNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \hhu\z\exceptions\QuesttypeModelNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a QuesttypeModel (Factory Pattern). + * + * @static + * @param string $questtypeName Name of the QuesttypeModel to instantiate + */ + public static function factory($questtypeName) + { + // Determine full classname + $className = self::getClassName($questtypeName); + + // Construct and return Model + return new $className(); + } + + + /** + * Determine the Model-classname for the given Questtype-name. + * + * @static + * @param string $questtypeName Questtype-name to get Model-classname of + * @return string Classname for the Questtype-name + */ + private static function getClassName($questtypeName) + { + $className = \nre\core\ClassLoader::concatClassNames($questtypeName, \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class())), 'model'); + + + return \nre\configs\AppConfig::$app['namespace']."questtypes\\$className"; + } + + + /** + * Load the class of a QuesttypeModel. + * + * @static + * @throws \nre\exceptions\ClassNotFoundException + * @param string $questtypeName Name of the QuesttypeModel to load + * @param string $fullClassName Name of the class to load + */ + private static function loadClass($questtypeName, $fullClassName) + { + // Determine folder to look in + $className = explode('\\', $fullClassName); + $className = array_pop($className); + + // Determine filename + $fileName = ROOT.DS.\nre\configs\AppConfig::$dirs['questtypes'].DS.strtolower($questtypeName).DS.$className.\nre\configs\CoreConfig::getFileExt('includes'); + + // Check file + if(!file_exists($fileName)) + { + throw new \nre\exceptions\ClassNotFoundException( + $fullClassName + ); + } + + // Include file + include_once($fileName); + } + + + /** + * Check inheritance of the QuesttypeModel-class. + * + * @static + * @throws \nre\exceptions\ClassNotValidException + * @param string $className Name of the class to check + * @param string $parentClassName Name of the parent class + */ + public static function checkClass($className, $parentClassName) + { + // Check if class is subclass of parent class + if(!is_subclass_of($className, $parentClassName)) { + throw new \nre\exceptions\ClassNotValidException( + $className + ); + } + } + + + + + /** + * Construct a new QuesttypeModel. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotValidException + * @throws \hhu\z\exceptions\QuesttypeModelNotFoundException + */ + public function __construct() + { + parent::__construct(); + } + + } + +?> diff --git a/app/requests/MailRequest.inc b/app/requests/MailRequest.inc new file mode 100644 index 00000000..baaf02ab --- /dev/null +++ b/app/requests/MailRequest.inc @@ -0,0 +1,92 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\requests; + + + /** + * Representation of a mail-request. + * + * @author Oliver Hanraths + */ + class MailRequest extends \nre\core\Request + { + /** + * Linker + * + * @var \nre\core\Linker + */ + private $linker = null; + + + + + /** + * Add a parameter. + * + * @param mixed $value Value of parameter + */ + public function addParam($value) + { + $this->params[] = $value; + } + + + /** + * Add multiple parameters. + * + * @param mixed $value1 Value of first parameter + * @param mixed … Values of further parameters + */ + public function addParams($value1) + { + $this->params = array_merge( + $this->params, + func_get_args() + ); + } + + + /** + * Delete all stored parameters (from offset on). + * + * @param int $offset Offset-index + */ + public function clearParams($offset=0) + { + $this->params = array_slice($this->params, 0, $offset); + } + + + /** + * Set linker instance for creating links. + * + * @param Linker $linker Linker instance for creating links + */ + public function setLinker(\nre\core\Linker $linker) + { + $this->linker = $linker; + } + + + /** + * Get linker instance for creating links. + * + * @return \nre\core\Linker Linker instance for creating links + */ + public function getLinker() + { + return $this->linker; + } + + } + +?> diff --git a/app/responses/MailResponse.inc b/app/responses/MailResponse.inc new file mode 100644 index 00000000..71ced1bc --- /dev/null +++ b/app/responses/MailResponse.inc @@ -0,0 +1,55 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\responses; + + + /** + * Representation of a mail-response. + * + * @author Oliver Hanraths + */ + class MailResponse extends \nre\core\Response + { + /** + * Mail subject + * + * @var string + */ + private $subject = null; + + + + + /** + * Set subject. + * + * @param string $subject Subject to set + */ + public function setSubject($subject) + { + $this->subject = $subject; + } + + + /** + * Get subject. + * + * @return string Subject + */ + public function getSubject() + { + return $this->subject; + } + + } + +?> diff --git a/app/views/QuesttypeView.inc b/app/views/QuesttypeView.inc new file mode 100644 index 00000000..234147be --- /dev/null +++ b/app/views/QuesttypeView.inc @@ -0,0 +1,76 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\views; + + + /** + * Abstract class for implementing a QuesttypeView. + * + * @author Oliver Hanraths + */ + class QuesttypeView extends \nre\core\View + { + + + + + /** + * Load and instantiate the QuesttypeView of a QuesttypeAgent. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of Layout in use + * @param string $agentName Name of the Agent + * @param string $action Current Action + * @param bool $isToplevel Agent is a ToplevelAgent + */ + public static function loadAndFactory($layoutName, $agentName=null, $action=null, $isToplevel=false) + { + return new QuesttypeView($layoutName, $agentName, $action, $isToplevel); + } + + + + + /** + * Construct a new QuesttypeView. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of Layout in use + * @param string $agentName Name of the Agent + * @param string $action Current Action + * @param bool $isToplevel Agent is a ToplevelAgent + */ + protected function __construct($layoutName, $agentName=null, $action=null, $isToplevel=false) + { + // Create template filename + // LayoutName + $fileName = ROOT.DS.\nre\configs\AppConfig::$dirs['questtypes'].DS.strtolower($agentName).DS.strtolower($layoutName).DS; + + // Action + $fileName .= strtolower($action); + + // File extension + $fileName .= \nre\configs\CoreConfig::getFileExt('views'); + + + // Check template file + if(!file_exists($fileName)) { + throw new \nre\exceptions\ViewNotFoundException($fileName); + } + + // Save filename + $this->templateFilename = $fileName; + } + + } + +?> diff --git a/bootstrap.inc b/bootstrap.inc new file mode 100644 index 00000000..667204b6 --- /dev/null +++ b/bootstrap.inc @@ -0,0 +1,33 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + // Include required classes + require_once(ROOT.DS.'configs'.DS.'CoreConfig.inc'); + require_once(ROOT.DS.\nre\configs\CoreConfig::getClassDir('core').DS.'Autoloader.inc'); + + + // Set PHP-logging + ini_set('error_log', ROOT.DS.\nre\configs\CoreConfig::getClassDir('logs').DS.'php'.\nre\configs\CoreConfig::getFileExt('logs')); + + // Register autoloader + \nre\core\Autoloader::register(); + + + // Initialize WebApi + $webApi = new \nre\apis\WebApi(); + + // Run WebApi + $webApi->run(); + + // Render output + $webApi->render(); + +?> diff --git a/configs/AppConfig.inc b/configs/AppConfig.inc new file mode 100644 index 00000000..9e18237b --- /dev/null +++ b/configs/AppConfig.inc @@ -0,0 +1,373 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace nre\configs; + + + /** + * Application configuration. + * + * This class contains static variables with configuration values for + * the specific application. + * + * @author Oliver Hanraths + */ + final class AppConfig + { + + /** + * Application values + * + * @static + * @var array + */ + public static $app = array( + 'name' => 'Questlab', + 'genericname' => 'The Legend of Z', + 'namespace' => 'hhu\\z\\', + 'timeZone' => 'Europe/Berlin', + 'mailsender' => '', + 'mailcontact' => '', + 'registration_host' => '', + 'languages' => array( + 'de' => 'de_DE.utf8' + ) + ); + + + /** + * Default values + * + * @static + * @var array + */ + public static $defaults = array( + 'toplevel' => 'html', + 'toplevel-error' => 'fault', + 'toplevel-mail' => 'textmail', + 'toplevel-htmlmail' => 'htmlmail', + 'intermediate' => 'introduction', + 'intermediate-error' => 'error', + 'intermediate-mail' => 'mail' + ); + + + /** + * Directories + * + * @static + * @var array + */ + public static $dirs = array( + 'locale' => 'locale', + 'media' => 'media', + 'seminarymedia' => 'seminarymedia', + 'questtypes' => 'questtypes', + 'temporary' => 'tmp', + 'uploads' => 'uploads', + 'seminaryuploads' => 'seminaryuploads' + ); + + + /** + * Media sizes + * + * @static + * @var array + */ + public static $media = array( + 'questgroup' => array( + 'width' => 480, + 'height' => 5000 + ), + 'avatar' => array( + 'width' => 500, + 'height' => 500 + ), + 'charactergroup' => array( + 'width' => 80, + 'height' => 80 + ), + 'charactergroupsquest' => array( + 'width' => 80, + 'height' => 80 + ) + ); + + + /** + * Allowed mimetypes with sizes + * + * @static + * @var array + */ + public static $mimetypes = array( + 'icons' => array( + array( + 'mimetype' => 'image/jpeg', + 'size' => 102400 + ), + array( + 'mimetype' => 'image/png', + 'size' => 204800 + ) + ), + 'moodpics' => array( + array( + 'mimetype' => 'image/jpeg', + 'size' => 524288 + ), + array( + 'mimetype' => 'image/png', + 'size' => 1048576 + ) + ), + 'charactergroupsquests' => array( + array( + 'mimetype' => 'image/jpeg', + 'size' => 1048576 + ) + ) + ); + + + /** + * Miscellaneous settings + * + * @static + * @var array + */ + public static $misc = array( + 'ranking_range' => 2, + 'achievements_range' => 3, + 'title_delimiter' => ' – ', + 'lists_limit' => 10 + ); + + + /** + * Validation settings for user input + * + * @static + * @var array + */ + public static $validation = array( + 'username' => array( + 'minlength' => 5, + 'maxlength' => 12, + 'regex' => '/^\w*$/' + ), + 'email' => array( + 'regex' => '/^\S+@[\w\d.-]{2,}\.[\w]{2,6}$/iU' + ), + 'prename' => array( + 'minlength' => 2, + 'maxlength' => 32, + 'regex' => '/^(\S| )*$/' + ), + 'surname' => array( + 'minlength' => 2, + 'maxlength' => 32, + 'regex' => '/^\S*$/' + ), + 'password' => array( + 'minlength' => 5, + 'maxlength' => 64 + ), + 'charactername' => array( + 'minlength' => 5, + 'maxlength' => 12, + 'regex' => '/^\w*$/' + ), + 'charactergroupsgroupname' => array( + 'minlength' => 4, + 'maxlength' => 32, + 'regex' => '/^(\S| )*$/' + ), + 'preferred' => array( + 'regex' => '/^(0|1)$/' + ), + 'charactergroupname' => array( + 'minlength' => 4, + 'maxlength' => 32, + 'regex' => '/^(\S| )*$/' + ), + 'motto' => array( + 'maxlength' => 128 + ), + 'title' => array( + 'minlength' => 4, + 'maxlength' => 32, + 'regex' => '/^(\S| )*$/' + ), + 'xps' => array( + 'minlength' => 1, + 'regex' => '/^(\d*)$/' + ), + 'course' => array( + 'maxlength' => 128 + ), + 'charactertypename' => array( + 'minlength' => 1, + 'maxlength' => 32 + ), + 'questgroupshierarchytitle' => array( + 'minlength' => 1, + 'maxlength' => 64 + ), + 'deadline' => array( + 'regex' => '/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})?$/' + ), + 'choice' => array( + 'minlength' => 1, + 'maxlength' => 128 + ), + 'answer' => array( + 'minlength' => 1, + 'maxlength' => 255 + ) + ); + + + /** + * Routes + * + * @static + * @var array + */ + public static $routes = array( + array('^users/all/?$', 'users/index/all', true), + array('^users/([^/]+)/(edit|delete)/?$', 'users/$2/$1', true), + array('^users/(?!(index|login|register|logout|manage|create|edit|delete))/?', 'users/user/$1', true), + array('^seminaries/([^/]+)/(edit|copy|delete)/?$', 'seminaries/$2/$1', true), + array('^seminaries/(?!(index|create|edit|copy|delete|calculatexps))/?', 'seminaries/seminary/$1', true), + array('^xplevels/([^/]+)/(manage)/?$', 'xplevels/$2/$1', true), + array('^questgroupshierarchy/([^/]+)/create/?$', 'questgroupshierarchy/create/$1', true), + array('^questgroupshierarchy/([^/]+)/([^/]+)/(edit|delete|moveup|movedown)/?$', 'questgroupshierarchy/$3/$1/$2', true), + array('^questgroups/([^/]+)/create/?$', 'questgroups/create/$1', true), + array('^questgroups/([^/]+)/([^/]+)/(edit|edittexts|delete|moveup|movedown)/?$','questgroups/$3/$1/$2', true), + array('^questgroups/([^/]+)/([^/]+)/?$', 'questgroups/questgroup/$1/$2', true), + array('^quests/([^/]+)/?$', 'quests/index/$1', true), + array('^quests/([^/]+)/all/?$', 'quests/index/$1/all', true), + array('^quests/([^/]+)/([^/]+)/(create|createmedia)/?$', 'quests/$3/$1/$2', true), + array('^quests/([^/]+)/([^/]+)/([^/]+)/(submissions|edit|edittask|edittexts|delete)/?$','quests/$4/$1/$2/$3', true), + array('^quests/([^/]+)/([^/]+)/([^/]+)/(submission)/([^/]+)/?$', 'quests/$4/$1/$2/$3/$5', true), + array('^quests/(?!(index|create|createmedia))/?', 'quests/quest/$1', true), + array('^characters/([^/]+)/(register|manage)/?$', 'characters/$2/$1', true), + array('^characters/([^/]+)/?$', 'characters/index/$1', true), + array('^characters/([^/]+)/all/?$', 'characters/index/$1/all', true), + array('^characters/([^/]+)/([^/]+)/(edit|delete)/?$', 'characters/$3/$1/$2', true), + array('^characters/([^/]+)/(?!(index|register|manage))/?', 'characters/character/$1/$2', true), + array('^charactertypes/([^/]+)/?$', 'charactertypes/index/$1', true), + array('^charactertypes/([^/]+)/create/?$', 'charactertypes/create/$1', true), + array('^charactertypes/([^/]+)/([^/]+)/(edit|delete)/?$', 'charactertypes/$3/$1/$2', true), + array('^charactergroups/([^/]+)/?$', 'charactergroups/index/$1', true), + array('^charactergroups/([^/]+)/(create)/?$', 'charactergroups/creategroupsgroup/$1/$2', true), + array('^charactergroups/([^/]+)/([^/]+)/?$', 'charactergroups/groupsgroup/$1/$2', true), + array('^charactergroups/([^/]+)/([^/]+)/(edit|delete)/?$', 'charactergroups/$3groupsgroup/$1/$2', true), + array('^charactergroups/([^/]+)/([^/]+)/(create)/?$', 'charactergroups/creategroup/$1/$2/$3', true), + array('^charactergroups/([^/]+)/([^/]+)/([^/]+)/?$', 'charactergroups/group/$1/$2/$3', true), + array('^charactergroups/([^/]+)/([^/]+)/([^/]+)/(manage|edit|delete)/?$', 'charactergroups/$4group/$1/$2/$3', true), + array('^charactergroupsquests/([^/]+)/([^/]+)/create/?$', 'charactergroupsquests/create/$1/$2', true), + array('^charactergroupsquests/([^/]+)/([^/]+)/([^/]+)/?$', 'charactergroupsquests/quest/$1/$2/$3', true), + array('^charactergroupsquests/([^/]+)/([^/]+)/([^/]+)/(edit|delete|manage)/?$', 'charactergroupsquests/$4/$1/$2/$3', true), + array('^achievements/([^/]+)/(create|manage)/?$', 'achievements/$2/$1', true), + array('^achievements/([^/]+)/([^/]+)/(edit|conditions|moveup|movedown|delete)/?$', 'achievements/$3/$1/$2', true), + array('^achievements/([^/]+)/?$', 'achievements/index/$1', true), + array('^library/([^/]+)/?$', 'library/index/$1', true), + array('^library/([^/]+)/create/?$', 'library/create/$1', true), + array('^library/([^/]+)/([^/]+)/?$', 'library/topic/$1/$2', true), + array('^library/([^/]+)/([^/]+)/(edit|delete|manage)/?$', 'library/$3/$1/$2', true), + array('^media/(.*)$', 'media/$1?layout=binary', false), + array('^uploads/(.*)$', 'uploads/$1?layout=binary', false) + ); + + + /** + * Reverse routes + * + * @static + * @var array + */ + public static $reverseRoutes = array( + array('^users/index/all$', 'users/all', true), + array('^users/user/(.*)$', 'users/$1', true), + array('^users/([^/]+)/(.*)$', 'users/$2/$1', true), + array('^seminaries/seminary/(.*)$', 'seminaries/$1', false), + array('^xplevels/(manage)/(.*)$', 'xplevels/$2/$1', false), + array('^questgroupshierarchy/create/(.*)$', 'questgroupshierarchy/$1/create', true), + array('^questgroupshierarchy/([^/]+)/(.*)$', 'questgroupshierarchy/$2/$1', true), + array('^questgroups/create/(.*)$', 'questgroups/$1/create', true), + array('^questgroups/questgroup/(.*)$', 'questgroups/$1', true), + array('^questgroups/(edit|edittexts|delete|moveup|movedown)/(.*)$', 'questgroups/$2/$1', true), + array('^quests/index/(.+)$', 'quests/$1', true), + array('^quests/quest/(.*)$', 'quests/$1', true), + array('^quests/(create|createmedia)/(.*)$', 'quests/$2/$1', true), + array('^quests/(submissions|edit|edittask|edittexts|delete)/([^/]+)/([^/]+)/([^/]+)$', 'quests/$2/$3/$4/$1', true), + array('^quests/(submission)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$', 'quests/$2/$3/$4/$1/$5', true), + array('^characters/(index|character)/(.*)$', 'characters/$2', true), + array('^characters/(register|manage)/([^/]+)$', 'characters/$2/$1', true), + array('^characters/(edit|delete)/([^/]+)/([^/]+)$', 'characters/$2/$3/$1', true), + array('^charactertypes/index/([^/]+)$', 'charactertypes/$1', true), + array('^charactertypes/create/([^/]+)$', 'charactertypes/$1/create', true), + array('^charactertypes/(edit|delete)/([^/]+)/([^/]+)$', 'charactertypes/$2/$3/$1', true), + array('^charactergroups/index/([^/]+)$', 'charactergroups/$1', true), + array('^charactergroups/creategroupsgroup/([^/]+)$', 'charactergroups/$1/create', true), + array('^charactergroups/groupsgroup/([^/]+)/([^/]+)$', 'charactergroups/$1/$2', true), + array('^charactergroups/(edit|delete)groupsgroup/([^/]+)/([^/]+)$', 'charactergroups/$2/$3/$1', true), + array('^charactergroups/creategroup/([^/]+)/([^/]+)$', 'charactergroups/$1/$2/create', true), + array('^charactergroups/group/([^/]+)/([^/]+)/([^/]+)$', 'charactergroups/$1/$2/$3', true), + array('^charactergroups/(manage|edit|delete)group/([^/]+)/([^/]+)/([^/]+)$', 'charactergroups/$2/$3/$4/$1', true), + array('^charactergroupsquests/create/([^/]+)/([^/]+)/?$', 'charactergroupsquests/$1/$2/create', true), + array('^charactergroupsquests/quest/(.*)$', 'charactergroupsquests/$1', true), + array('^charactergroupsquests/(edit|delete|manage)/([^/]+)/([^/]+)/([^/]+)$', 'charactergroupsquests/$2/$3/$4/$1', true), + array('^achievements/index/(.*)$', 'achievements/$1', true), + array('^achievements/(create|manage)/(.*)$', 'achievements/$2/$1', true), + array('^achievements/(edit|conditions|moveup|movedown|delete)/(.*)$', 'achievements/$2/$1', true), + array('^library/index/([^/]+)/?$', 'library/$1', true), + array('^library/create/([^/]+)/?$', 'library/$1/create', true), + array('^library/topic/([^/]+)/([^/]+)/?$', 'library/$1/$2', true), + array('^library/(edit|delete|manage)/([^/]+)/([^/]+)/?$', 'library/$2/$3/$1', true) + ); + + + /** + * Database connection settings + * + * @static + * @var array + */ + public static $database = array( + 'user' => 'z', + 'host' => 'localhost', + 'password' => 'legendofZ', + 'db' => 'z' + ); + + + /** + * Mailserver connection settings + * + * @static + * @var array + */ + public static $mail = array( + 'host' => '', + 'port' => 465, + 'username' => '', + 'password' => '', + 'secure' => '', + 'charset' => 'UTF-8' + ); + + } + +?> diff --git a/configs/CoreConfig.inc b/configs/CoreConfig.inc new file mode 100644 index 00000000..c2c2605d --- /dev/null +++ b/configs/CoreConfig.inc @@ -0,0 +1,167 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\configs; + + + /** + * Core configuration. + * + * This class contains static variables with configuration values. + * + * @author coderkun + */ + final class CoreConfig + { + + /** + * Core values + * + * @static + * @var array + */ + public static $core = array( + 'namespace' => 'nre\\', + ); + + + /** + * Directories + * + * @static + * @var array + */ + public static $dirs = array( + 'core' => 'core', + 'publicDir' => 'www' + ); + + + /** + * File extensions + * + * @static + * @var array + */ + public static $fileExts = array( + 'default' => 'inc', + 'views' => 'tpl', + 'logs' => 'log', + ); + + + /** + * Default values + * + * @static + * @var array + */ + public static $defaults = array( + 'action' => 'index', + 'errorFile' => 'error', + 'inlineErrorFile' => 'inlineerror' + ); + + + /** + * Miscellaneous settings + * + * @static + * @var array + */ + public static $misc = array( + 'fileExtDot' => '.' + ); + + + /** + * Logging settings + * + * @static + * @var array + */ + public static $log = array( + 'filename' => 'errors', + 'format' => 'Fehler %d: %s in %s, Zeile %d' + ); + + + /** + * Class-specific settings + * + * @static + * @var array + */ + public static $classes = array( + 'linker' => array( + 'url' => array( + 'length' => 128, + 'delimiter' => '-' + ) + ) + ); + + + + + /** + * Determine the directory for a specific classtype. + * + * @param string $classType Classtype to get directory of + * @return string Directory of given classtype + */ + public static function getClassDir($classType) + { + // Default directory (for core classes) + $classDir = self::$dirs['core']; + + // Configurable directory + if(array_key_exists($classType, self::$dirs)) { + $classDir = self::$dirs[$classType]; + } + else + { + // Default directory for classtype + if(is_dir(ROOT.DS.$classType)) { + $classDir = $classType; + } + } + + + // Return directory + return $classDir; + } + + + /** + * Determine the file extension for a specific filetype. + * + * @param string $fileType Filetype to get file extension of + * @return string File extension of given filetype + */ + public static function getFileExt($fileType) + { + // Default file extension + $fileExt = self::$fileExts['default']; + + // Configurable file extension + if(array_key_exists($fileType, self::$fileExts)) { + $fileExt = self::$fileExts[$fileType]; + } + + + // Return file extension + return self::$misc['fileExtDot'].$fileExt; + } + + } + +?> diff --git a/controllers/AchievementsController.inc b/controllers/AchievementsController.inc new file mode 100644 index 00000000..4f52b91d --- /dev/null +++ b/controllers/AchievementsController.inc @@ -0,0 +1,960 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to list Achievements. + * + * @author Oliver Hanraths + */ + class AchievementsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('achievements', 'seminaries', 'media', 'characters', 'quests'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator', 'user'), + 'moveup' => array('admin', 'moderator', 'user'), + 'movedown' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'conditions' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'create' => array('admin'), + 'moveup' => array('admin', 'moderator'), + 'movedown' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator'), + 'conditions' => array('admin', 'moderator'), + 'delete' => array('admin') + ); + + + + + /** + * Action: index. + * + * List Achievements of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + */ + public function index($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = SeminaryController::$character; + + // Get seldom Achievements + $seldomAchievements = $this->Achievements->getSeldomAchievements($seminary['id'], \nre\configs\AppConfig::$misc['achievements_range'], false); + foreach($seldomAchievements as &$achievement) { + $achievement['achieved'] = $this->Achievements->hasCharacterAchievedAchievement($achievement['id'], $character['id']); + } + + // Get Characters with the most Achievements + $successfulCharacters = $this->Characters->getCharactersWithMostAchievements($seminary['id'], \nre\configs\AppConfig::$misc['achievements_range'], false); + + // Get total count of Achievements for Seminary + $achievementsCount = $this->Achievements->getAchievementsCountForSeminary($seminary['id'], false); + + // Get achieved Achievements + $achievedAchievements = $this->Achievements->getAchievedAchievementsForCharacter($character['id']); + + // Get unachieved Achievements + $unachievedAchievements = array_merge( + $this->Achievements->getUnachhievedAchievementsForCharacter($seminary['id'], $character['id'], false, false), + $this->Achievements->getUnachievedOnlyOnceAchievementsForSeminary($seminary['id']) + ); + usort($unachievedAchievements, function($a, $b) { + if($a['pos'] == $b['pos']) { + return 0; + } + return ($a['pos'] > $b['pos']) ? 1 : -1; + }); + foreach($unachievedAchievements as &$achievement) + { + // Get Character progress + if($achievement['progress']) + { + $conditions = array(); + switch($achievement['condition']) + { + // Character conditions + case 'character': + $conditionsCharacter = $this->Achievements->getAchievementConditionsCharacter($achievement['id']); + foreach($conditionsCharacter as &$condition) + { + $conditions[] = array( + 'func' => 'getAchievementConditionCharacterProgress', + 'params' => array( + $condition['field'], + $condition['value'], + $character['id'] + ) + ); + } + break; + // Quest conditions + case 'quest': + $conditionsQuest = $this->Achievements->getAchievementConditionsQuest($achievement['id']); + foreach($conditionsQuest as &$condition) + { + $conditions[] = array( + 'func' => 'getAchievementConditionQuestProgress', + 'params' => array( + $condition['field'], + $condition['count'], + $condition['value'], + $condition['status'], + $condition['groupby'], + $condition['quest_id'], + $character['id'] + ) + ); + } + break; + // Achievement conditions + case 'achievement': + $conditionsAchievement = $this->Achievements->getAchievementConditionsAchievement($achievement['id']); + foreach($conditionsAchievement as &$condition) + { + $conditions[] = array( + 'func' => 'getAchievementConditionAchievementProgress', + 'params' => array( + $condition['field'], + $condition['count'], + $condition['value'], + $condition['groupby'], + $condition['meta_achievement_id'], + $character['id'] + ) + ); + } + break; + } + + $characterProgresses = array(); + foreach($conditions as &$condition) + { + // Calculate progress of condition + $characterProgresses[] = call_user_func_array( + array( + $this->Achievements, + $condition['func'] + ), + $condition['params'] + ); + } + + $achievement['characterProgress'] = array_sum($characterProgresses) / count($characterProgresses); + } + } + + // Get ranking + $character['rank'] = $this->Achievements->getCountRank($seminary['id'], count($achievedAchievements)); + + + // Set title + $this->addTitleLocalized('Achievements'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('character', $character); + $this->set('seldomAchievements', $seldomAchievements); + $this->set('successfulCharacters', $successfulCharacters); + $this->set('achievementsCount', $achievementsCount); + $this->set('achievedAchievements', $achievedAchievements); + $this->set('unachievedAchievements', $unachievedAchievements); + } + + + /** + * Action: manage. + * + * Manage Achievements of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + */ + public function manage($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievements + $achievements = $this->Achievements->getAchievementsForSeminary($seminary['id']); + + + // Set title + $this->addTitleLocalized('Manage Achievements'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('achievements', $achievements); + } + + + /** + * Action: create. + * + * Create a new Achievement. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + */ + public function create($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievements conditions + $conditions = $this->Achievements->getAchievementsConditions(); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = ''; + $description = ''; + $progress = 0; + $hidden = 0; + $onlyOnce = 0; + $allConditions = 1; + $deadline = ''; + $condition = $conditions[0]['condition']; + $fields = array('title', 'deadline'); + $validation = array(); + + // Create Achievement + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Achievements->achievementTitleExists($seminary['id'], $title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $description = $this->request->getPostParam('description'); + $progress = !is_null($this->request->getPostParam('progress')); + $hidden = !is_null($this->request->getPostParam('hidden')); + $onlyOnce = !is_null($this->request->getPostParam('only_once')); + $allConditions = !is_null($this->request->getPostParam('all_conditions')); + $deadline = $this->request->getPostParam('deadline'); + $condition = $this->request->getPostParam('condition'); + + // Validate condition + $conditionIndex = null; + foreach($conditions as $index => &$c) { + if($condition == $c['condition']) { + $conditionIndex = $index; + } + } + if(is_null($conditionIndex)) { + throw new \nre\exceptions\ParamsNotValidException($condition); + } + + // Validate images + $images = array( + 'unachieved_image' => null, + 'achieved_image' => null + ); + foreach($images as $key => $image) + { + if(!empty($_FILES) && array_key_exists($key, $_FILES) && $_FILES[$key]['error'] != UPLOAD_ERR_NO_FILE) + { + $images[$key] = $_FILES[$key]; + + // Check error + if($images[$key]['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'error', $image[$key]['error']); + } + + // Check mimetype + $mediaMimetype = null; + $images[$key]['mimetype'] = \hhu\z\Utils::getMimetype($images[$key]['tmp_name'], $images[$key]['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $images[$key]['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'mimetype', $images[$key]['mimetype']); + } + elseif($images[$key]['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'size', $mediaMimetype['size']); + } + } + } + + // Create Achievement + if($validation === true) + { + $achievementId = $this->Achievements->createAchievement( + $this->Auth->getUserId(), + $seminary['id'], + $conditions[$conditionIndex]['id'], + $title, + $description, + $progress, + $hidden, + $onlyOnce, + $allConditions, + (!empty($deadline)) ? $deadline : NULL + ); + $achievement = $this->Achievements->getAchievementById($achievementId); + + // Upload images + foreach($images as $key => &$image) + { + if(!is_null($image)) + { + $image['media_id'] = $this->Media->createAchievementMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('achievement-%d', $achievement['id']).(substr($key, 0, 2) == 'un' ? '-locked' : NULL), + '', + $image['mimetype'], + $image['tmp_name'] + ); + } + } + if(!is_null($images['unachieved_image']) && $images['unachieved_image']['media_id'] !== false) { + $this->Achievements->setUnachievedMediaForAchievement($achievement['id'], $images['unachieved_image']['media_id']); + } + if(!is_null($images['achieved_image']) && $images['achieved_image']['media_id'] !== false) { + $this->Achievements->setAchievedMediaForAchievement($achievement['id'], $images['achieved_image']['media_id']); + } + + // Redirect to condition editing + $this->redirect($this->linker->link(array('conditions', $seminary['url'], $achievement['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('Create Achievement'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('title', $title); + $this->set('description', $description); + $this->set('progress', $progress); + $this->set('hidden', $hidden); + $this->set('onlyOnce', $onlyOnce); + $this->set('allConditions', $allConditions); + $this->set('deadline', $deadline); + $this->set('condition', $condition); + $this->set('conditions', $conditions); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: moveup. + * + * Move an Achievement up (decrement position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $achievementUrl URL-title of Achievement + */ + public function moveup($seminaryUrl, $achievementUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Set position + $this->Achievements->moveAchievement($achievement, true); + + + // Redirect + $this->redirect($this->linker->link(array('manage', $seminary['url']), 1, true, null, false, $achievement['url'])); + } + + + /** + * Action: movedown. + * + * Move an Achievement down (increment position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $achievementUrl URL-title of Achievement + */ + public function movedown($seminaryUrl, $achievementUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Set position + $this->Achievements->moveAchievement($achievement, false); + + + // Redirect + $this->redirect($this->linker->link(array('manage', $seminary['url']), 1, true, null, false, $achievement['url'])); + } + + + /** + * Action: edit. + * + * Edit an Achievement. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $achievementUrl URL-title of Achievement to edit + */ + public function edit($seminaryUrl, $achievementUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Get Achievements conditions + $conditions = $this->Achievements->getAchievementsConditions(); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = $achievement['title']; + $description = $achievement['description']; + $progress = $achievement['progress']; + $hidden = $achievement['hidden']; + $onlyOnce = $achievement['only_once']; + $allConditions = $achievement['all_conditions']; + $deadline = $achievement['deadline']; + $condition = $achievement['condition']; + $fields = array('title', 'deadline'); + $validation = array(); + + // Edit Achievement + if($this->request->getRequestMethod() == 'POST' && (!is_null($this->request->getPostParam('edit')) || !is_null($this->request->getPostParam('edit-conditions')))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Achievements->achievementTitleExists($seminary['id'], $title, $achievement['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $description = $this->request->getPostParam('description'); + $progress = !is_null($this->request->getPostParam('progress')); + $hidden = !is_null($this->request->getPostParam('hidden')); + $onlyOnce = !is_null($this->request->getPostParam('only_once')); + $allConditions = !is_null($this->request->getPostParam('all_conditions')); + $deadline = $this->request->getPostParam('deadline'); + $condition = $this->request->getPostParam('condition'); + + // Validate condition + $conditionIndex = null; + foreach($conditions as $index => &$c) { + if($condition == $c['condition']) { + $conditionIndex = $index; + } + } + if(is_null($conditionIndex)) { + throw new \nre\exceptions\ParamsNotValidException($condition); + } + + // Validate images + $images = array( + 'unachieved_image' => null, + 'achieved_image' => null + ); + foreach($images as $key => $image) + { + if(!empty($_FILES) && array_key_exists($key, $_FILES) && $_FILES[$key]['error'] != UPLOAD_ERR_NO_FILE) + { + $images[$key] = $_FILES[$key]; + + // Check error + if($images[$key]['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'error', $image[$key]['error']); + } + + // Check mimetype + $mediaMimetype = null; + $images[$key]['mimetype'] = \hhu\z\Utils::getMimetype($images[$key]['tmp_name'], $images[$key]['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $images[$key]['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'mimetype', $images[$key]['mimetype']); + } + elseif($images[$key]['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'image', 'size', $mediaMimetype['size']); + } + } + } + + // Edit Achievement + if($validation === true) + { + $this->Achievements->editAchievement( + $achievement['id'], + $conditions[$conditionIndex]['id'], + $title, + $description, + $progress, + $hidden, + $onlyOnce, + $allConditions, + (!empty($deadline)) ? $deadline : NULL + ); + + // Remove old conditions + if($conditions[$conditionIndex]['condition'] != $achievement['condition']) + { + var_dump("remove"); + switch($achievement['condition']) + { + // Date conditions + case 'date': + foreach($this->Achievements->getAchievementConditionsDate($achievement['id']) as $c) { + $this->Achievements->deleteAchievementConditionDate($c['id']); + } + break; + // Character conditions + case 'character': + foreach($this->Achievements->getAchievementConditionsCharacter($achievement['id']) as $c) { + $this->Achievements->deleteAchievementConditionCharacter($c['id']); + } + break; + // Quest conditions + case 'quest': + foreach($this->Achievements->getAchievementConditionsQuest($achievement['id']) as $c) { + $this->Achievements->deleteAchievementConditionQuest($c['id']); + } + break; + // Achievement conditions + case 'achievement': + foreach($this->Achievements->getAchievementConditionsAchievement($achievement['id']) as $c) { + $this->Achievements->deleteAchievementConditionAchievement($c['id']); + } + break; + } + } + + // Upload images + foreach($images as $key => &$image) + { + if(!is_null($image)) + { + $image['media_id'] = $this->Media->createAchievementMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('achievement-%d', $achievement['id']).(substr($key, 0, 2) == 'un' ? '-locked' : NULL), + '', + $image['mimetype'], + $image['tmp_name'] + ); + } + } + if(!is_null($images['unachieved_image']) && $images['unachieved_image']['media_id'] !== false) { + $this->Achievements->setUnachievedMediaForAchievement($achievement['id'], $images['unachieved_image']['media_id']); + } + if(!is_null($images['achieved_image']) && $images['achieved_image']['media_id'] !== false) { + $this->Achievements->setAchievedMediaForAchievement($achievement['id'], $images['achieved_image']['media_id']); + } + + // Redirect + if(!is_null($this->request->getPostParam('edit-conditions'))) { + // To condition editing + $this->redirect($this->linker->link(array('conditions', $seminary['url'], $achievement['url']), 1)); + } + else { + // To overview + $this->redirect($this->linker->link(array('manage', $seminary['url']), 1, true, null, false, $achievement['url'])); + } + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('Edit Achievement'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('achievement', $achievement); + $this->set('title', $title); + $this->set('description', $description); + $this->set('progress', $progress); + $this->set('hidden', $hidden); + $this->set('onlyOnce', $onlyOnce); + $this->set('allConditions', $allConditions); + $this->set('deadline', $deadline); + $this->set('condition', $condition); + $this->set('conditions', $conditions); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: conditions. + * + * Edit conditions of an Achievement. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $achievementUrl URL-title of Achievement to edit + */ + public function conditions($seminaryUrl, $achievementUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Get conditions + $conditions = array(); + switch($achievement['condition']) + { + // Date conditions + case 'date': + $conditions = $this->Achievements->getAchievementConditionsDate($achievement['id']); + break; + // Character conditions + case 'character': + $conditions = $this->Achievements->getAchievementConditionsCharacter($achievement['id']); + break; + // Quest conditions + case 'quest': + $conditions = $this->Achievements->getAchievementConditionsQuest($achievement['id']); + break; + // Achievement conditions + case 'achievement': + $conditions = $this->Achievements->getAchievementConditionsAchievement($achievement['id']); + break; + } + + // Values + $characterFields = array( + 'id', 'created', 'user_id', 'name', 'url', 'xps', 'quest_xps', 'avatar_id', + 'charactertype_id', 'charactertype_name', 'charactertype_url', + 'xplevel_id', 'xplevel' + ); + $questFields = array( + 'id', 'quest_id', 'character_id', 'created', 'status' + ); + $achievementFields = array( + 'achievement_id', 'character_id', 'created' + ); + $quests = $this->Quests->getQuestsForSeminary($seminary['id']); + $achievements = $this->Achievements->getAchievementsForSeminary($seminary['id']); + $deletes = array(); + + // Save conditions + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get entered conditions + $selectedConditions = $this->request->getPostParam('conditions'); + $deletes = $this->request->getPostParam('deletes'); + if(!is_array($deletes)) { + $deletes = array(); + } + + // Edit or delete conditions + foreach($conditions as &$condition) + { + $selectedCondition = $selectedConditions[$condition['id']]; + switch($achievement['condition']) + { + // Date conditions + case 'date': + if(array_key_exists($condition['id'], $deletes)) { + $this->Achievements->deleteAchievementConditionDate($condition['id']); + } + else { + $this->Achievements->editAchievementConditionDate( + $condition['id'], + $selectedCondition['select'] + ); + } + break; + // Character conditions + case 'character': + if(array_key_exists($condition['id'], $deletes)) { + $this->Achievements->deleteAchievementConditionCharacter($condition['id']); + } + else { + $this->Achievements->editAchievementConditionCharacter( + $condition['id'], + $selectedCondition['field'], + $selectedCondition['value'] + ); + } + break; + // Quest conditions + case 'quest': + if(array_key_exists($condition['id'], $deletes)) { + $this->Achievements->deleteAchievementConditionQuest($condition['id']); + } + else + { + // Get selected Quest + $questIndex = null; + if(!empty($selectedCondition['quest'])) { + foreach($quests as $index => &$quest) { + if($quest['url'] == $selectedCondition['quest']) { + $questIndex = $index; + } + } + } + + // Edit condition + $this->Achievements->editAchievementConditionQuest( + $condition['id'], + $selectedCondition['field'], + array_key_exists('count', $selectedCondition), + $selectedCondition['value'], + (!is_null($questIndex)) ? $quests[$questIndex]['id'] : null, + ($selectedCondition['status'] != '') ? $selectedCondition['status'] : null, + (!empty($selectedCondition['groupby'])) ? $selectedCondition['groupby'] : null + ); + } + break; + // Achievement conditions + case 'achievement': + if(array_key_exists($condition['id'], $deletes)) { + $this->Achievements->deleteAchievementConditionAchievement($condition['id']); + } + else + { + // Get selected Achievement + $achievmentIndex = null; + if(!empty($selectedCondition['achievement'])) { + foreach($achievements as $index => &$a) { + if($a['url'] == $selectedCondition['achievement']) { + $achievementIndex = $index; + } + } + } + + // Edit condition + $this->Achievements->editAchievementConditionAchievement( + $condition['id'], + $selectedCondition['field'], + array_key_exists('count', $selectedCondition), + $selectedCondition['value'], + (!is_null($achievementIndex)) ? $achievements[$achievementIndex]['id'] : null, + (!empty($selectedCondition['groupby'])) ? $selectedCondition['groupby'] : null + ); + } + break; + } + } + + // Add new condition + if(array_key_exists('new', $selectedConditions)) + { + $condition = $selectedConditions['new']; + switch($achievement['condition']) + { + // Date conditions + case 'date': + if(!empty($condition['select'])) { + $this->Achievements->addAchievementConditionDate( + $this->Auth->getUserId(), + $achievement['id'], + $condition['select'] + ); + } + break; + // Character conditions + case 'character': + if(!empty($condition['value'])) { + $this->Achievements->addAchievementConditionCharacter( + $this->Auth->getUserId(), + $achievement['id'], + $condition['field'], + $condition['value'] + ); + } + break; + // Quest conditions + case 'quest': + if(!empty($condition['value'])) + { + // Get selected Quest + $questIndex = null; + if(!empty($condition['quest'])) { + foreach($quests as $index => &$quest) { + if($quest['url'] == $condition['quest']) { + $questIndex = $index; + } + } + } + + // Edit condition + $this->Achievements->addAchievementConditionQuest( + $this->Auth->getUserId(), + $achievement['id'], + $condition['field'], + array_key_exists('count', $condition), + $condition['value'], + (!is_null($questIndex)) ? $quests[$questIndex]['id'] : null, + ($condition['status'] != '') ? $condition['status'] : null, + (!empty($condition['groupby'])) ? $condition['groupby'] : null + ); + } + break; + // Achievement conditions + case 'achievement': + if(!empty($condition['value'])) + { + // Get selected Achievement + $achievmentIndex = null; + if(!empty($selectedCondition['achievement'])) { + foreach($achievements as $index => &$a) { + if($a['url'] == $selectedCondition['achievement']) { + $achievementIndex = $index; + } + } + } + + // Edit condition + $this->Achievements->addAchievementConditionAchievement( + $this->Auth->getUserId(), + $achievement['id'], + $condition['field'], + array_key_exists('count', $condition), + $condition['value'], + (!is_null($achievementIndex)) ? $achievements[$achievementIndex]['id'] : null, + (!empty($condition['groupby'])) ? $condition['groupby'] : null + ); + } + break; + } + } + + // Redirect to overview + $this->redirect($this->linker->link(array('manage', $seminary['url']), 1, true, null, false, $achievement['url'])); + } + + + // Set title + $this->addTitleLocalized('Edit Achievement conditions'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('achievement', $achievement); + $this->set('conditions', $conditions); + $this->set('characterFields', $characterFields); + $this->set('questFields', $questFields); + $this->set('quests', $quests); + $this->set('achievementFields', $achievementFields); + $this->set('achievements', $achievements); + $this->set('deletes', $deletes); + } + + + /** + * Action: delete. + * + * Delete an Achievement. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $achievementUrl URL-title of Achievement + */ + public function delete($seminaryUrl, $achievementUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Achievements->deleteAchievement($achievement); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('manage', $seminary['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete seminary'); + + // Show confirmation + $this->set('seminary', $seminary); + $this->set('achievement', $achievement); + } + } + +?> diff --git a/controllers/AjaxController.inc b/controllers/AjaxController.inc new file mode 100644 index 00000000..9ed801df --- /dev/null +++ b/controllers/AjaxController.inc @@ -0,0 +1,52 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the AjaxAgent to return a JSON-string used by AJAX. + * + * @author Oliver Hanraths + */ + class AjaxController extends \hhu\z\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set content-type + $this->response->addHeader("Content-type: application/json; charset=utf-8"); + } + + + /** + * Action: index. + * + * Create the JSON-string. + */ + public function index() + { + } + + } + +?> diff --git a/controllers/BinaryController.inc b/controllers/BinaryController.inc new file mode 100644 index 00000000..0d4396ef --- /dev/null +++ b/controllers/BinaryController.inc @@ -0,0 +1,37 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the BinaryAgent to show binary data. + * + * @author Oliver Hanraths + */ + class BinaryController extends \hhu\z\controllers\IntermediateController + { + + + + + /** + * Action: index. + * + * Create binary data. + */ + public function index() + { + } + + } + +?> diff --git a/controllers/CharactergroupsController.inc b/controllers/CharactergroupsController.inc new file mode 100644 index 00000000..e09e9487 --- /dev/null +++ b/controllers/CharactergroupsController.inc @@ -0,0 +1,759 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the CharactergroupsAgent to display Character groups. + * + * @author Oliver Hanraths + */ + class CharactergroupsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'characters', 'avatars', 'media'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'groupsgroup' => array('admin', 'moderator', 'user'), + 'creategroupsgroup' => array('admin', 'moderator', 'user'), + 'editgroupsgroup' => array('admin', 'moderator', 'user'), + 'deletegroupsgroup' => array('admin', 'moderator', 'user'), + 'group' => array('admin', 'moderator', 'user'), + 'managegroup' => array('admin', 'moderator', 'user'), + 'creategroup' => array('admin', 'moderator', 'user'), + 'editgroup' => array('admin', 'moderator', 'user'), + 'deletegroup' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'groupsgroup' => array('admin', 'moderator', 'user'), + 'creategroupsgroup' => array('admin', 'moderator'), + 'editgroupsgroup' => array('admin', 'moderator'), + 'deletegroupsgroup' => array('admin', 'moderator'), + 'group' => array('admin', 'moderator', 'user'), + 'managegroup' => array('admin', 'moderator'), + 'creategroup' => array('admin', 'moderator'), + 'editgroup' => array('admin', 'moderator', 'user'), + 'deletegroup' => array('admin', 'moderator') + ); + + + + + /** + * Action: index. + * + * Show Character groups-groups for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function index($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-groups + $groupsgroups = $this->Charactergroups->getGroupsroupsForSeminary($seminary['id']); + + + // Set titile + $this->addTitleLocalized('Character Groups'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroups', $groupsgroups); + } + + + /** + * Action: groupsgroups. + * + * Show Character groups for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + */ + public function groupsgroup($seminaryUrl, $groupsgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups + $groups = $this->Charactergroups->getGroupsForGroupsgroup($groupsgroup['id'], 'xps'); + + // Get Character groups-group Quests + $quests = $this->Charactergroupsquests->getQuestsForCharactergroupsgroup($groupsgroup['id']); + + + // Set titile + $this->addTitle($groupsgroup['name']); + $this->addTitleLocalized('Character Groups'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('groups', $groups); + $this->set('quests', $quests); + } + + + /** + * Action: creategroupsgroups. + * + * Create a new Character groups-group for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function creategroupsgroup($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Values + $charactergroupsgroupname = ''; + $preferred = false; + $fields = array('charactergroupsgroupname'); + $validation = array(); + + // Create a new Character groups-group + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $charactergroupsgroupname = $this->request->getPostParam('charactergroupsgroupname'); + if($this->Charactergroups->characterGroupsgroupNameExists($charactergroupsgroupname)) { + $validation = $this->Validation->addValidationResult($validation, 'charactergroupsgroupname', 'exist', true); + } + $preferred = !is_null($this->request->getPostParam('preferred')); + + // Create groups-group + if($validation === true) + { + $groupsgroupId = $this->Charactergroups->createGroupsgroup( + $this->Auth->getUserId(), + $seminary['id'], + $charactergroupsgroupname, + $preferred + ); + + // Redirect to groups-group page + $groupsgroup = $this->Charactergroups->getGroupsgroupById($groupsgroupId); + $this->redirect($this->linker->link(array('groupsgroup', $seminary['url'], $groupsgroup['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('New Character groups-group'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('charactergroupsgroupname', $charactergroupsgroupname); + $this->set('preferred', $preferred); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: editgroupsgroups. + * + * Edit a Character groups-group of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + */ + public function editgroupsgroup($seminaryUrl, $groupsgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Values + $charactergroupsgroupname = $groupsgroup['name']; + $preferred = $groupsgroup['preferred']; + $fields = array('charactergroupsgroupname'); + $validation = array(); + + // Edit Character groups-group + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $charactergroupsgroupname = $this->request->getPostParam('charactergroupsgroupname'); + if($this->Charactergroups->characterGroupsgroupNameExists($charactergroupsgroupname, $groupsgroup['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'charactergroupsgroupname', 'exist', true); + } + $preferred = !is_null($this->request->getPostParam('preferred')); + + // Edit groups-group + if($validation === true) + { + $this->Charactergroups->editGroupsgroup( + $groupsgroup['id'], + $charactergroupsgroupname, + $preferred + ); + + // Redirect to user page + $groupsgroup = $this->Charactergroups->getGroupsgroupById($groupsgroup['id']); + $this->redirect($this->linker->link(array('groupsgroup', $seminary['url'], $groupsgroup['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Edit Character groups-group'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('charactergroupsgroupname', $charactergroupsgroupname); + $this->set('preferred', $preferred); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: deletegroupsgroups. + * + * Delete a Character groups-group of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + */ + public function deletegroupsgroup($seminaryUrl, $groupsgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Charactergroups->deleteGroupsgroup($groupsgroup['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('index', $seminary['url']), 1)); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('groupsgroup', $seminary['url'], $groupsgroup['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete Character groups-group'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + } + + + /** + * Action: group. + * + * Show a Character group for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function group($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + $group['characters'] = $this->Characters->getCharactersForGroup($group['id']); + $group['rank'] = $this->Charactergroups->getXPRank($groupsgroup['id'], $group['xps']); + + // Get Character avatars + foreach($group['characters'] as &$character) + { + $avatar = $this->Avatars->getAvatarById($character['avatar_id']); + if(!is_null($avatar['small_avatarpicture_id'])) { + $character['small_avatar'] = $this->Media->getSeminaryMediaById($avatar['small_avatarpicture_id']); + } + } + + // Get Character groups Quests + $quests = $this->Charactergroupsquests->getQuestsForGroup($group['id']); + + + // Set titile + $this->addTitle($group['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('group', $group); + $this->set('quests', $quests); + } + + + /** + * Action: managegroup. + * + * Manage a Character group for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function managegroup($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + + // Manage + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('actions')) && count($this->request->getPostParam('actions')) > 0) // && !is_null($this->request->getPostParam('characters')) && count($this->request->getPostParam('characters')) > 0) + { + $actions = $this->request->getPostParam('actions'); + $action = array_keys($actions)[0]; + $selectedCharacters = $this->request->getPostParam('characters'); + + switch($action) + { + // Add Characters to group + case 'addcharacters': + foreach($selectedCharacters as &$characterId) { + $this->Charactergroups->addCharacterToCharactergroup($group['id'], $characterId); + } + break; + // Remove Characters from group + case 'removecharacters': + foreach($selectedCharacters as &$characterId) { + $this->Charactergroups->removeCharacterFromCharactergroup($group['id'], $characterId); + } + break; + } + } + + // Get additional data for group + $group['characters'] = $this->Characters->getCharactersForGroup($group['id']); + $group['rank'] = $this->Charactergroups->getXPRank($groupsgroup['id'], $group['xps']); + + // Get Character avatars + foreach($group['characters'] as &$character) + { + $avatar = $this->Avatars->getAvatarById($character['avatar_id']); + if(!is_null($avatar['small_avatarpicture_id'])) { + $character['small_avatar'] = $this->Media->getSeminaryMediaById($avatar['small_avatarpicture_id']); + } + } + + // Get Character groups Quests + $quests = $this->Charactergroupsquests->getQuestsForGroup($group['id']); + + // Get all Characters of Seminary + $groupCharacterIds = array_map(function($c) { return $c['id']; }, $group['characters']); + $seminaryCharacters = $this->Characters->getCharactersForSeminary($seminary['id'], true); + $characters = array(); + foreach($seminaryCharacters as &$character) { + if(!in_array($character['id'], $groupCharacterIds)) { + $characters[] = $character; + } + } + + + // Set titile + $this->addTitle($group['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('group', $group); + $this->set('quests', $quests); + $this->set('characters', $characters); + } + + + /** + * Action: creategroup. + * + * Create a Character group for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + */ + public function creategroup($seminaryUrl, $groupsgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['icons']; + + // Values + $charactergroupname = ''; + $motto = ''; + $fields = array('charactergroupname', 'motto'); + $validation = array(); + + // Create a new Character groups-group + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $charactergroupname = $this->request->getPostParam('charactergroupname'); + if($this->Charactergroups->characterGroupNameExists($charactergroupname)) { + $validation = $this->Validation->addValidationResult($validation, 'charactergroupname', 'exist', true); + } + $motto = $this->request->getPostParam('motto'); + + // Validate icon + $icon = null; + if(!empty($_FILES) && array_key_exists('icon', $_FILES) && $_FILES['icon']['error'] != UPLOAD_ERR_NO_FILE) + { + $icon = $_FILES['icon']; + + // Check error + if($icon['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'error', $icon['error']); + } + + // Check mimetype + $mediaMimetype = null; + $icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $icon['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'mimetype', $icon['mimetype']); + } + elseif($icon['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'size', $mediaMimetype['size']); + } + } + + // Create group + if($validation === true) + { + $groupId = $this->Charactergroups->createGroup( + $this->Auth->getUserId(), + $groupsgroup['id'], + $charactergroupname, + $motto + ); + $group = $this->Charactergroups->getGroupById($groupId); + + // Upload icon + if(!is_null($icon)) + { + $mediaId = $this->Media->createCharactergroupMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('charactergroup-%s', $group['url']), + '', + $icon['mimetype'], + $icon['tmp_name'] + ); + if($mediaId !== false) { + $this->Charactergroups->setMediaForGroup($group['id'], $mediaId); + } + } + + // Redirect to group page + $this->redirect($this->linker->link(array('group', $seminary['url'], $groupsgroup['url'], $group['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('New %s Character group', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('charactergroupname', $charactergroupname); + $this->set('motto', $motto); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: editgroup. + * + * Edit a Character group for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function editgroup($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + $group['characters'] = $this->Characters->getCharactersForGroup($group['id']); + + // Check permission + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) == 0 && !in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['icons']; + + // Values + $charactergroupname = $group['name']; + $motto = $group['motto']; + $fields = array('charactergroupname', 'motto'); + $validation = array(); + + // Edit Character group + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $charactergroupname = (count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) ? $this->request->getPostParam('charactergroupname') : $group['name']; + if($this->Charactergroups->characterGroupNameExists($charactergroupname, $group['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'charactergroupname', 'exist', true); + } + $motto = $this->request->getPostParam('motto'); + + // Validate icon + $icon = null; + if(!empty($_FILES) && array_key_exists('icon', $_FILES) && $_FILES['icon']['error'] != UPLOAD_ERR_NO_FILE) + { + $icon = $_FILES['icon']; + + // Check error + if($icon['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'error', $icon['error']); + } + + // Check mimetype + $mediaMimetype = null; + $icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $icon['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'mimetype', $icon['mimetype']); + } + elseif($icon['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'size', $mediaMimetype['size']); + } + } + + // Edit group + if($validation === true) + { + $this->Charactergroups->editGroup( + $group['id'], + $charactergroupname, + $motto + ); + $group = $this->Charactergroups->getGroupById($group['id']); + + // Upload icon + if(!is_null($icon)) + { + $mediaId = $this->Media->createCharactergroupMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('charactergroup-%s', $group['url']), + '', + $icon['mimetype'], + $icon['tmp_name'] + ); + if($mediaId !== false) { + $this->Charactergroups->setMediaForGroup($group['id'], $mediaId); + } + } + + // Redirect to user page + $this->redirect($this->linker->link(array('group', $seminary['url'], $groupsgroup['url'], $group['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('Edit %s Character group', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('group', $group); + $this->set('charactergroupname', $charactergroupname); + $this->set('motto', $motto); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: deletegroup. + * + * Delete a Character group for a Character groups-group of a + * Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function deletegroup($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Charactergroups->deleteGroup($group['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('groupsgroup', $seminary['url'], $groupsgroup['url']), 1)); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('group', $seminary['url'], $groupsgroup['url'], $group['url']), 1)); + } + + + // Set title + $this->addTitleLocalized('Delete %s Character group', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('group', $group); + } + + } + +?> diff --git a/controllers/CharactergroupsquestsController.inc b/controllers/CharactergroupsquestsController.inc new file mode 100644 index 00000000..f4ba8916 --- /dev/null +++ b/controllers/CharactergroupsquestsController.inc @@ -0,0 +1,625 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the CharactergroupsquestsAgent to display Character + * groups Quests. + * + * @author Oliver Hanraths + */ + class CharactergroupsquestsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'media', 'questgroups', 'uploads'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'quest' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'quest' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: quest. + * + * Show a Character groups Quest for a Character groups-group + * of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $questUrl URL-Title of a Character groups Quest + */ + public function quest($seminaryUrl, $groupsgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups-group Quests + $quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupById($quest['questgroups_id']); + $questgroup['entered'] = $this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], self::$character['id']); + + // Get Character groups-groups + $groups = $this->Charactergroups->getGroupsForQuest($quest['id']); + + // Get uploads + $uploads = $this->Charactergroupsquests->getMediaForQuest($quest['id']); + foreach($uploads as &$upload) { + $upload['upload'] = $this->Uploads->getSeminaryuploadById($upload['seminaryupload_id']); + } + + + // Set title + $this->addTitle($quest['title']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('quest', $quest); + $this->set('questgroup', $questgroup); + $this->set('groups', $groups); + $this->set('uploads', $uploads); + } + + + /** + * Action: manage. + * + * Manage a Character groups Quest for a Character groups-group + * of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $questUrl URL-Title of a Character groups Quest + */ + public function manage($seminaryUrl, $groupsgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups-group Quests + $quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupById($quest['questgroups_id']); + $questgroup['entered'] = $this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], self::$character['id']); + + // Get Character groups + $groups = $this->Charactergroups->getGroupsForGroupsgroup($groupsgroup['id']); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['charactergroupsquests']; + + // Manage + $validation = array(); + if($this->request->getRequestMethod() == 'POST') + { + // Upload media + if(!is_null($this->request->getPostParam('setmedia'))) + { + $file = $_FILES['media']; + + // Check error + if($file['error'] !== 0 || empty($file['tmp_name'])) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'error', $file['error']); + } + + // Check mimetype + $mediaMimetype = null; + $file['mimetype'] = \hhu\z\Utils::getMimetype($file['tmp_name'], $file['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $file['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'mimetype', $file['mimetype']); + } + elseif($file['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'size', $mediaMimetype['size']); + } + + // Upload media + if($validation === true || empty($valiadion)) + { + // Create filename + $filename = sprintf( + '%s-%d-%s.%s', + 'charactergroupsquest', + $quest['id'], + date('Ymd-His'), + mb_substr($file['name'], strrpos($file['name'], '.')+1) + ); + + // Upload file + $this->Charactergroupsquests->uploadMediaForQuest($this->Auth->getUserId(), $seminary['id'], $quest['id'], $file, $filename); + } + } + + // Delete media + if(!is_null($this->request->getPostParam('deletemedia'))) + { + $uploadIds = $this->request->getPostParam('uploads'); + var_dump($uploadIds); + foreach($uploadIds as $uploadId) { + $this->Uploads->deleteSeminaryupload($uploadId); + } + } + + // Set XPs of Character groups for this Character groups Quest + if(!is_null($this->request->getPostParam('setxps'))) + { + $xps = $this->request->getPostParam('xps'); + foreach($groups as &$group) + { + if(array_key_exists($group['url'], $xps) && $xps[$group['url']] != 'null') + { + $xpsFactor = intval($xps[$group['url']]) / $quest['xps']; + $this->Charactergroupsquests->setXPsOfGroupForQuest($quest['id'], $group['id'], $xpsFactor); + } + else { + $this->Charactergroupsquests->deleteGroupForQuest($quest['id'], $group['id']); + } + } + } + + // Redirect to Quest page + if($validation === true || empty($validation)) { + $this->redirect($this->linker->link(array('quest', $seminary['url'], $groupsgroup['url'], $quest['url']), 1)); + } + } + + // Get icon + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Get uploads + $uploads = $this->Charactergroupsquests->getMediaForQuest($quest['id']); + foreach($uploads as &$upload) { + $upload['upload'] = $this->Uploads->getSeminaryuploadById($upload['seminaryupload_id']); + } + + + // Set XPs for Groups + foreach($groups as &$group) { + $group['quest_group'] = $this->Charactergroupsquests->getXPsOfGroupForQuest($quest['id'], $group['id']); + } + + + // Set title + $this->addTitle($quest['title']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('quest', $quest); + $this->set('uploads', $uploads); + $this->set('mimetypes', $mimetypes); + $this->set('questgroup', $questgroup); + $this->set('groups', $groups); + $this->set('media', $questmedia); + $this->set('validation', $validation); + } + + + /** + * Action: create. + * + * Create a new Character groups Quest for a Character + * groups-group of a Seminary. + * + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + */ + public function create($seminaryUrl, $groupsgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Questgroups + $questgroups = $this->Questgroups->getQuestgroupsForSeminary($seminary['id']); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['icons']; + + // Values + $title = ''; + $xps = 0; + $description = ''; + $rules = ''; + $wonText = ''; + $lostText = ''; + $fields = array('title', 'xps'); + $validation = array(); + + // Create a new Character groups Quest + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Charactergroupsquests->characterGroupsQuestTitleExists($title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $xps = $this->request->getPostParam('xps'); + $description = $this->request->getPostParam('description'); + $rules = $this->request->getPostParam('rules'); + $wonText = $this->request->getPostParam('wonText'); + $lostText = $this->request->getPostParam('lostText'); + + // Validate icon + $icon = null; + if(!empty($_FILES) && array_key_exists('icon', $_FILES) && $_FILES['icon']['error'] != UPLOAD_ERR_NO_FILE) + { + $icon = $_FILES['icon']; + + // Check error + if($icon['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'error', $icon['error']); + } + + // Check mimetype + $mediaMimetype = null; + $icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $icon['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'mimetype', $icon['mimetype']); + } + elseif($icon['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'size', $mediaMimetype['size']); + } + } + + // Validate Questgroup + $questgroupIndex = null; + foreach($questgroups as $index => &$questgroup) + { + $questgroup['selected'] = ($questgroup['url'] == $this->request->getPostParam('questgroup')); + if($questgroup['selected']) { + $questgroupIndex = $index; + } + } + if(is_null($questgroupIndex)) { + throw new \nre\exceptions\ParamsNotValidException($questgroup); + } + + // Create groups Quest + if($validation === true) + { + $questId = $this->Charactergroupsquests->createQuest( + $this->Auth->getUserId(), + $groupsgroup['id'], + $questgroups[$questgroupIndex]['id'], + $title, + $description, + $xps, + $rules, + $wonText, + $lostText + ); + $quest = $this->Charactergroupsquests->getQuestById($questId); + + // Upload icon + if(!is_null($icon)) + { + $mediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('charactergroupsquest-%s', $quest['url']), + '', + $icon['mimetype'], + $icon['tmp_name'] + ); + if($mediaId !== false) { + $this->Charactergroupsquests->setMediaForQuest($quest['id'], $mediaId); + } + } + + // Redirect to Quest page + $this->redirect($this->linker->link(array('quest', $seminary['url'], $groupsgroup['url'], $quest['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('New %s-Quest', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('questgroups', $questgroups); + $this->set('title', $title); + $this->set('xps', $xps); + $this->set('description', $description); + $this->set('rules', $rules); + $this->set('wonText', $wonText); + $this->set('lostText', $lostText); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a Character groups Quest of a Character groups-group + * of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $questUrl URL-Title of a Character groups Quest + */ + public function edit($seminaryUrl, $groupsgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups-group Quests + $quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl); + + // Get Questgroups + $questgroups = $this->Questgroups->getQuestgroupsForSeminary($seminary['id']); + foreach($questgroups as $index => &$questgroup) { + $questgroup['selected'] = ($questgroup['id'] == $quest['questgroups_id']); + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['icons']; + + // Values + $title = $quest['title']; + $xps = $quest['xps']; + $description = $quest['description']; + $rules = $quest['rules']; + $wonText = $quest['won_text']; + $lostText = $quest['lost_text']; + $fields = array('title', 'xps'); + $validation = array(); + + // Edit Character group + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Charactergroupsquests->characterGroupsQuestTitleExists($title, $quest['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $xps = $this->request->getPostParam('xps'); + $description = $this->request->getPostParam('description'); + $rules = $this->request->getPostParam('rules'); + $wonText = $this->request->getPostParam('wonText'); + $lostText = $this->request->getPostParam('lostText'); + + // Validate icon + $icon = null; + if(!empty($_FILES) && array_key_exists('icon', $_FILES) && $_FILES['icon']['error'] != UPLOAD_ERR_NO_FILE) + { + $icon = $_FILES['icon']; + + // Check error + if($icon['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'error', $icon['error']); + } + + // Check mimetype + $mediaMimetype = null; + $icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $icon['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'mimetype', $icon['mimetype']); + } + elseif($icon['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'icon', 'size', $mediaMimetype['size']); + } + } + + // Validate Questgroup + $questgroupIndex = null; + foreach($questgroups as $index => &$questgroup) + { + $questgroup['selected'] = ($questgroup['url'] == $this->request->getPostParam('questgroup')); + if($questgroup['selected']) { + $questgroupIndex = $index; + } + } + if(is_null($questgroupIndex)) { + throw new \nre\exceptions\ParamsNotValidException($questgroup); + } + + // Edit groups Quest + if($validation === true) + { + $this->Charactergroupsquests->editQuest( + $quest['id'], + $groupsgroup['id'], + $questgroups[$questgroupIndex]['id'], + $title, + $description, + $xps, + $rules, + $wonText, + $lostText + ); + $quest = $this->Charactergroupsquests->getQuestById($quest['id']); + + // Upload icon + if(!is_null($icon)) + { + $mediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('charactergroupsquest-%s', $quest['url']), + '', + $icon['mimetype'], + $icon['tmp_name'] + ); + if($mediaId !== false) { + $this->Charactergroupsquests->setMediaForQuest($quest['id'], $mediaId); + } + } + + // Redirect to Quest page + $this->redirect($this->linker->link(array('quest', $seminary['url'], $groupsgroup['url'], $quest['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('Edit %s-Quest', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('quest', $quest); + $this->set('questgroups', $questgroups); + $this->set('title', $title); + $this->set('xps', $xps); + $this->set('description', $description); + $this->set('rules', $rules); + $this->set('wonText', $wonText); + $this->set('lostText', $lostText); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: delete. + * + * Delete a Character groups Quest of a Character groups-group + * of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $questUrl URL-Title of a Character groups Quest + */ + public function delete($seminaryUrl, $groupsgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups-group Quests + $quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Charactergroupsquests->deleteQuest($quest['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('charactergroups', 'groupsgroup', $seminary['url'], $groupsgroup['url']))); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('quest', $seminary['url'], $groupsgroup['url'], $quest['url']), 1)); + } + + + // Set title + $this->addTitleLocalized('Delete %s-Quest', $groupsgroup['name']); + $this->addTitle($groupsgroup['name']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('groupsgroup', $groupsgroup); + $this->set('quest', $quest); + } + + } + +?> diff --git a/controllers/CharactersController.inc b/controllers/CharactersController.inc new file mode 100644 index 00000000..96eaedb3 --- /dev/null +++ b/controllers/CharactersController.inc @@ -0,0 +1,695 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to list registered users and their data. + * + * @author Oliver Hanraths + */ + class CharactersController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'characters', 'users', 'charactergroups', 'charactertypes', 'seminarycharacterfields', 'avatars', 'media', 'quests', 'questgroups', 'questtopics', 'xplevels'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'character' => array('admin', 'moderator', 'user'), + 'register' => array('admin', 'moderator', 'user'), + 'manage' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator'), + 'character' => array('admin', 'moderator', 'user'), + 'manage' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator') + ); + + + + + /** + * Action: index. + * + * List registered Characters for a Seminary + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $all Whether to list all Characters at once or not (optional) + */ + public function index($seminaryUrl, $all=null) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Seminarycharacterfields + $characterfields = $this->Seminarycharacterfields->getFieldsForSeminary($seminary['id']); + + // Set sort order and page + $sortorder = 'name'; + $charactername = null; + $page = 1; + if($this->request->getRequestMethod() == 'GET') + { + $sortorder = $this->request->getGetParam('sortorder'); + $sortorder = !empty($sortorder) ? $sortorder : 'name'; + $charactername = (!is_null($this->request->getGetParam('charactername'))) ? $this->request->getGetParam('charactername') : $charactername; + $page = $this->request->getGetParam('page'); + $page = !empty($page) ? intval($page) : 1; + } + + // Get registered Characters + $limit = ($all != 'all') ? \nre\configs\AppConfig::$misc['lists_limit'] : null; + $offset = ($all != 'all') ? max((intval($page) - 1), 0) * $limit : 0; + $charactersCount = $this->Characters->getCharactersForSeminaryCount($seminary['id'], $charactername); + $characters = $this->Characters->getCharactersForSeminarySorted($seminary['id'], $sortorder, $charactername, $limit, $offset); + foreach($characters as &$character) + { + $character['user'] = $this->Users->getUserById($character['user_id']); + $character['characterroles'] = array_map(function($r) { return $r['name']; }, $this->Characterroles->getCharacterrolesForCharacterById($character['id'])); + $character['characterfields'] = array(); + foreach($this->Seminarycharacterfields->getFieldsForCharacter($character['id']) as $value) { + $character['characterfields'][$value['url']] = $value; + } + try { + $character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No XP-level + } + try { + $character['avatar'] = $this->Avatars->getAvatarByTypeAndLevel($seminary['id'], $character['charactertype_url'], $character['xplevel']['level']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No Avatar available + } + } + + + // Set titile + $this->addTitleLocalized('Characters'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('characters', $characters); + $this->set('charactersCount', $charactersCount); + $this->set('characterfields', $characterfields); + $this->set('sortorder', $sortorder); + $this->set('charactername', $charactername); + $this->set('all', $all); + $this->set('page', $page); + $this->set('limit', $limit); + } + + + /** + * Action: character. + * + * Show a Charater and its details. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $characterUrl URL-name of a Charater + */ + public function character($seminaryUrl, $characterUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + $seminary['achievable_xps'] = $this->Seminaries->getTotalXPs($seminary['id']); + + // Get Character + $character = $this->Characters->getCharacterByUrl($seminary['id'], $characterUrl); + try { + $character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No XP-level + } + $character['rank'] = $this->Characters->getXPRank($seminary['id'], $character['xps']); + + // Get User + $user = $this->Users->getUserById($character['user_id']); + + // Get Character groups + $groups = $this->Charactergroups->getGroupsForCharacter($character['id']); + foreach($groups as &$group) { + $group['groupsgroup'] = $this->Charactergroups->getGroupsgroupById($group['charactergroupsgroup_id']); + } + + // Get Achievements + $achievements = $this->Achievements->getAchievedAchievementsForCharacter($character['id']); + + // Get Achievements with deadline (milestones) + $milestones = $this->Achievements->getDeadlineAchievements($seminary['id']); + foreach($milestones as &$milestone) { + $milestone['achieved'] = $this->Achievements->hasCharacterAchievedAchievement($milestone['id'], $character['id']); + } + + // Get ranking + $ranking = array( + 'superior' => $this->Characters->getSuperiorCharacters($seminary['id'], $character['xps'], \nre\configs\AppConfig::$misc['ranking_range']), + 'inferior' => $this->Characters->getInferiorCharacters($seminary['id'], $character['id'], $character['xps'], \nre\configs\AppConfig::$misc['ranking_range']) + ); + + // Get Quest topics + $questtopics = $this->Questtopics->getQuesttopicsForSeminary($seminary['id']); + foreach($questtopics as &$questtopic) + { + $questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']); + $questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']); + } + + // Get “last” Quest + $lastQuest = null; + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) + { + $lastQuest = $this->Quests->getLastQuestForCharacter($character['id']); + if(!is_null($lastQuest)) { + $lastQuest['questgroup'] = $this->Questgroups->getQuestgroupById($lastQuest['questgroup_id']); + } + } + + + // Set titile + $this->addTitle($character['name']); + $this->addTitleLocalized('Characters'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('character', $character); + $this->set('user', $user); + $this->set('groups', $groups); + $this->set('achievements', $achievements); + $this->set('milestones', $milestones); + $this->set('ranking', $ranking); + $this->set('questtopics', $questtopics); + $this->set('lastQuest', $lastQuest); + } + + + /** + * Acton: register. + * + * Register a new character for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\ParamsNotValidException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function register($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check for already existing Character + try { + $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + throw new \nre\exceptions\AccessDeniedException(); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // This should be the case + } + + + // Character types + $types = $this->Charactertypes->getCharacterTypesForSeminary($seminary['id']); + + // Character fields + $fields = $this->Seminarycharacterfields->getFieldsForSeminary($seminary['id']); + + // Register Character + $charactername = ''; + $validation = true; + $fieldsValidation = true; + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Validate Character properties + $validation = $this->Validation->validateParams($this->request->getPostParams(), array('charactername')); + $charactername = $this->request->getPostParam('charactername'); + if($this->Characters->characterNameExists($charactername)) { + $validation = $this->Validation->addValidationResult($validation, 'charactername', 'exist', true); + } + + // Validate type + $typeIndex = null; + foreach($types as $index => &$type) + { + $type['selected'] = ($type['url'] == $this->request->getPostParam('type')); + if($type['selected']) { + $typeIndex = $index; + } + } + if(is_null($typeIndex)) { + $validation = $this->Validation->addValidationResult($validation, 'type', 'exist', false); + } + + // Validate fields + $fieldsValues = $this->request->getPostParam('fields'); + foreach($fields as &$field) + { + if(!array_key_exists($field['url'], $fieldsValues)) { + throw new \nre\exceptions\ParamsNotValidException($index); + } + $field['uservalue'] = $fieldsValues[$field['url']]; + if($field['required']) + { + $fieldValidation = $this->Validation->validate($fieldsValues[$field['url']], array('regex'=>$field['regex'])); + if($fieldValidation !== true) + { + if(!is_array($fieldsValidation)) { + $fieldsValidation = array(); + } + $fieldsValidation[$field['url']] = $fieldValidation; + } + } + } + + // Register + if($validation === true && $fieldsValidation === true) + { + $characterId = $this->Characters->createCharacter($this->Auth->getUserId(), $types[$typeIndex]['id'], $charactername); + $character = $this->Characters->getCharacterById($characterId); + + // Add Seminary fields + foreach($fields as &$field) { + if(!empty($fieldsValues[$field['url']])) { + $this->Seminarycharacterfields->setSeminaryFieldOfCharacter($field['id'], $characterId, $fieldsValues[$field['url']]); + } + } + + // Set roles for owners and admins + if(in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles']) || $seminary['created_user_id'] == \hhu\z\controllers\IntermediateController::$user['id']) { + $this->Characterroles->addCharacterroleToCharacter($characterId, 'admin'); + } + + // Send mail + $this->sendRegistrationMail($character); + + // Redirect + $this->redirect($this->linker->link(array('seminaries'))); + } + } + + // Get XP-levels + $xplevels = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + + // Get Avatars + if(count($xplevels) > 0) + { + foreach($types as &$type) + { + try { + $type['avatar'] = $this->Avatars->getAvatarByTypeAndLevel($seminary['id'], $type['url'], $xplevels[0]['level']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No Avatar available + } + } + } + + + // Set titile + $this->addTitleLocalized('Create Character'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('types', $types); + $this->set('fields', $fields); + $this->set('charactername', $charactername); + $this->set('validation', $validation); + $this->set('fieldsValidation', $fieldsValidation); + $this->set('xplevels', $xplevels); + } + + + /** + * Action: manage. + * + * Manage Characters. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function manage($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Set sort order and page + + $selectedCharacters = array(); + $sortorder = 'name'; + if($this->request->getRequestMethod() == 'POST') + { + // Set sortorder + $sortorder = $this->request->getPostParam('sortorder'); + $sortorder = !empty($sortorder) ? $sortorder : 'name'; + + // Do action + $selectedCharacters = $this->request->getPostParam('characters'); + if(!is_array($selectedCharacters)) { + $selectedCharacters = array(); + } + if(!is_null($this->request->getPostParam('actions')) && count($this->request->getPostParam('actions')) > 0 && !is_null($this->request->getPostParam('characters')) && count($this->request->getPostParam('characters')) > 0) + { + $actions = $this->request->getPostParam('actions'); + $action = array_keys($actions)[0]; + + switch($action) + { + // Add/remove role to/from Characters + case 'addrole': + case 'removerole': + // Determine role and check permissions + $role = null; + switch($actions[$action]) + { + case _('Admin'): + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'admin'; + break; + case _('Moderator'): + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'moderator'; + break; + case _('User'): + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) <= 0) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'user'; + break; + } + + // Add role + if($action == 'addrole') { + foreach($selectedCharacters as &$characterId) { + $this->Characterroles->addCharacterroleToCharacter($characterId, $role); + } + } + // Remove role + else { + foreach($selectedCharacters as &$characterId) { + $this->Characterroles->removeCharacterroleFromCharacter($characterId, $role); + } + } + break; + } + } + } + + // Get Seminarycharacterfields + $characterfields = $this->Seminarycharacterfields->getFieldsForSeminary($seminary['id']); + + // Get registered Characters + $characters = $this->Characters->getCharactersForSeminarySorted($seminary['id'], $sortorder); + foreach($characters as &$character) + { + $character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']); + $character['user'] = $this->Users->getUserById($character['user_id']); + $character['characterroles'] = array_map(function($r) { return $r['name']; }, $this->Characterroles->getCharacterrolesForCharacterById($character['id'])); + $character['characterfields'] = array(); + foreach($this->Seminarycharacterfields->getFieldsForCharacter($character['id']) as $value) { + $character['characterfields'][$value['url']] = $value; + } + } + + + // Set titile + $this->addTitleLocalized('Manage Characters'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('characters', $characters); + $this->set('characterfields', $characterfields); + $this->set('selectedCharacters', $selectedCharacters); + $this->set('sortorder', $sortorder); + } + + + /** + * Acton: edit. + * + * Edit a new character for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\ParamsNotValidException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $characterUrl URL-name of a Charater + */ + public function edit($seminaryUrl, $characterUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = $this->Characters->getCharacterByUrl($seminary['id'], $characterUrl); + + // Check permissions + if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) == 0 && $character['id'] != \hhu\z\controllers\SeminaryController::$character['id']) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get User + $user = $this->Users->getUserById($character['user_id']); + + // Character types + $types = $this->Charactertypes->getCharacterTypesForSeminary($seminary['id']); + foreach($types as &$type) { + $type['selected'] = ($type['url'] == $character['charactertype_url']); + } + + // Character fields + $fields = $this->Seminarycharacterfields->getFieldsForSeminary($seminary['id']); + foreach($fields as &$field) + { + $userValue = $this->Seminarycharacterfields->getSeminaryFieldOfCharacter($field['id'], $character['id']); + if(!empty($userValue)) { + $field['uservalue'] = $userValue['value']; + } + } + + // Values + $charactername = $character['name']; + $validation = array(); + $fieldsValidation = true; + + // Edit Character + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Validate Character properties + $validation = $this->Validation->validateParams($this->request->getPostParams(), array('charactername')); + $charactername = (count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) ? $this->request->getPostParam('charactername') : $character['name']; + if($this->Characters->characterNameExists($charactername, $character['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'charactername', 'exist', true); + } + + // Validate type + $typeIndex = null; + foreach($types as $index => &$type) + { + $type['selected'] = (count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) ? ($type['url'] == $this->request->getPostParam('type')) : ($type['url'] == $character['charactertype_url']); + if($type['selected']) { + $typeIndex = $index; + } + } + if(is_null($typeIndex)) { + $validation = $this->Validation->addValidationResult($validation, 'type', 'exist', false); + } + + // Validate fields + $fieldsValues = $this->request->getPostParam('fields'); + foreach($fields as &$field) + { + if(!array_key_exists($field['url'], $fieldsValues)) { + throw new \nre\exceptions\ParamsNotValidException($index); + } + $field['uservalue'] = $fieldsValues[$field['url']]; + if($field['required']) + { + $fieldValidation = $this->Validation->validate($fieldsValues[$field['url']], array('regex'=>$field['regex'])); + if($fieldValidation !== true) + { + if(!is_array($fieldsValidation)) { + $fieldsValidation = array(); + } + $fieldsValidation[$field['url']] = $fieldValidation; + } + } + } + + // Edit + if($validation === true && $fieldsValidation === true) + { + $this->Characters->editCharacter( + $character['id'], + $types[$typeIndex]['id'], + $charactername + ); + + // Set Seminary fields + foreach($fields as &$field) { + if(!empty($fieldsValues[$field['url']])) { + $this->Seminarycharacterfields->setSeminaryFieldOfCharacter($field['id'], $character['id'], $fieldsValues[$field['url']]); + } + } + + // Redirect + $character = $this->Characters->getCharacterById($character['id']); + $this->redirect($this->linker->link(array('character', $seminary['url'], $character['url']), 1)); + } + } + + // Get XP-levels + $xplevels = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + + // Get validation settings + $validationSettings = array(); + $validationSettings['charactername'] = \nre\configs\AppConfig::$validation['charactername']; + + + // Set titile + $this->addTitleLocalized('Edit Character'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('types', $types); + $this->set('fields', $fields); + $this->set('charactername', $charactername); + $this->set('validation', $validation); + $this->set('fieldsValidation', $fieldsValidation); + $this->set('validationSettings', $validationSettings); + $this->set('xplevels', $xplevels); + } + + + /** + * Action: delete. + * + * Delete a Character. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $characterUrl URL-name of a Charater + */ + public function delete($seminaryUrl, $characterUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = $this->Characters->getCharacterByUrl($seminary['id'], $characterUrl); + + // Get User + $user = $this->Users->getUserById($character['user_id']); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete Character + $this->Characters->deleteCharacter($character['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('index', $seminary['url']), 1)); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('index', $seminary['url'], $character['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete Character'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('character', $character); + $this->set('user', $user); + } + + + + + /** + * Send mail for new Character registration. + * + * @param arary $newCharacter Newly registered Character + */ + private function sendRegistrationMail($newCharacter) + { + // Get Seminary moderators + $characters = $this->Characters->getCharactersWithCharacterRole(self::$seminary['id'], 'moderator'); + + // Send notification mail + try { + foreach($characters as &$character) + { + $moderator = $this->Users->getUserById($character['user_id']); + if($moderator['mailing']) { + \hhu\z\Utils::sendMail( + $moderator['email'], + 'characterregistration', + true, + array( + $moderator, + \hhu\z\controllers\SeminaryController::$seminary, + \hhu\z\controllers\IntermediateController::$user, + $newCharacter + ), + $this->linker + ); + } + } + } + catch(\hhu\z\exceptions\MailingException $e) { + $this->log($e->getMessage()); + } + } + + } + +?> diff --git a/controllers/CharactertypesController.inc b/controllers/CharactertypesController.inc new file mode 100644 index 00000000..60b3dbf3 --- /dev/null +++ b/controllers/CharactertypesController.inc @@ -0,0 +1,406 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the CharactertypesAgent to handle Charactertyes of a + * Seminary. + * + * @author Oliver Hanraths + */ + class CharactertypesController extends \hhu\z\controllers\SeminaryController + { + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * Required models + * + * @var array + */ + public $models = array('charactertypes', 'xplevels', 'avatars', 'media'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: index. + * + * List Character types. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function index($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check permissions + if( + (is_null(self::$character) && count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0) && + $seminary['created_user_id'] != self::$user['id'] + ) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get Character types + $charactertypes = $this->Charactertypes->getCharacterTypesForSeminary($seminary['id']); + + // Get Avatars + $xplevels = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + if(count($xplevels) > 0) + { + foreach($charactertypes as &$type) + { + try { + $type['avatar'] = $this->Avatars->getAvatarByTypeAndLevel($seminary['id'], $type['url'], $xplevels[0]['level']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No Avatar available + } + } + } + + + // Set titile + $this->addTitleLocalized('Charactertypes'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('xplevels', $xplevels); + $this->set('charactertypes', $charactertypes); + } + + + /** + * Action: create. + * + * Create new Character type for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function create($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check permissions + if( + $seminary['created_user_id'] != self::$user['id'] && + (is_null(self::$character) && count(array_intersect(array('admin'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0) + ) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Values + $name = ''; + $fields = array('charactertypename'); + $validation = array(); + + // Create new Charactertype + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $name = $this->request->getPostParam('charactertypename'); + if($this->Charactertypes->charactertypeNameExists($seminary['id'], $name)) { + $validation = $this->Validation->addValidationResult($validation, 'charactertypename', 'exist', true); + } + + // Create new Charactertype + if($validation === true) + { + $charactertypeId = $this->Charactertypes->createCharactertype( + $this->Auth->getUserId(), + $seminary['id'], + $name + ); + $charactertype = $this->Charactertypes->getCharactertypeById($charactertypeId); + + // Redirect to editing + $this->redirect($this->linker->link(array('edit', $seminary['url'], $charactertype['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Create new Charactertype'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('name', $name); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit Character type for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of a Seminary + * @param string $charactertypeUrl URL-title of Character type + */ + public function edit($seminaryUrl, $charactertypeUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check permissions + if( + $seminary['created_user_id'] != self::$user['id'] && + (is_null(self::$character) && count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0) + ) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get Character type + $charactertype = $this->Charactertypes->getCharactertypeByUrl($seminary['id'], $charactertypeUrl); + + // XP-levels + $xplevels = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + foreach($xplevels as &$xplevel) + { + try { + $xplevel['avatar'] = $this->Avatars->getAvatarByTypeAndLevel($seminary['id'], $charactertype['url'], $xplevel['level']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + // No Avatar available + } + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $name = $charactertype['name']; + $fields = array('charactertypename'); + $validation = array(); + $avatarVariants = array('portrait', 'avatar'); + $avatarsValidation = true; + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $name = $this->request->getPostParam('charactertypename'); + if($this->Charactertypes->charactertypeNameExists($seminary['id'], $name, $charactertype['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'charactertypename', 'exist', true); + } + + // Validate and upload avatars + if(array_key_exists('avatars', $_FILES)) + { + foreach($xplevels as &$xplevel) + { + if(array_key_exists($xplevel['id'], $_FILES['avatars']['error'])) + { + foreach($avatarVariants as &$variant) + { + if(array_key_exists($variant, $_FILES['avatars']['error'][$xplevel['id']]) && $_FILES['avatars']['error'][$xplevel['id']][$variant] !== UPLOAD_ERR_NO_FILE) + { + $avatar = array( + 'name' => $_FILES['avatars']['name'][$xplevel['id']][$variant], + 'type' => $_FILES['avatars']['type'][$xplevel['id']][$variant], + 'tmp_name' => $_FILES['avatars']['tmp_name'][$xplevel['id']][$variant], + 'error' => $_FILES['avatars']['error'][$xplevel['id']][$variant], + 'size' => $_FILES['avatars']['size'][$xplevel['id']][$variant] + ); + $avatarValidation = true; + + // Check error + if($avatar['error'] !== UPLOAD_ERR_OK) { + $avatarValidation = $this->Validation->addValidationResult($avatarValidation, 'avatar', 'error', $avatar['error']); + } + + // Check mimetype + $avatarMimetype = null; + $avatar['mimetype'] = \hhu\z\Utils::getMimetype($avatar['tmp_name'], $avatar['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $avatar['mimetype']) { + $avatarMimetype = $mimetype; + break; + } + } + if(is_null($avatarMimetype)) { + $avatarValidation = $this->Validation->addValidationResult($avatarValidation, 'avatar', 'mimetype', $avatar['mimetype']); + } + elseif($avatar['size'] > $avatarMimetype['size']) { + $avatarValidation = $this->Validation->addValidationResult($avatarValidation, 'avatar', 'size', $avatarMimetype['size']); + } + + // Add validation result + if(!$avatarValidation !== true) + { + if(!is_array($avatarsValidation)) { + $avatarsValidation = array(); + } + if(!array_key_exists($xplevel['id'], $avatarsValidation)) { + $avatarsValidation[$xplevel['id']] = array(); + } + $avatarsValidation[$xplevel['id']][$variant] = $avatarValidation; + } + + // Upload avatar + if($avatarValidation === true) + { + $avatar['media_id'] = $this->Media->createAvatarPicture( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('avatar-%d-%d-%s', $charactertype['id'], $xplevel['id'], $variant), + '', + $avatar['mimetype'], + $avatar['tmp_name'] + ); + + // Set avatar + if($variant == 'portrait') { + $this->Avatars->setAvatarPortraitForTypeAndLevel( + $this->Auth->getUserId(), + $charactertype['id'], + $xplevel['id'], + $avatar['media_id'] + ); + } + else { + $this->Avatars->setAvatarForTypeAndLevel( + $this->Auth->getUserId(), + $charactertype['id'], + $xplevel['id'], + $avatar['media_id'] + ); + } + } + } + } + } + } + } + + // Edit Charactertype + if($validation === true && $avatarsValidation === true) + { + $this->Charactertypes->editCharactertype( + $charactertype['id'], + $name + ); + $charactertype = $this->Charactertypes->getCharactertypeById($charactertype['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('index', $seminary['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Edit Charactertype'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('charactertype', $charactertype); + $this->set('xplevels', $xplevels); + $this->set('name', $name); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('avatarsValidation', $avatarsValidation); + $this->set('avatarVariants', $avatarVariants); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: delete. + * + * Delete Character type for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of a Seminary + * @param string $charactertypeUrl URL-title of Character type + */ + public function delete($seminaryUrl, $charactertypeUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check permissions + if( + $seminary['created_user_id'] != self::$user['id'] && + (is_null(self::$character) && count(array_intersect(array('admin'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0) + ) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get Character type + $charactertype = $this->Charactertypes->getCharactertypeByUrl($seminary['id'], $charactertypeUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete Character type + $this->Charactertypes->deleteCharactertype($charactertype['id']); + } + + // Redirect to overview + $this->redirect($this->linker->link(array('index', $seminary['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete Charactertype'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('charactertype', $charactertype); + } + + } + +?> diff --git a/controllers/ErrorController.inc b/controllers/ErrorController.inc new file mode 100644 index 00000000..a27e3afd --- /dev/null +++ b/controllers/ErrorController.inc @@ -0,0 +1,51 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to show an error page. + * + * @author Oliver Hanraths + */ + class ErrorController extends \hhu\z\Controller + { + + + + + + + /** + * Action: index. + * + * Set HTTP-header and print an error message. + * + * @param int $httpStatusCode HTTP-statuscode of the error that occurred + */ + public function index($httpStatusCode) + { + // Set HTTP-header + if(!array_key_exists($httpStatusCode, \nre\core\WebUtils::$httpStrings)) { + $httpStatusCode = 200; + } + $this->response->addHeader(\nre\core\WebUtils::getHttpHeader($httpStatusCode)); + + // Display statuscode and message + $this->set('code', $httpStatusCode); + $this->set('string', \nre\core\WebUtils::$httpStrings[$httpStatusCode]); + $this->set('userId', $this->Auth->getUserId()); + } + + } + +?> diff --git a/controllers/FaultController.inc b/controllers/FaultController.inc new file mode 100644 index 00000000..be01fea7 --- /dev/null +++ b/controllers/FaultController.inc @@ -0,0 +1,37 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to display a toplevel error page. + * + * @author Oliver Hanraths + */ + class FaultController extends \nre\core\Controller + { + + + + + /** + * Action: index. + * + * Show the error message. + */ + public function index() + { + } + + } + +?> diff --git a/controllers/HtmlController.inc b/controllers/HtmlController.inc new file mode 100644 index 00000000..8c451441 --- /dev/null +++ b/controllers/HtmlController.inc @@ -0,0 +1,114 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the HtmlAgent to display a HTML-page. + * + * @author Oliver Hanraths + */ + class HtmlController extends \hhu\z\Controller + { + /** + * Required components + * + * @var array + */ + public $components = array('notification'); + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set content-type + $this->response->addHeader("Content-type: text/html; charset=utf-8"); + } + + + /** + * Postfilter that is executed after running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function postFilter(\nre\core\Request $request, \nre\core\Response $response) + { + // Get title + $this->set('title', $this->getTitle()); + } + + + /** + * Action: index. + * + * Create the HTML-structure. + */ + public function index() + { + // Set the name of the current IntermediateAgent as page title + $this->set('title', $this->request->getParam(1, 'intermediate')); + + // Set userdata + $this->set('loggedUser', IntermediateController::$user); + $this->set('loggedSeminary', SeminaryController::$seminary); + $this->set('loggedCharacter', SeminaryController::$character); + + // Set notifications + $this->set('notifications', $this->Notification->getNotifications()); + + // Set some application data + $this->set('mailcontact', \nre\configs\AppConfig::$app['mailcontact']); + } + + + + + /** + * Get title information from IntermediateController if possible + * and create a title. + * + * @return string Title for the current page + */ + private function getTitle() + { + $title = array(); + + // Get title of IntermediateController + $intermediateController = $this->agent->getIntermediateAgent()->controller; + if($intermediateController instanceof \hhu\z\controllers\IntermediateController) { + $title = $intermediateController->getTitle(); + } + if(!is_array($title)) { + $title = array($title); + } + + // Add application name + $title[] = \nre\configs\AppConfig::$app['name']; + + + // Return title with delimiter + return implode(\nre\configs\AppConfig::$misc['title_delimiter'], $title); + } + + } + +?> diff --git a/controllers/HtmlmailController.inc b/controllers/HtmlmailController.inc new file mode 100644 index 00000000..19640615 --- /dev/null +++ b/controllers/HtmlmailController.inc @@ -0,0 +1,54 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the HtmlmailAgent for generating a HTML-mail message. + * + * @author Oliver Hanraths + */ + class HtmlmailController extends \nre\core\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + + // Set linker + $this->set('linker', ($request instanceof \hhu\z\requests\MailRequest && !is_null($request->getLinker())) ? $request->getLinker() : null); + } + + + /** + * Action: index. + * + * Create HTML-structure of mail message. + */ + public function index() + { + $this->set('appname', \nre\configs\AppConfig::$app['name']); + } + + } + +?> diff --git a/controllers/IntroductionController.inc b/controllers/IntroductionController.inc new file mode 100644 index 00000000..c1a07f41 --- /dev/null +++ b/controllers/IntroductionController.inc @@ -0,0 +1,37 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to show an introduction page. + * + * @author Oliver Hanraths + */ + class IntroductionController extends \hhu\z\controllers\IntermediateController + { + + + + + /** + * Action: index. + */ + public function index() + { + // Pass data to view + $this->set('userId', $this->Auth->getUserId()); + } + + } + +?> diff --git a/controllers/LibraryController.inc b/controllers/LibraryController.inc new file mode 100644 index 00000000..0adfcdd8 --- /dev/null +++ b/controllers/LibraryController.inc @@ -0,0 +1,513 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the LibraryAgent to list Quest topics. + * + * @author Oliver Hanraths + */ + class LibraryController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('questtopics', 'seminaries', 'quests', 'questgroups'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'topic' => array('admin', 'moderator', 'user'), + 'manage' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator', 'user', 'guest'), + 'topic' => array('admin', 'moderator', 'user', 'guest'), + 'manage' => array('admin', 'moderator'), + 'create' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator'), + 'delete' => array('admin', 'moderator') + ); + + + + + /** + * Action: index. + * + * List Questtopics of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + */ + public function index($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = SeminaryController::$character; + + // Get Quest topics + $totalQuestcount = 0; + $totalCharacterQuestcount = 0; + $questtopics = $this->Questtopics->getQuesttopicsForSeminary($seminary['id']); + foreach($questtopics as &$questtopic) + { + // Get Quest count + $questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']); + $totalQuestcount += $questtopic['questcount']; + + // Get Character progress + $questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']); + $totalCharacterQuestcount += $questtopic['characterQuestcount']; + } + + + // Set title + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('totalQuestcount', $totalQuestcount); + $this->set('totalCharacterQuestcount', $totalCharacterQuestcount); + $this->set('questtopics', $questtopics); + } + + + /** + * Action: topic. + * + * Show a Questtopic and its Quests with Questsubtopics. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $eminaryUrl URL-Title of Seminary + * @param string $questtopicUrl URL-Title of Questtopic + */ + public function topic($seminaryUrl, $questtopicUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = SeminaryController::$character; + + // Get Questtopic + $questtopic = $this->Questtopics->getQuesttopicByUrl($seminary['id'], $questtopicUrl); + $questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']); + $questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']); + + // Get Quests + $quests = array(); + foreach($this->Quests->getQuestsForQuesttopic($questtopic['id']) as $quest) + { + if($this->Quests->hasCharacterEnteredQuest($quest['id'], $character['id']) || count(array_intersect(array('admin', 'moderator'), self::$character['characterroles'])) > 0) + { + // Get Subtopics + $quest['subtopics'] = $this->Questtopics->getQuestsubtopicsForQuest($quest['id']); + + $quests[] = $quest; + } + } + + + // Set title + $this->addTitle($questtopic['title']); + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questtopic', $questtopic); + $this->set('quests', $quests); + } + + + /** + * Action: manage. + * + * Manage a Questtopic and its Quests with Questsubtopics. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $eminaryUrl URL-Title of Seminary + * @param string $questtopicUrl URL-Title of Questtopic + */ + public function manage($seminaryUrl, $questtopicUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questtopic + $questtopic = $this->Questtopics->getQuesttopicByUrl($seminary['id'], $questtopicUrl); + + // Get Questsubtopics + $questsubtopics = $this->Questtopics->getSubtopicsForQuesttopic($questtopic['id']); + + // Set Questsubtopics for Quests + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('questsubtopics'))) + { + $selectedSubtopics = $this->request->getPostParam('questsubtopics'); + + // Set subtopics of Quests + $quests = $this->Quests->getQuestsForQuesttopic($questtopic['id']); + foreach($quests as &$quest) + { + $subtopics = (array_key_exists($quest['id'], $selectedSubtopics)) ? $selectedSubtopics[$quest['id']] : array(); + $this->Questtopics->setQuestsubtopicsForQuest($quest['id'], array_keys($subtopics)); + } + + // Add Quest + $addQuestId = $this->request->getPostParam('addquest'); + if(!empty($addQuestId)) + { + $subtopics = (array_key_exists('addquest', $selectedSubtopics)) ? $selectedSubtopics['addquest'] : array(); + if(!empty($subtopics)) { + $this->Questtopics->setQuestsubtopicsForQuest($addQuestId, array_keys($subtopics)); + } + } + + // Redirect + $this->redirect($this->linker->link(array('topic', $seminary['url'], $questtopic['url']), 1)); + } + + // Get Quests + $quests = $this->Quests->getQuestsForQuesttopic($questtopic['id']); + foreach($quests as &$quest) + { + // Get Subtopics + $quest['subtopics'] = $this->Questtopics->getQuestsubtopicsForQuest($quest['id']); + $quest['subtopics'] = array_map(function($t) { return $t['id']; }, $quest['subtopics']); + } + + // Get all Quests + $allQuests = $this->Quests->getQuestsForSeminary($seminary['id']); + + + // Set title + $this->addTitle($questtopic['title']); + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questtopic', $questtopic); + $this->set('questsubtopics', $questsubtopics); + $this->set('quests', $quests); + $this->set('allQuests', $allQuests); + } + + + /** + * Action: create. + * + * Create a new Questtopic for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + */ + public function create($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Values + $title = ''; + $fields = array('title'); + $validation = array(); + + // Create new Questtopic + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Questtopics->questtopicTitleExists($title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + + // Create + if($validation === true) + { + $questtopicId = $this->Questtopics->createQuesttopic( + $this->Auth->getUserId(), + $seminary['id'], + $title + ); + $questtopic = $this->Questtopics->getQuesttopicById($questtopicId); + + // Redirect to Questtopic + $this->redirect($this->linker->link(array('topic', $seminary['url'], $questtopic['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set title + $this->addTitleLocalized('New Questtopic'); + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('title', $title); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a Questtopic of a Seminary and its Questsubtopics. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $eminaryUrl URL-Title of Seminary + * @param string $questtopicUrl URL-Title of Questtopic + */ + public function edit($seminaryUrl, $questtopicUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questtopic + $questtopic = $this->Questtopics->getQuesttopicByUrl($seminary['id'], $questtopicUrl); + + // Get Questsubtopics + $questsubtopics = $this->Questtopics->getSubtopicsForQuesttopic($questtopic['id']); + + // Values + $questtopicTitle = $questtopic['title']; + $subtopicsTitles = array(); + foreach($questsubtopics as &$questsubtopic) { + $subtopicsTitles[$questsubtopic['id']] = $questsubtopic['title']; + } + $deleteSubtopics = null; + $subtopicTitle = ''; + $validations = array( + 'edit' => true, + 'edit-subtopics' => true, + 'create-subtopic' => true + ); + + // Edit + $action = null; + if($this->request->getRequestMethod() == 'POST') + { + // Edit Questtopic + if(!is_null($this->request->getPostParam('edit'))) + { + $action = 'edit'; + + // Get params and validate them + $validations[$action] = $this->Validation->validateParams($this->request->getPostParams(), array('title')); + $questtopicTitle = $this->request->getPostParam('title'); + if($this->Questtopics->questsubtopicTitleExists($questtopicTitle, $questtopic['id'])) { + $validations[$action] = $this->Validation->addValidationResult($validations[$action], 'title', 'exist', true); + } + + // Edit + if($validations[$action] === true) + { + $this->Questtopics->editQuesttopic( + $questtopic['id'], + $questtopicTitle + ); + $questtopic = $this->Questtopics->getQuesttopicById($questtopic['id']); + + // Redirect + $this->redirect($this->linker->link(array('topic', $seminary['url'], $questtopic['url']), 1)); + } + } + + // Edit and delete Questsubtopics + elseif(!is_null($this->request->getPostParam('edit-subtopics'))) + { + $action = 'edit-subtopics'; + + // Get params and validate them + $subtopicsTitles = $this->request->getPostParam('subtopics'); + $deleteSubtopics = $this->request->getPostParam('delete-subtopics'); + foreach($questsubtopics as &$questsubtopic) + { + if(!is_null($deleteSubtopics) && array_key_exists($questsubtopic['id'], $deleteSubtopics)) { + continue; + } + + $title = $subtopicsTitles[$questsubtopic['id']]; + $subtopicValidation = $this->Validation->validate($title, \nre\configs\AppConfig::$validation['title']); + if($subtopicValidation !== true) + { + if(!is_array($validations['edit-subtopics'])) { + $validations['edit-subtopics'] = array(); + } + if(!array_key_exists($questsubtopic['id'], $validations['edit-subtopics']) || !is_array($validations['edit-subtopics'][$questsubtopic['id']])) { + $validations['edit-subtopics'][$questsubtopic['id']] = array(); + } + //$validations['edit-subtopics'][$questsubtopic['id']]['title'] = $subtopicValidation; + $validations['edit-subtopics'][$questsubtopic['id']] = $this->Validation->addValidationResults($validations['edit-subtopics'][$questsubtopic['id']], 'title', $subtopicValidation); + } + if($this->Questtopics->questsubtopicTitleExists($questtopic['id'], $title, $questsubtopic['id'])) + { + if(!is_array($validations['edit-subtopics'])) { + $validations['edit-subtopics'] = array(); + } + if(!array_key_exists($questsubtopic['id'], $validations['edit-subtopics']) || !is_array($validations['edit-subtopics'][$questsubtopic['id']])) { + $validations['edit-subtopics'][$questsubtopic['id']] = array(); + } + $validations['edit-subtopics'][$questsubtopic['id']] = $this->Validation->addValidationResult($validations['edit-subtopics'][$questsubtopic['id']], 'title', 'exist', true); + } + } + + // Edit and delete + if($validations['edit-subtopics'] === true) + { + foreach($questsubtopics as &$questsubtopic) + { + // Delete + if(!is_null($deleteSubtopics) && array_key_exists($questsubtopic['id'], $deleteSubtopics)) { + $this->Questtopics->deleteQuestsubtopic($questsubtopic['id']); + } + // Edit + elseif(!is_null($subtopicsTitles) && array_key_exists($questsubtopic['id'], $subtopicsTitles)) + { + $title = $subtopicsTitles[$questsubtopic['id']]; + $this->Questtopics->editQuestsubtopic($questsubtopic['id'], $title); + } + } + + // Redirect + $this->redirect($this->linker->link(array($seminary['url'], $questtopic['url']), 2)); + } + } + + // Create Questsubtopic + elseif(!is_null($this->request->getPostParam('create-subtopic'))) + { + $action = 'create-subtopic'; + + // Get params and validate them + $validations[$action] = $this->Validation->validateParams($this->request->getPostParams(), array('title')); + $subtopicTitle = $this->request->getPostParam('title'); + if($this->Questtopics->questsubtopicTitleExists($questtopic['id'], $subtopicTitle)) { + $validations[$action] = $this->Validation->addValidationResult($validations[$action], 'title', 'exist', true); + } + + // Create + if($validations[$action] === true) + { + $this->Questtopics->createQuestsubtopic( + $this->Auth->getUserId(), + $questtopic['id'], + $subtopicTitle + ); + $subtopicTitle = ''; + + // Redirect + $this->redirect($this->linker->link(null, 4)); + } + } + } + + // Get validation settings + $validationSettings = array( + 'title' => \nre\configs\AppConfig::$validation['title'] + ); + + + // Set title + $this->addTitleLocalized('Edit Questtopic'); + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questtopicTitle', $questtopicTitle); + $this->set('subtopicsTitles', $subtopicsTitles); + $this->set('deleteSubtopics', $deleteSubtopics); + $this->set('subtopicTitle', $subtopicTitle); + $this->set('action', $action); + $this->set('validations', $validations); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: delete. + * + * Delete a Questtopic of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $eminaryUrl URL-Title of Seminary + * @param string $questtopicUrl URL-Title of Questtopic + */ + public function delete($seminaryUrl, $questtopicUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questtopic + $questtopic = $this->Questtopics->getQuesttopicByUrl($seminary['id'], $questtopicUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Questtopics->deleteQuesttopic($questtopic['id']); + + // Redirect to overview + $this->redirect($this->linker->link(array('index', $seminary['url']), 1)); + } + } + + + // Set title + $this->addTitleLocalized('Delete Questtopic'); + $this->addTitleLocalized('Library'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questtopic', $questtopic); + } + + } + +?> diff --git a/controllers/MailController.inc b/controllers/MailController.inc new file mode 100644 index 00000000..904a907f --- /dev/null +++ b/controllers/MailController.inc @@ -0,0 +1,136 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the MailAgent to generate a mail message. + * + * @author Oliver Hanraths + */ + class MailController extends \nre\core\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + + // Set linker + $this->set('linker', ($request instanceof \hhu\z\requests\MailRequest && !is_null($request->getLinker())) ? $request->getLinker() : null); + } + + + /** + * Action: userregistration. + * + * Generate a mail message to notify of a new user registration. + * + * @param array $receiver User that the message will be send to + * @param array $neUser Newly registered user + */ + public function userregistration($receiver, $newUser) + { + // Set subject + $this->response->setSubject(_('New user registration')); + + + // Pass data to view + $this->set('user', $newUser); + } + + + /** + * Action: characterregistration. + * + * Generate a mail message to notify of a new Character + * registration. + * + * @param array $receiver User that the message will be send to + * @param array $seminary Seminary which the Character was created for + * @param arary $user User of the newly registered Character + * @param array $newCharacter Newly registered Character + */ + public function characterregistration($receiver, $seminary, $user, $newCharacter) + { + // Set subject + $this->response->setSubject(_('New Character registration')); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('user', $user); + $this->set('character', $newCharacter); + } + + + /** + * Action: charactersubmission. + * + * Generate a mail message to notify of a new Character + * submission for a Quest that needs to be valuated. + * + * @param array $receiver User that the message will be send to + * @param array $seminary Seminary which the Quest belongs to + * @param array $questgroup Questgroup of Quest + * @param array $quest Quest the answer has been submitted for + * @param array $character Character that send the submission + */ + public function charactersubmission($receiver, $seminary, $questgroup, $quest, $character) + { + // Set subject + $this->response->setSubject(_('New Character submission')); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('character', $character); + } + + + /** + * Action: charactersubmissionapproved. + * + * Generate a mail message to notify a Character that its + * submission has been approved. + * + * @param array $receiver User that the message will be send to + * @param array $seminary Seminary which the Quest belongs to + * @param array $questgroup Questgroup of Quest + * @param array $quest Quest the answer has been submitted for + */ + public function charactersubmissionapproved($receiver, $seminary, $questgroup, $quest) + { + // Set subject + $this->response->setSubject(_('Character submission approved')); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + } + + } + +?> diff --git a/controllers/MailreceiverController.inc b/controllers/MailreceiverController.inc new file mode 100644 index 00000000..7ae92470 --- /dev/null +++ b/controllers/MailreceiverController.inc @@ -0,0 +1,39 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the MailreceiverAgent to generate a mail receiver + * salutation. + * + * @author Oliver Hanraths + */ + class MailreceiverController extends \nre\core\Controller + { + + + + + /** + * Action: index. + * + * @param $array $user User receiving mail + */ + public function index($user) + { + $this->set('user', $user); + } + + } + +?> diff --git a/controllers/MapController.inc b/controllers/MapController.inc new file mode 100644 index 00000000..7dbb6ab4 --- /dev/null +++ b/controllers/MapController.inc @@ -0,0 +1,72 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the MapAgent to display a map. + * + * @author Oliver Hanraths + */ + class MapController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'map'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: index. + * + * Draw the map. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + */ + public function index($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get map + $map = $this->Map->getMapOfSeminary($seminary['id']); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('map', $map); + } + + } + +?> diff --git a/controllers/MediaController.inc b/controllers/MediaController.inc new file mode 100644 index 00000000..a55cd94a --- /dev/null +++ b/controllers/MediaController.inc @@ -0,0 +1,597 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the MediaAgent to process and show Media. + * + * @author Oliver Hanraths + */ + class MediaController extends \hhu\z\controllers\SeminaryController + { + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user', 'guest'), + 'seminarymoodpic' => array('admin', 'moderator', 'user'), + 'seminarymap' => array('admin', 'moderator', 'user'), + 'seminary' => array('admin', 'moderator', 'user'), + 'avatar' => array('admin', 'moderator', 'user'), + 'achievement' => array('admin', 'moderator', 'user'), + 'charactergroup' => array('admin', 'moderator', 'user'), + 'charactergroupsquest' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'seminary' => array('admin', 'moderator', 'user', 'guest'), + 'achievement' => array('admin', 'moderator', 'user', 'guest'), + 'charactergroup' => array('admin', 'moderator', 'user', 'guest'), + 'charactergroupsquest' => array('admin', 'moderator', 'user', 'guest') + ); + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'achievements', 'media', 'avatars', 'charactergroups', 'charactergroupsquests', 'map'); + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set headers for caching control + $response->addHeader("Pragma: public"); + $response->addHeader("Cache-control: must-revalidate"); + $response->addHeader("Date: ".gmdate(\DateTime::RFC822)); + } + + + /** + * Action: index + * + * Display a medium. + * + * @param string $mediaUrl URL-name of the medium + * @param string $action Action for processing the media + */ + public function index($mediaUrl, $action=null) + { + // Get Media + $media = $this->Media->getMediaByUrl($mediaUrl); + + // Get file + $file = $this->getMediaFile($media, $action); + if(is_null($media)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: seminarymoodpic + * + * Display the moodpic for a category of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of the Seminary + * @param string $category Category to show moodpic of + * @param string $action Action for processing the media + */ + public function seminarymoodpic($seminaryUrl, $category=null, $action=null) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Set index + switch($category) + { + case null: + $index = 'seminarymedia_id'; + break; + case 'charactergroups': + $index = 'charactergroups_seminarymedia_id'; + break; + case 'achievements': + $index = 'achievements_seminarymedia_id'; + break; + case 'library': + $index = 'library_seminarymedia_id'; + break; + } + + // Get media + $media = $this->Media->getSeminaryMediaById($seminary[$index]); + + // Get file + $file = $this->getMediaFile($media, $action); + if(is_null($file)) { + return; + } + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: seminarymap + * + * Display the map of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of the Seminary + */ + public function seminarymap($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get map + $map = $this->Map->getMapOfSeminary($seminary['id']); + if(is_null($map)) { + throw new \nre\exceptions\IdNotFoundException($seminaryUrl); + } + + // Get media + $media = $this->Media->getSeminaryMediaById($map['seminarymedia_id']); + + // Get file + $file = $this->getMediaFile($media); + if(is_null($file)) { + return; + } + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: seminary. + * + * Display a Seminary medium. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of the Seminary + * @param string $mediaUrl URL-name of the medium + * @param string $action Action for processing the media + */ + public function seminary($seminaryUrl, $mediaUrl, $action=null) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Media + $media = $this->Media->getSeminaryMediaByUrl($seminary['id'], $mediaUrl); + + // Get file + $file = $this->getMediaFile($media, $action); + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: avatar. + * + * Display an Avatar as full size or portrait. + * + * @throws \nre\exceptions\ParamsNotValidException + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of the Seminary + * @param string $charactertypeUrl URL-title of Character type + * @param int $xplevel XP-level + * @param string $action Size to show (avatar or portrait) + */ + public function avatar($seminaryUrl, $charactertypeUrl, $xplevel, $action='avatar') + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Avatar + $avatar = $this->Avatars->getAvatarByTypeAndLevel($seminary['id'], $charactertypeUrl, $xplevel); + + // Get media + switch($action) + { + case null: + case 'avatar': + $media = $this->Media->getSeminaryMediaById($avatar['avatarpicture_id']); + $file = $this->getMediaFile($media, 'avatar'); + break; + case 'portrait': + $media = $this->Media->getSeminaryMediaById($avatar['small_avatarpicture_id']); + $file = $this->getMediaFile($media); + break; + default: + throw new \nre\exceptions\ParamsNotValidException($action); + break; + } + + // Get file + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: achievement + * + * Display the achievement of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of the Seminary + * @param string $achievementUrl URL-title of the Achievement + * @param string $action Action for processing the media + */ + public function achievement($seminaryUrl, $achievementUrl, $locked=null) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character + $character = SeminaryController::$character; + + // Get Achievement + $achievement = $this->Achievements->getAchievementByUrl($seminary['id'], $achievementUrl); + + // Get media + switch($locked) + { + case null: + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) == 0) { + if(is_null($character) || !$this->Achievements->hasCharacterAchievedAchievement($achievement['id'], $character['id'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + $index = 'achieved_achievementsmedia_id'; + break; + case 'locked': + $index = 'unachieved_achievementsmedia_id'; + break; + default: + throw new \nre\exceptions\ParamsNotValidException($locked); + break; + } + if(is_null($achievement[$index])) { + throw new \nre\exceptions\IdNotFoundException($achievementUrl); + } + $media = $this->Media->getSeminaryMediaById($achievement[$index]); + + // Get file + $file = $this->getMediaFile($media, null); + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: charactergroup + * + * Display the icon for a Character group of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function charactergroup($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + + // Check media + if(is_null($group['charactergroupsmedia_id'])) { + $this->redirect($this->linker->link(array('grafics','charactergroup.jpg'))); + } + + // Get media + $media = $this->Media->getSeminaryMediaById($group['charactergroupsmedia_id']); + + // Get file + $file = $this->getMediaFile($media, 'charactergroup'); + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + /** + * Action: charactergroupsquest + * + * Display the icon for a Character groups Quest of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $questUrl URL-Title of a Character groups Quest + */ + public function charactergroupsquest($seminaryUrl, $groupsgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character groups Quests + $quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl); + + // Check media + if(is_null($quest['questsmedia_id'])) { + $this->redirect($this->linker->link(array('grafics','charactergroup.jpg'))); + } + + // Get media + $media = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + + // Get file + $file = $this->getMediaFile($media, 'charactergroupsquest'); + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('media', $media); + $this->set('file', $file); + } + + + + + /** + * Determine file information and set the HTTP-header for + * caching accordingly. + * + * @param string $fileName Filename + * @return boolean HTTP-status 304 was set (in cache) + */ + private function setCacheHeaders($fileName) + { + // Determine last change of file + $fileLastModified = gmdate('r', filemtime($fileName)); + + // Generate E-Tag + $fileEtag = hash('sha256', $fileLastModified.$fileName); + + + // Set header + $this->response->addHeader("Last-Modified: ".$fileLastModified); + $this->response->addHeader("Etag: ".$fileEtag); + // HTTP-status + $headerModifiedSince = $this->request->getServerParam('HTTP_IF_MODIFIED_SINCE'); + $headerNoneMatch = $this->request->getServerParam('HTTP_IF_NONE_MATCH'); + if( + !is_null($headerModifiedSince) && strtotime($fileLastModified) <= strtotime($headerModifiedSince) && + !is_null($headerNoneMatch) && $headerNoneMatch == $fileEtag + ) { + $this->response->setExit(true); + $this->response->addHeader(\nre\core\WebUtils::getHttpHeader(304)); + + return true; + } + + + return false; + } + + + /** + * Determine the file for a medium and process it if necessary. + * + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\ParamsNotValidException + * @param array $media Medium to get file for + * @param string $action Action for processing the media + * @return object File for the medium (or null if medium is cached) + */ + private function getMediaFile($media, $action=null) + { + // Get format + $format = explode('/', $media['mimetype']); + $format = $format[1]; + + // Set content-type + $this->response->addHeader("Content-type: ".$media['mimetype'].""); + + // Set filename + $media['filename'] = ROOT.DS.\nre\configs\AppConfig::$dirs['seminarymedia'].DS.$media['id']; + if(!file_exists($media['filename'])) { + throw new \nre\exceptions\IdNotFoundException($media['id'].': '.$media['url']); + } + + // Cache + if($this->setCacheHeaders($media['filename'])) { + return null; + } + + // Load and process file + $file = null; + switch($action) + { + // No action + case null: + // Do not process the file + $file = file_get_contents($media['filename']); + break; + case 'questgroup': + if(!in_array(strtoupper($format), self::getImageTypes())) { + $file = file_get_contents($media['filename']); + } + else + { + $file = self::resizeImage( + $media['filename'], + $format, + \nre\configs\AppConfig::$media['questgroup']['width'], + \nre\configs\AppConfig::$media['questgroup']['height'] + ); + } + break; + case 'avatar': + $file = self::resizeImage( + $media['filename'], + $format, + \nre\configs\AppConfig::$media['avatar']['width'], + \nre\configs\AppConfig::$media['avatar']['height'] + ); + break; + case 'charactergroup': + $file = self::resizeImage( + $media['filename'], + $format, + \nre\configs\AppConfig::$media['charactergroup']['width'], + \nre\configs\AppConfig::$media['charactergroup']['height'] + ); + break; + case 'charactergroupsquest': + $file = self::resizeImage( + $media['filename'], + $format, + \nre\configs\AppConfig::$media['charactergroupsquest']['width'], + \nre\configs\AppConfig::$media['charactergroupsquest']['height'] + ); + break; + default: + throw new ParamsNotValidException($action); + break; + } + + + // Return file + return $file; + } + + + /** + * Get supported image types. + * + * @return array List of supported image types + */ + private static function getImageTypes() + { + $im = new \Imagick(); + + + return $im->queryFormats(); + } + + + /** + * Resize an image. + * + * @param string $fileName Absolute pathname of image to resize + * @param string $mimeType Mimetype of target image + * @param int $width Max. width to resize to + * @param int $height Max. height to resize to + * @return mixed Resized image + */ + private static function resizeImage($fileName, $mimeType, $width, $height) + { + // Read image from cache + $tempFileName = ROOT.DS.\nre\configs\AppConfig::$dirs['temporary'].DS.'media-'.basename($fileName).'-'.$width.'x'.$height; + if(file_exists($tempFileName)) + { + // Check age of file + if(filemtime($fileName) > filemtime($tempFileName)) { + // Too old, delete + unlink($tempFileName); + } + else { + // Valid, read and return + return file_get_contents($tempFileName); + } + } + + + // ImageMagick + $im = new \Imagick($fileName); + + // Calculate new size + $geometry = $im->getImageGeometry(); + if($geometry['width'] < $width) { + $width = $geometry['width']; + } + if($geometry['height'] < $height) { + $height = $geometry['width']; + } + + // Process + $im->thumbnailImage($width, $height, true); + $im->contrastImage(1); + $im->setImageFormat($mimeType); + + // Save temporary file + $im->writeImage($tempFileName); + + + // Return resized image + return $im; + } + + } + +?> diff --git a/controllers/MenuController.inc b/controllers/MenuController.inc new file mode 100644 index 00000000..2a506d71 --- /dev/null +++ b/controllers/MenuController.inc @@ -0,0 +1,52 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to display a menu. + * + * @author Oliver Hanraths + */ + class MenuController extends \hhu\z\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set userdata + $this->set('loggedUser', IntermediateController::$user); + $this->set('loggedCharacter', SeminaryController::$character); + $this->set('loggedSeminary', SeminaryController::$seminary); + } + + + /** + * Action: index. + */ + public function index() + { + } + + } + +?> diff --git a/controllers/QuestgroupsController.inc b/controllers/QuestgroupsController.inc new file mode 100644 index 00000000..b73b8e8d --- /dev/null +++ b/controllers/QuestgroupsController.inc @@ -0,0 +1,757 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the QuestgroupsAgent to display Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroupshierarchy', 'questgroups', 'questgrouptexts', 'quests', 'questtexts', 'media'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'questgroup' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'edittexts' => array('admin', 'moderator', 'user'), + 'moveup' => array('admin', 'moderator', 'user'), + 'movedown' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'questgroup' => array('admin', 'moderator', 'user'), + 'create' => array('admin'), + 'edit' => array('admin', 'moderator'), + 'edittexts' => array('admin', 'moderator'), + 'moveup' => array('admin'), + 'movedown' => array('admin'), + 'delete' => array('admin') + ); + + + + + /** + * Action: questgroup. + * + * Display a Questgroup and its data. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + */ + public function questgroup($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Questgrouphierarchy + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + + // Get Character + $character = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + + // Check permission + if(count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) == 0) + { + // Only check permissions if Character has not entered Quest before + if(!$this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], $character['id'])) + { + $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($seminary['id'], $questgroup['id']); + if(!is_null($previousQuestgroup)) { + if(!$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + } + } + + // Set status “entered” + $this->Questgroups->setQuestgroupEntered($questgroup['id'], $character['id']); + + // Get child Questgroupshierarchy + $childQuestgroupshierarchy = null; + if(!empty($questgroup['hierarchy'])) + { + $childQuestgroupshierarchy = $this->Questgroupshierarchy->getChildQuestgroupshierarchy($questgroup['hierarchy']['id']); + foreach($childQuestgroupshierarchy as &$hierarchy) + { + // Get Questgroups + $hierarchy['questgroups'] = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id'], $questgroup['id']); + + // Get additional data + foreach($hierarchy['questgroups'] as $i => &$group) + { + $group['solved'] = $this->Questgroups->hasCharacterSolvedQuestgroup($group['id'], $character['id']); + + // Check permission of Questgroups + if($i >= 1 && count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) == 0) + { + if(!$hierarchy['questgroups'][$i-1]['solved']) + { + $hierarchy['questgroups'] = array_slice($hierarchy['questgroups'], 0, $i); + break; + } + } + + // Get Character XPs + $group['character_xps'] = $this->Questgroups->getAchievedXPsForQuestgroup($group['id'], $character['id']); + + // Attach related Questgroups + $group['relatedQuestgroups'] = array(); + $relatedQuestgroups = $this->Questgroups->getRelatedQuestsgroupsOfQuestgroup($group['id']); + foreach($relatedQuestgroups as &$relatedQuestgroup) { + if($this->Questgroups->hasCharacterEnteredQuestgroup($relatedQuestgroup['id'], $character['id'])) { + $group['relatedQuestgroups'][] = $this->Questgroups->getQuestgroupById($relatedQuestgroup['id']); + } + + } + } + } + } + + // Get texts + $questgroupTexts = $this->Questgrouptexts->getQuestgroupTexts($questgroup['id']); + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) + { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + + // Get Quests + $quests = array(); + if(count($childQuestgroupshierarchy) == 0) + { + $currentQuest = null; + do { + // Get next Quest + if(is_null($currentQuest)) { + $currentQuest = $this->Quests->getFirstQuestOfQuestgroup($questgroup['id']); + } + else { + $nextQuests = $this->Quests->getNextQuests($currentQuest['id']); + $currentQuest = null; + foreach($nextQuests as &$nextQuest) { + if($this->Quests->hasCharacterEnteredQuest($nextQuest['id'], $character['id'])) { + $currentQuest = $nextQuest; + break; + } + } + } + + // Add additional data + if(!is_null($currentQuest)) + { + // Set status + $currentQuest['solved'] = $this->Quests->hasCharacterSolvedQuest($currentQuest['id'], $character['id']); + + // Attach related Questgroups + $currentQuest['relatedQuestgroups'] = array(); + $relatedQuestgroups = $this->Questgroups->getRelatedQuestsgroupsOfQuest($currentQuest['id']); + foreach($relatedQuestgroups as &$relatedQuestgroup) + { + if($this->Questgroups->hasCharacterEnteredQuestgroup($relatedQuestgroup['id'], $character['id'])) { + $currentQuest['relatedQuestgroups'][] = $this->Questgroups->getQuestgroupById($relatedQuestgroup['id']); + } + } + + // Add Quest to Quests + $quests[] = $currentQuest; + } + } + while(!is_null($currentQuest) && ($currentQuest['solved'] || count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) > 0)); + } + + + // Set titile + if(!is_null($questgroup['hierarchy'])) { + $this->addTitle(sprintf('%s %d: %s', $questgroup['hierarchy']['title_singular'], $questgroup['hierarchy']['questgroup_pos'], $questgroup['title'])); + } + else { + $this->addTitle($questgroup['title']); + } + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('childquestgroupshierarchy', $childQuestgroupshierarchy); + $this->set('texts', $questgroupTexts); + $this->set('picture', $picture); + $this->set('quests', $quests); + } + + + /** + * Action: create. + * + * Create a new Questgroup. + * + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function create($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $selectedQuestgroupshierarchy = null; + $selectedQuestgroup = null; + $title = ''; + $fields = array('title'); + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Questgroups->questgroupTitleExists($seminary['id'], $title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + + // Validate Questgroupshierarchy + try { + $selectedQuestgroupshierarchy = $this->Questgroupshierarchy->getHierarchyByUrl($seminary['id'], $this->request->getPostParam('questgroupshierarchy')); + } + catch(\nre\exceptions\IdNotFoundException $e) { + throw new \nre\exceptions\ParamsNotValidException($this->request->getPostParam('questgroupshierarchy')); + } + + // Validate Questgroup + if(!is_null($selectedQuestgroupshierarchy['parent_questgroupshierarchy_id'])) { + try { + $selectedQuestgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $this->request->getPostParam('questgroup')); + } + catch(\nre\exceptions\IdNotFoundException $e) { + throw new \nre\exceptions\ParamsNotValidException($this->request->getPostParam('questgroups')); + } + } + + // Validate moodpic + $moodpic = null; + if(!empty($_FILES) && array_key_exists('moodpic', $_FILES) && $_FILES['moodpic']['error'] != UPLOAD_ERR_NO_FILE) + { + $moodpic = $_FILES['moodpic']; + + // Check error + if($moodpic['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'error', $moodpic['error']); + } + + // Check mimetype + $mediaMimetype = null; + $moodpic['mimetype'] = \hhu\z\Utils::getMimetype($moodpic['tmp_name'], $moodpic['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $moodpic['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'mimetype', $moodpic['mimetype']); + } + elseif($moodpic['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'size', $mediaMimetype['size']); + } + } + + // Create new Questgroup + if($validation === true) + { + $questgroupId = $this->Questgroups->createQuestgroup( + $this->Auth->getUserId(), + $seminary['id'], + $title + ); + $questgroup = $this->Questgroups->getQuestgroupById($questgroupId); + + // Add to Hierarchy + $this->Questgroups->addQuestgroupToHierarchy( + $questgroupId, + $selectedQuestgroupshierarchy['id'], + (!is_null($selectedQuestgroup)) ? $selectedQuestgroup['id'] : null + ); + + // Upload moodpic + if(!is_null($moodpic)) + { + $mediaId = $this->Media->createQuestgrouppicture( + $this->Auth->getUserId(), + $seminary['id'], + $questgroup['id'], + sprintf('questgroupmoodpic-%s', $questgroup['url']), + '', + $moodpic['mimetype'], + $moodpic['tmp_name'] + ); + if($mediaId !== false) { + $this->Questgroups->setMoodpicForQuestgroup($questgroup['id'], $mediaId); + } + } + + + // Redirect to new Questgroup + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $questgroup['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Create Questgroup'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('mimetypes', $mimetypes); + $this->set('questgroupshierarchy', $selectedQuestgroupshierarchy); + $this->set('questgroup', $selectedQuestgroup); + $this->set('title', $title); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a Questgroup. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of a Seminary + * @param string $questgroupUrl URL-title of Questgroup to edit + */ + public function edit($seminaryUrl, $questgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = $questgroup['title']; + $fields = array('title'); + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Questgroups->questgroupTitleExists($seminary['id'], $title, $questgroup['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + + // Validate moodpic + $moodpic = null; + if(!empty($_FILES) && array_key_exists('moodpic', $_FILES) && $_FILES['moodpic']['error'] != UPLOAD_ERR_NO_FILE) + { + $moodpic = $_FILES['moodpic']; + + // Check error + if($moodpic['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'error', $moodpic['error']); + } + + // Check mimetype + $mediaMimetype = null; + $moodpic['mimetype'] = \hhu\z\Utils::getMimetype($moodpic['tmp_name'], $moodpic['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $moodpic['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'mimetype', $moodpic['mimetype']); + } + elseif($moodpic['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'size', $mediaMimetype['size']); + } + } + + // Edit Questgroup + if($validation === true) + { + $this->Questgroups->editQuestgroup( + $questgroup['id'], + $title + ); + $questgroup = $this->Questgroups->getQuestgroupById($questgroup['id']); + + // Upload moodpic + if(!is_null($moodpic)) + { + $mediaId = $this->Media->createQuestgrouppicture( + $this->Auth->getUserId(), + $seminary['id'], + $questgroup['id'], + sprintf('questgroupmoodpic-%s', $questgroup['url']), + '', + $moodpic['mimetype'], + $moodpic['tmp_name'] + ); + if($mediaId !== false) { + $this->Questgroups->setMoodpicForQuestgroup($questgroup['id'], $mediaId); + } + } + + + // Redirect to new Questgroup + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $questgroup['url']), 1)); + } + } + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Edit Questgroup'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('picture', $picture); + $this->set('title', $title); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edittexts. + * + * Edit the texts of a Questgroup. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of a Seminary + * @param string $questgroupUrl URL-title of Questgroup to edit + */ + public function edittexts($seminaryUrl, $questgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Questgroup texts + $questgroupTexts = $this->Questgrouptexts->getQuestgroupTexts($questgroup['id']); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + $texts = $this->request->getPostParam('questgrouptexts'); + $deleteTexts = $this->request->getPostParam('deletes'); + if(!is_array($deleteTexts)) { + $deleteTexts = array(); + } + + // Edit or delete texts + foreach($questgroupTexts as $text) + { + if(array_key_exists($text['id'], $deleteTexts)) + { + $this->Questgrouptexts->deleteQuestgrouptext($text); + unset($texts[$text['id']]); + } + elseif(array_key_exists($text['id'], $texts)) + { + $this->Questgrouptexts->editQuestgrouptext($text['id'], $texts[$text['id']]); + unset($texts[$text['id']]); + } + } + + // Add new texts + foreach($texts as $text) { + if(!empty($text)) { + $this->Questgrouptexts->addQuestgrouptextToQuestgroup($this->Auth->getUserId(), $questgroup['id'], $text); + } + } + + // Redirect to Questgroup + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $questgroup['url']), 1)); + } + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + + // Set titile + $this->addTitleLocalized('Edit Questgroup texts'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('questgrouptexts', $questgroupTexts); + $this->set('picture', $picture); + $this->set('mimetypes', $mimetypes); + } + + + /** + * Action: moveup. + * + * Move a Questgroup up (decrement position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupUrl URL-title of Questgroup + */ + public function moveup($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('move'))) + { + // Set position + $this->Questgroups->moveQuestgroup($questgroup, true); + } + + // Redirect + $referer = $this->request->getGetParam('referer'); + if(!is_null($referer)) + { + try { + $questgroup = $this->Questgroups->getQuestgroupById($referer); + $this->redirect($this->linker->link(array('questgroups', 'questgroup', $seminary['url'], $questgroup['url']))); + } + catch(IdNotFoundException $e) { + } + } + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + + // Set titile + $this->addTitleLocalized('Move Questgroup'); + + // Show confirmation + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('picture', $picture); + } + + + /** + * Action: movedown + * + * Move a Questgroup down (increment position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupUrl URL-title of Questgroup + */ + public function movedown($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('move'))) + { + // Set position + $this->Questgroups->moveQuestgroup($questgroup, false); + } + + // Redirect + $referer = $this->request->getGetParam('referer'); + if(!is_null($referer)) + { + try { + $questgroup = $this->Questgroups->getQuestgroupById($referer); + $this->redirect($this->linker->link(array('questgroups', 'questgroup', $seminary['url'], $questgroup['url']))); + } + catch(IdNotFoundException $e) { + } + } + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + + // Set titile + $this->addTitleLocalized('Move Questgroup'); + + // Show confirmation + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('picture', $picture); + } + + + /** + * Action: delete. + * + * Delete a Questgroup. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + */ + public function delete($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Questgrouphierarchy + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete Questgroup + $this->Questgroups->deleteQuestgroup($questgroup['id']); + + // Redirect + if(!is_null($questgroup['hierarchy'])) + { + // Parent Questgroup + if(is_null($questgroup['hierarchy']['parent_questgroup_id'])) { + $this->redirect($this->linker->link(array('simenaries', 'seminary', $seminary['url']))); + } + else + { + $parentQuestgroup = $this->Questgroups->getQuestgroupById($questgroup['hierarchy']['parent_questgroup_id']); + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $parentQuestgroup['url']), 1)); + } + } + else + { + // Related Questgroup + $questtexts = $this->Questtexts->getRelatedQuesttextsForQuestgroup($questgroup['id']); + $questtext = $this->Questtexts->pickQuesttextLastEnteredByCharacter(\hhu\z\controllers\SeminaryController::$character['id'], $questtexts); + $quest = $this->Quests->getQuestById($questtext['quest_id']); + $relatedQuestgroup = $this->Questgroups->getQuestgroupById($quest['questgroup_id']); + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $relatedQuestgroup['url']), 1)); + } + } + + // Redirect to entry + $this->redirect($this->linker->link(array('questgroup', $seminary['url'], $questgroup['url']), 1)); + } + + // Media + $picture = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $picture = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + + // Set titile + $this->addTitleLocalized('Delete Questgroup'); + + // Show confirmation + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('picture', $picture); + } + + } + +?> diff --git a/controllers/QuestgroupshierarchyController.inc b/controllers/QuestgroupshierarchyController.inc new file mode 100644 index 00000000..b50cad5e --- /dev/null +++ b/controllers/QuestgroupshierarchyController.inc @@ -0,0 +1,346 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the QuestgroupsAgent to display Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchyController extends \hhu\z\controllers\SeminaryController + { + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroupshierarchy', 'questgroups'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'create' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'moveup' => array('admin', 'moderator', 'user'), + 'movedown' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'create' => array('admin'), + 'edit' => array('admin'), + 'moveup' => array('admin'), + 'movedown' => array('admin'), + 'delete' => array('admin') + ); + + + + + /** + * Action: create. + * + * Create a new Questgroupshierarchy. + * + * @param string $seminaryUrl URL-title of a Seminary + */ + public function create($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get parent Questgroupshierarchy + $parentQuestgroupshierarchy = $this->Questgroupshierarchy->getHierarchyOfSeminary($seminary['id']); + + // Values + $titleSingular = ''; + $titlePlural = ''; + $validation = array(); + + // Create Questgroupshierarchy + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $titleSingular = $this->request->getPostParam('title_singular'); + $validation = $this->Validation->addValidationResults( + $validation, + 'titleSingular', + $this->Validation->validate($titleSingular, \nre\configs\AppConfig::$validation['questgroupshierarchytitle']) + ); + if($this->Questgroupshierarchy->questgroupshierarchyTitleSingularExists($titleSingular, $seminary['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'titleSingular', 'exist', true); + } + $titlePlural = $this->request->getPostParam('title_plural'); + $validation = $this->Validation->addValidationResults( + $validation, + 'titlePlural', + $this->Validation->validate($titlePlural, \nre\configs\AppConfig::$validation['questgroupshierarchytitle']) + ); + if($this->Questgroupshierarchy->questgroupshierarchyTitleSingularExists($titlePlural, $seminary['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'titlePlural', 'exist', true); + } + + // Validate parent Questgroupshierarchy + $parentQuestgroupshierarchyIndex = null; + foreach($parentQuestgroupshierarchy as $index => &$parentHierarchy) + { + $parentHierarchy['selected'] = ($parentHierarchy['url'] == $this->request->getPostParam('parent')); + if($parentHierarchy['selected']) { + $parentQuestgroupshierarchyIndex = $index; + } + } + + // Create new Questgroupshierarchy + if($validation === true) + { + $questgroupshierarchyId = $this->Questgroupshierarchy->createQuestgroupshierarchy( + $this->Auth->getUserId(), + $seminary['id'], + (!is_null($parentQuestgroupshierarchyIndex) ? $parentQuestgroupshierarchy[$parentQuestgroupshierarchyIndex]['id'] : null), + $titleSingular, + $titlePlural + ); + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyById($questgroupshierarchyId); + + // Redirect + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + } + + // Get validation settings + $validationSettings = array( + 'title' => \nre\configs\AppConfig::$validation['title'] + ); + + + // Set titile + $this->addTitleLocalized('Create Questgroupshierarchy'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('titleSingular', $titleSingular); + $this->set('titlePlural', $titlePlural); + $this->set('parentQuestgroupshierarchy', $parentQuestgroupshierarchy); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a Questgroupshierarchy. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupshierarchyUrl URL-title of Questgroupshierarchy + */ + public function edit($seminaryUrl, $questgroupshierarchyUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroupshierarchy + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyByUrl($seminary['id'], $questgroupshierarchyUrl); + + // Values + $titleSingular = $questgroupshierarchy['title_singular']; + $titlePlural = $questgroupshierarchy['title_plural']; + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $titleSingular = $this->request->getPostParam('title_singular'); + $validation = $this->Validation->addValidationResults( + $validation, + 'titleSingular', + $this->Validation->validate($titleSingular, \nre\configs\AppConfig::$validation['questgroupshierarchytitle']) + ); + if($this->Questgroupshierarchy->questgroupshierarchyTitleSingularExists($titleSingular, $seminary['id'], $questgroupshierarchy['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'titleSingular', 'exist', true); + } + $titlePlural = $this->request->getPostParam('title_plural'); + $validation = $this->Validation->addValidationResults( + $validation, + 'titlePlural', + $this->Validation->validate($titlePlural, \nre\configs\AppConfig::$validation['questgroupshierarchytitle']) + ); + if($this->Questgroupshierarchy->questgroupshierarchyTitleSingularExists($titlePlural, $seminary['id'], $questgroupshierarchy['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'titlePlural', 'exist', true); + } + + + // Edit Questgroup + if($validation === true) + { + $this->Questgroupshierarchy->editQuestgroupshierarchy( + $questgroupshierarchy['id'], + $titleSingular, + $titlePlural + ); + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyById($questgroupshierarchy['id']); + + // Redirect to Seminary page + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + } + + // Get validation settings + $validationSettings = array( + 'title' => \nre\configs\AppConfig::$validation['title'] + ); + + + // Set titile + $this->addTitleLocalized('Edit Questgroupshierarchy'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('titleSingular', $titleSingular); + $this->set('titlePlural', $titlePlural); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: moveup. + * + * Move a Questgroupshierarchy up (decrement position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupshierarchyUrl URL-title of Questgroupshierarchy + */ + public function moveup($seminaryUrl, $questgroupshierarchyUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroupshierarchy + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyByUrl($seminary['id'], $questgroupshierarchyUrl); + + // Set position + $this->Questgroupshierarchy->moveQuestgroupshierarchy($questgroupshierarchy, true); + + + // Redirect + $referer = $this->request->getGetParam('referer'); + if(!is_null($referer)) + { + try { + $questgroup = $this->Questgroups->getQuestgroupById($referer); + $this->redirect($this->linker->link(array('questgroups', 'questgroup', $seminary['url'], $questgroup['url']))); + } + catch(IdNotFoundException $e) { + } + } + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + + + /** + * Action: movedown. + * + * Move a Questgroupshierarchy down (increment position). + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupshierarchyUrl URL-title of Questgroupshierarchy + */ + public function movedown($seminaryUrl, $questgroupshierarchyUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroupshierarchy + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyByUrl($seminary['id'], $questgroupshierarchyUrl); + + // Set position + $this->Questgroupshierarchy->moveQuestgroupshierarchy($questgroupshierarchy, false); + + + // Redirect + $referer = $this->request->getGetParam('referer'); + if(!is_null($referer)) + { + try { + $questgroup = $this->Questgroups->getQuestgroupById($referer); + $this->redirect($this->linker->link(array('questgroups', 'questgroup', $seminary['url'], $questgroup['url']))); + } + catch(IdNotFoundException $e) { + } + } + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + + + /** + * Action: delete. + * + * Delete a Questgroupshierarchy. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $questgroupshierarchyUrl URL-title of Questgroupshierarchy + */ + public function delete($seminaryUrl, $questgroupshierarchyUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroupshierarchy + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyByUrl($seminary['id'], $questgroupshierarchyUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete Questgroupshierarchy + $this->Questgroupshierarchy->deleteQuestgroupshierarchy($questgroupshierarchy['id']); + } + + // Redirect to Seminary page + $this->redirect($this->linker->link(array('seminaries', 'seminary', $seminary['url']))); + } + + + // Set titile + $this->addTitleLocalized('Delete Questgroupshierarchy'); + + // Show confirmation + $this->set('seminary', $seminary); + $this->set('questgroupshierarchy', $questgroupshierarchy); + } + + } + +?> diff --git a/controllers/QuestgroupshierarchypathController.inc b/controllers/QuestgroupshierarchypathController.inc new file mode 100644 index 00000000..907017d5 --- /dev/null +++ b/controllers/QuestgroupshierarchypathController.inc @@ -0,0 +1,91 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of QuestgroupshierarchypathAgent to display the + * Questgroups hierarchy path. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchypathController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'questgroupshierarchy', 'quests', 'questtexts'); + + + + + /** + * Action: index. + * + * Calculate and show the hierarchy path of a Questgroup. + * + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + * @param boolean $showGroup Show the current group itself + */ + public function index($seminaryUrl, $questgroupUrl, $showGroup=false) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + + // Get parent Questgrouphierarchy + $currentQuestgroup = $questgroup; + $parentQuestgroupshierarchy = array(); + if($showGroup) { + array_unshift($parentQuestgroupshierarchy, $currentQuestgroup); + } + if(is_null($questgroup['hierarchy'])) + { + // Get related Questgroup + $questtexts = $this->Questtexts->getRelatedQuesttextsForQuestgroup($currentQuestgroup['id']); + $questtext = $this->Questtexts->pickQuesttextLastEnteredByCharacter(\hhu\z\controllers\SeminaryController::$character['id'], $questtexts); + $quest = $this->Quests->getQuestById($questtext['quest_id']); + $currentQuestgroup = $this->Questgroups->getQuestgroupById($quest['questgroup_id']); + $currentQuestgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($currentQuestgroup['id']); + $quest['questgroup'] = $currentQuestgroup; + + // Use Hierarchy name for optional Questgroup + if(!empty($parentQuestgroupshierarchy)) { + $parentQuestgroupshierarchy[0]['hierarchy'] = $currentQuestgroup['hierarchy']; + unset($parentQuestgroupshierarchy[0]['hierarchy']['questgroup_pos']); + } + + array_unshift($parentQuestgroupshierarchy, $quest); + array_unshift($parentQuestgroupshierarchy, $currentQuestgroup); + } + while(!empty($currentQuestgroup['hierarchy']) && !is_null($currentQuestgroup['hierarchy']['parent_questgroup_id'])) + { + $currentQuestgroup = $this->Questgroups->GetQuestgroupById($currentQuestgroup['hierarchy']['parent_questgroup_id']); + $currentQuestgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($currentQuestgroup['id']); + array_unshift($parentQuestgroupshierarchy, $currentQuestgroup); + } + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('parentquestgroupshierarchy', $parentQuestgroupshierarchy); + } + + } + +?> diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc new file mode 100644 index 00000000..cc345b1f --- /dev/null +++ b/controllers/QuestsController.inc @@ -0,0 +1,1506 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the QuestsAgent to display Quests. + * + * @author Oliver Hanraths + */ + class QuestsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'quests', 'questtexts', 'media', 'questtypes', 'questgroupshierarchy', 'xplevels'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'quest' => array('admin', 'moderator', 'user'), + 'submissions' => array('admin', 'moderator', 'user'), + 'submission' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator', 'user'), + 'edit' => array('admin', 'moderator', 'user'), + 'edittexts' => array('admin', 'moderator', 'user'), + 'edittask' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'index' => array('admin', 'moderator'), + 'quest' => array('admin', 'moderator', 'user'), + 'submissions' => array('admin', 'moderator'), + 'submission' => array('admin', 'moderator'), + 'create' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator'), + 'edittexts' => array('admin', 'moderator'), + 'edittask' => array('admin', 'moderator'), + 'delete' => array('admin') + ); + + + + + /** + * Prefilter that is executed before running the Controller. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + $this->checkAchievements($request, $response, array('character', 'quest')); + $this->checkAchievements($request, $response, 'achievement'); + } + + + /** + * Action: index. + * + * List all Quests for a Seminary. + * + * @param string $seminaryUrl URL-Title of Seminary + * @param string $all Show all Quests + */ + public function index($seminaryUrl, $all=null) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Set filters + $selectedQuestgroup = null; + $selectedQuesttype = null; + $selectedTitle = null; + $page = 1; + if($this->request->getRequestMethod() == 'GET') + { + $selectedQuestgroup = $this->request->getGetParam('questgroup'); + $selectedQuestgroup = !empty($selectedQuestgroup) ? $selectedQuestgroup : null; + $selectedQuesttype = $this->request->getGetParam('questtype'); + $selectedQuesttype = !empty($selectedQuesttype) ? $selectedQuesttype : null; + $selectedTitle = $this->request->getGetParam('title'); + $selectedTitle = !empty($selectedTitle) ? $selectedTitle : null; + $page = $this->request->getGetParam('page'); + $page = !empty($page) ? intval($page) : 1; + } + + // Get Quests + $limit = ($all != 'all') ? \nre\configs\AppConfig::$misc['lists_limit'] : null; + $offset = ($all != 'all') ? max((intval($page) - 1), 0) * $limit : 0; + $questsCount = $this->Quests->getCountForQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype, $selectedTitle); + $quests = $this->Quests->getQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype, $selectedTitle, $limit, $offset); + foreach($quests as &$quest) + { + // Get Questtype + $quest['questtype'] = $this->Questtypes->getQuesttypeById($quest['questtype_id']); + } + + // Get filter values + $questgroups = $this->Questgroups->getQuestgroupsForSeminary($seminary['id']); + $questtypes = $this->Questtypes->getQuesttypes(); + + + // Set titile + $this->addTitleLocalized('Quests'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroups', $questgroups); + $this->set('questtypes', $questtypes); + $this->set('selectedQuestgroup', $selectedQuestgroup); + $this->set('selectedQuesttype', $selectedQuesttype); + $this->set('selectedTitle', $selectedTitle); + $this->set('quests', $quests); + $this->set('questsCount', $questsCount); + $this->set('all', $all); + $this->set('page', $page); + $this->set('limit', $limit); + } + + + /** + * Action: quest. + * + * Show a quest and its task. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + * @param string $questtexttypeUrl URL-Title of Questtexttype + * @param int $questtextPos Position of Questtext + */ + public function quest($seminaryUrl, $questgroupUrl, $questUrl, $questtexttypeUrl=null, $questtextPos=1) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['picture'] = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $questgroup['picture'] = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Get Character + $character = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + + // Check permissions + if(count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) == 0) + { + $previousQuests = $this->Quests->getPreviousQuests($quest['id']); + if(count($previousQuests) == 0) + { + // Previous Questgroup + $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($seminary['id'], $questgroup['id']); + if(!is_null($previousQuestgroup) && !$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + else + { + // Previous Quests + // One previous Quest has to be solved and no other + // following Quest of ones has to be tried + // except it is also an previous Quest of the current Quest + $solved = false; + $tried = false; + foreach($previousQuests as &$previousQuest) + { + // Check previous Quest + if($this->Quests->hasCharacterSolvedQuest($previousQuest['id'], $character['id'])) + { + $solved = true; + + // Check following Quests + $followingQuests = $this->Quests->getNextQuests($previousQuest['id']); + foreach($followingQuests as $followingQuest) + { + // Check following Quest + if($followingQuest['id'] != $quest['id'] && $this->Quests->hasCharacterTriedQuest($followingQuest['id'], $character['id'])) + { + $followingFollowingQuests = $this->Quests->getNextQuests($followingQuest['id']); + if(!in_array($quest['id'], array_map(function($q) { return $q['id']; }, $followingFollowingQuests))) + { + $tried = true; + break; + } + } + } + + break; + } + } + if(!$solved || $tried) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + } + + // Set status “entered” + $this->Quests->setQuestEntered($quest['id'], $character['id']); + + // Has Character solved quest? + $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); + + // Get Questtexts + $questtexts = array(); + $questtexts['Prolog'] = $this->Questtexts->getQuesttextsOfQuest($quest['id'], 'Prolog'); + if($solved || count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) > 0) { + $questtexts['Epilog'] = $this->Questtexts->getQuesttextsOfQuest($quest['id'], 'Epilog'); + } + foreach($questtexts as &$questtextList) + { + foreach($questtextList as &$questtext) + { + // Questtext media + if(!is_null($questtext['questsmedia_id'])) { + $questtext['media'] = $this->Media->getSeminaryMediaById($questtext['questsmedia_id']); + } + + // Related Questgroups + $questtext['relatedQuestsgroups'] = $this->Questgroups->getRelatedQuestsgroupsOfQuesttext($questtext['id']); + } + } + + // Quest status + $questStatus = $this->request->getGetParam('status'); + + // Quest media + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Task + $task = null; + $questtype = $this->Questtypes->getQuesttypeById($quest['questtype_id']); + if(!is_null($questtype['classname'])) { + $task = $this->renderTask($questtype['classname'], $seminary, $questgroup, $quest, $character); + } + else + { + // Mark Quest as solved + $this->Quests->setQuestSolved($quest['id'], $character['id']); + $solved = true; + } + + // Get (related) Questtexts + $relatedQuesttexts = $this->Questtexts->getRelatedQuesttextsForQuestgroup($questgroup['id']); + $relatedQuesttext = $this->Questtexts->pickQuesttextLastEnteredByCharacter($character['id'], $relatedQuesttexts); + if(!is_null($relatedQuesttext)) { + $relatedQuesttext['quest'] = $this->Quests->getQuestById($relatedQuesttext['quest_id']); + if(!empty($relatedQuesttext['quest'])) { + $relatedQuesttext['quest']['questgroup_url'] = $this->Questgroups->getQuestgroupById($relatedQuesttext['quest']['questgroup_id'])['url']; + } + } + + // Next Quest/Questgroup + $nextQuests = null; + $charactedHasChoosenNextQuest = false; + $nextQuestgroup = null; + if($solved || count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) > 0) + { + // Next Quest + $nextQuests = $this->Quests->getNextQuests($quest['id']); + foreach($nextQuests as &$nextQuest) + { + // Set entered status of Quest + $nextQuest['entered'] = $this->Quests->hasCharacterEnteredQuest($nextQuest['id'], $character['id']); + if($nextQuest['entered']) { + $charactedHasChoosenNextQuest = true; + } + } + + // Next Questgroup + if(empty($nextQuests)) + { + if(is_null($relatedQuesttext)) + { + $nextQuestgroup = $this->Questgroups->getNextQuestgroup($seminary['id'], $questgroup['id']); + if(!is_null($nextQuestgroup)) { + $nextQuestgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($nextQuestgroup['id']); + } + } + else + { + // Related (Main-) Quest + $nextQuest = $relatedQuesttext['quest']; + $nextQuest['entered'] = true; + $nextQuests = array($nextQuest); + } + } + } + + + // Set titile + $this->addTitle($quest['title']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('questtexts', $questtexts); + $this->set('quest', $quest); + $this->set('queststatus', $questStatus); + $this->set('relatedquesttext', $relatedQuesttext); + $this->set('nextquests', $nextQuests); + $this->set('charactedHasChoosenNextQuest', $charactedHasChoosenNextQuest); + $this->set('nextquestgroup', $nextQuestgroup); + $this->set('task', $task); + $this->set('media', $questmedia); + $this->set('solved', $solved); + } + + + /** + * List Character submissions for a Quest. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + */ + public function submissions($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['picture'] = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $questgroup['picture'] = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Media + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Get submitted Character submissions waiting for approval + $submittedSubmissionCharacters = $this->Characters->getCharactersSubmittedQuest($quest['id']); + + // Get unsolved Character submissions + $unsolvedSubmissionCharacters = $this->Characters->getCharactersUnsolvedQuest($quest['id']); + + // Get solved Character submissions + $solvedSubmissionCharacters = $this->Characters->getCharactersSolvedQuest($quest['id']); + + + // Set titile + $this->addTitleLocalized('Submissions'); + $this->addTitle($quest['title']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('media', $questmedia); + $this->set('submittedSubmissionCharacters', $submittedSubmissionCharacters); + $this->set('unsolvedSubmissionCharacters', $unsolvedSubmissionCharacters); + $this->set('solvedSubmissionCharacters', $solvedSubmissionCharacters); + } + + + /** + * Show and handle the submission of a Character for a Quest. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + * @param string $characterUrl URL-Title of Character + */ + public function submission($seminaryUrl, $questgroupUrl, $questUrl, $characterUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['picture'] = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $questgroup['picture'] = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Character + $character = $this->Characters->getCharacterByUrl($seminary['id'], $characterUrl); + + // Media + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Questtype + $questtype = $this->Questtypes->getQuesttypeById($quest['questtype_id']); + + // Render Questtype output + $output = $this->renderTaskSubmission($questtype['classname'], $seminary, $questgroup, $quest, $character); + + + // Set titile + $this->addTitleLocalized('Submission of %s', $character['name']); + $this->addTitle($quest['title']); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('character', $character); + $this->set('media', $questmedia); + $this->set('output', $output); + } + + + /** + * Action: create. + * + * Create a new Quest. + * + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of Questgroup + */ + public function create($seminaryUrl, $questgroupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + $questgroup['picture'] = (!is_null($questgroup['questgroupspicture_id'])) ? $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']) : null; + + // Get Quest types + $questtypes = $this->Questtypes->getQuesttypes(); + foreach($questtypes as &$questtype) { + $questtype['selected'] = false; + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = ''; + $xps = 0; + $task = ''; + $entryText = ''; + $wrongText = ''; + $fields = array('title', 'xps'); + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Quests->questTitleExists($title, $seminary['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $xps = $this->request->getPostParam('xps'); + $task = $this->request->getPostParam('task'); + $entryText = $this->request->getPostParam('entrytext'); + $wrongText = $this->request->getPostParam('wrongtext'); + + // Validate Questtype + $questtypeIndex = null; + foreach($questtypes as $index => &$questtype) + { + $questtype['selected'] = ($questtype['url'] == $this->request->getPostParam('questtype')); + if($questtype['selected']) { + $questtypeIndex = $index; + } + } + if(is_null($questtypeIndex)) { + throw new \nre\exceptions\ParamsNotValidException($questtype); + } + + // Validate media + $media = null; + if(!empty($_FILES) && array_key_exists('media', $_FILES) && $_FILES['media']['error'] != UPLOAD_ERR_NO_FILE) + { + $media = $_FILES['media']; + + // Check error + if($media['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'error', $media['error']); + } + + // Check mimetype + $mediaMimetype = null; + $media['mimetype'] = \hhu\z\Utils::getMimetype($media['tmp_name'], $media['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $media['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'mimetype', $media['mimetype']); + } + elseif($media['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'size', $mediaMimetype['size']); + } + } + + // Create new Quest + if($validation === true) + { + $questId = $this->Quests->createQuest( + $this->Auth->getUserId(), + $questgroup['id'], + $questtypes[$questtypeIndex]['id'], + $title, + $xps, + $task, + $entryText, + $wrongText + ); + $quest = $this->Quests->getQuestById($questId); + + // Update picture + if(!is_null($media)) + { + $questsmediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + $media['name'], + $title, + $media['type'], + $media['tmp_name'] + ); + if($questsmediaId > 0) { + $this->Quests->setQuestmedia($quest['id'], $questsmediaId); + } + } + + // Redirect + $this->redirect($this->linker->link(array('quest', $seminary['url'], $questgroup['url'], $quest['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Create Quest'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('mimetypes', $mimetypes); + $this->set('questtypes', $questtypes); + $this->set('title', $title); + $this->set('task', $task); + $this->set('entryText', $entryText); + $this->set('wrongText', $wrongText); + $this->set('xps', $xps); + $this->set('questtype_id', $questtype); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a Quest of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + */ + public function edit($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + $questgroup['picture'] = (!is_null($questgroup['questgroupspicture_id'])) ? $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']) : null; + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + $quest['type'] = $this->Questtypes->getQuesttypeById($quest['questtype_id']); + + // Get Quest media + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Get Quest types + $questtypes = $this->Questtypes->getQuesttypes(); + foreach($questtypes as &$questtype) { + $questtype['selected'] = ($questtype['id'] == $quest['questtype_id']); + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = $quest['title']; + $xps = $quest['xps']; + $task = $quest['task']; + $entryText = $quest['entry_text']; + $wrongText = $quest['wrong_text']; + $fields = array('title', 'xps'); + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && (!is_null($this->request->getPostParam('edit')) || !is_null($this->request->getPostParam('edit-task')))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Quests->questTitleExists($title, $seminary['id'], $quest['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $xps = $this->request->getPostParam('xps'); + $task = $this->request->getPostParam('task'); + $entryText = $this->request->getPostParam('entrytext'); + $wrongText = $this->request->getPostParam('wrongtext'); + + // Validate Questtype + $questtypeIndex = null; + foreach($questtypes as $index => &$questtype) + { + $questtype['selected'] = ($questtype['url'] == $this->request->getPostParam('questtype')); + if($questtype['selected']) { + $questtypeIndex = $index; + } + } + if(is_null($questtypeIndex)) { + throw new \nre\exceptions\ParamsNotValidException($questtype); + } + + // Validate media + $media = null; + if(!empty($_FILES) && array_key_exists('media', $_FILES) && $_FILES['media']['error'] != UPLOAD_ERR_NO_FILE) + { + $media = $_FILES['media']; + + // Check error + if($media['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'error', $media['error']); + } + + // Check mimetype + $mediaMimetype = null; + $media['mimetype'] = \hhu\z\Utils::getMimetype($media['tmp_name'], $media['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $media['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'mimetype', $media['mimetype']); + } + elseif($media['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'size', $mediaMimetype['size']); + } + } + + // Edit Quest + if($validation === true) + { + $this->Quests->editQuest( + $quest['id'], + $questtypes[$questtypeIndex]['id'], + $title, + $xps, + $task, + $entryText, + $wrongText + ); + $quest = $this->Quests->getQuestById($quest['id']); + + // Update picture + if(!is_null($media)) + { + $questsmediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + $media['name'], + $title, + $media['type'], + $media['tmp_name'] + ); + if($questsmediaId > 0) { + $this->Quests->setQuestmedia($quest['id'], $questsmediaId); + } + } + + // Redirect + if(!is_null($this->request->getPostParam('edit-task'))) { + // To task editing + $this->redirect($this->linker->link(array('edittask', $seminary['url'], $questgroup['url'], $quest['url']), 1)); + } + else { + // To entry + $this->redirect($this->linker->link(array('quest', $seminary['url'], $questgroup['url'], $quest['url']), 1)); + } + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Edit Quest'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('media', $questmedia); + $this->set('mimetypes', $mimetypes); + $this->set('questtypes', $questtypes); + $this->set('title', $title); + $this->set('task', $task); + $this->set('entryText', $entryText); + $this->set('wrongText', $wrongText); + $this->set('xps', $xps); + $this->set('questtype_id', $questtype); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edittask. + * + * Edit the task of a Quest of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + */ + public function edittask($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + $questgroup['picture'] = (!is_null($questgroup['questgroupspicture_id'])) ? $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']) : null; + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Get Quest media + $questmedia = null; + if(!is_null($quest['questsmedia_id'])) { + $questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']); + } + + // Render editing task + $task = null; + $questtype = $this->Questtypes->getQuesttypeById($quest['questtype_id']); + if(!is_null($questtype['classname'])) { + $task = $this->renderTaskEditing($questtype['classname'], $seminary, $questgroup, $quest); + } + + + // Set titile + $this->addTitleLocalized('Edit Quest task'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('media', $questmedia); + $this->set('task', $task); + } + + + /** + * Action: edittexts. + * + * Edit the texts of a Quest of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + */ + public function edittexts($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroup['id']); + $questgroup['picture'] = (!is_null($questgroup['questgroupspicture_id'])) ? $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']) : null; + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Get Questtexts + $questtextTypes = $this->Questtexts->getQuesttexttypes(); + foreach($questtextTypes as &$questtextType) + { + $questtextType['texts'] = $this->Questtexts->getQuesttextsOfQuest($quest['id'], $questtextType['url']); + foreach($questtextType['texts'] as &$questtext) + { + if(!is_null($questtext['questsmedia_id'])) { + $questtext['media'] = $this->Media->getSeminaryMediaById($questtext['questsmedia_id']); + } + } + } + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Check request method + $validations = array(); + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + $media = $_FILES['media']; + $texts = $this->request->getPostParam('questtexts'); + $deleteTexts = $this->request->getPostParam('deletes'); + if(!is_array($deleteTexts)) { + $deleteTexts = array(); + } + + foreach($questtextTypes as &$type) + { + // Edit or delete texts + if(!array_key_exists($type['url'], $texts)) { + continue; + } + foreach($type['texts'] as &$text) + { + if(array_key_exists($type['url'], $deleteTexts) && array_key_exists($text['id'], $deleteTexts[$type['url']])) + { + // Delete text + $this->Questtexts->deleteQuesttext($text); + //unset($texts[$type['url']][$text['id']]); + } + elseif(array_key_exists($type['url'], $texts) && array_key_exists($text['id'], $texts[$type['url']])) + { + // Edit text + $this->Questtexts->editQuesttext($text['id'], $texts[$type['url']][$text['id']]); + + // Validate medium + $medium = null; + $validation = true; + if(!empty($media) && array_key_exists($type['url'], $media['error']) && array_key_exists($text['id'], $media['error'][$type['url']]) && $media['error'][$type['url']][$text['id']] != UPLOAD_ERR_NO_FILE) + { + $medium = array( + 'name' => $media['name'][$type['url']][$text['id']], + 'tmp_name' => $media['tmp_name'][$type['url']][$text['id']], + 'type' => $media['type'][$type['url']][$text['id']], + 'size' => $media['size'][$type['url']][$text['id']], + 'error' => $media['error'][$type['url']][$text['id']] + ); + + // Check error + if($medium['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'error', $medium); + } + + // Check mimetype + $mediaMimetype = null; + $medium['mimetype'] = \hhu\z\Utils::getMimetype($medium['tmp_name'], $medium['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $medium['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'mimetype', $medium['mimetype']); + } + elseif($medium['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'size', $mediaMimetype['size']); + } + } + $validations[$type['url']][$text['id']] = $validation; + + // Upload medium + if(!is_null($medium) && $validation === true) + { + $questsmediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('questtext-%d-%d', $quest['id'], $text['id']), + $medium['name'], + $medium['type'], + $medium['tmp_name'] + ); + if($questsmediaId > 0) { + $this->Questtexts->setQuestmedia($text['id'], $questsmediaId); + } + } + + // Remove text from list + //unset($texts[$type['url']][$text['id']]); + } + } + + // Add new text + if(array_key_exists($type['url'], $texts) && array_key_exists('new', $texts[$type['url']])) + { + $text = $texts[$type['url']]['new']; + if(!empty($text)) + { + // Add text + $questtextId = $this->Questtexts->addQuesttextToQuest( + $this->Auth->getUserId(), + $quest['id'], + $type['url'], + $text + ); + + // Validate medium + $medium = null; + $validation = true; + if(!empty($media) && array_key_exists($type['url'], $media['error']) && array_key_exists('new', $media['error'][$type['url']]) && $media['error'][$type['url']]['new'] != UPLOAD_ERR_NO_FILE) + { + $medium = array( + 'name' => $media['name'][$type['url']]['new'], + 'tmp_name' => $media['tmp_name'][$type['url']]['new'], + 'type' => $media['type'][$type['url']]['new'], + 'size' => $media['size'][$type['url']]['new'], + 'error' => $media['error'][$type['url']]['new'] + ); + + // Check error + if($medium['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'error', $medium); + } + + // Check mimetype + $mediaMimetype = null; + $medium['mimetype'] = \hhu\z\Utils::getMimetype($medium['tmp_name'], $medium['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $medium['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'mimetype', $medium['mimetype']); + } + elseif($medium['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'media', 'size', $mediaMimetype['size']); + } + } + $validations[$type['url']]['new'] = $validation; + + // Upload medium + if(!is_null($medium) && $validation === true) + { + $questsmediaId = $this->Media->createQuestMedia( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('questtext-%d-%d', $quest['id'], $questtextId), + $medium['name'], + $medium['type'], + $medium['tmp_name'] + ); + if($questsmediaId > 0) { + $this->Questtexts->setQuestmedia($questtextId, $questsmediaId); + } + } + } + } + + // Reload texts + $type['texts'] = $this->Questtexts->getQuesttextsOfQuest($quest['id'], $type['url']); + foreach($type['texts'] as &$questtext) + { + if(!is_null($questtext['questsmedia_id'])) { + $questtext['media'] = $this->Media->getSeminaryMediaById($questtext['questsmedia_id']); + } + } + } + } + + + // Set titile + $this->addTitleLocalized('Edit Quest texts'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + $this->set('questtexttypes', $questtextTypes); + $this->set('mimetypes', $mimetypes); + $this->set('validations', $validations); + } + + + + /** + * Action: delete. + * + * Delete a Quest of a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of Seminary + * @param string $questgroupUrl URL-Title of Questgroup + * @param string $questUrl URL-Title of Quest + */ + public function delete($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + $questgroup['picture'] = null; + if(!is_null($questgroup['questgroupspicture_id'])) { + $questgroup['picture'] = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Quests->deleteQuest($quest['id']); + + // Redirect to Questgroup + $this->redirect($this->linker->link(array('questgroups', 'questgroup', $seminary['url'], $questgroup['url']))); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('seminary', $seminary['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete Quest'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + } + + + + + /** + * Render and handle the task of a Quest. + * + * @param string $questtypeClassname Name of the class for the Questtype of a Quest + * @param array $seminary Seminary data + * @param array $questgroup Questgroup data + * @param array $quest Quest data + * @param array $character Character data + * @return string Rendered output + */ + private function renderTask($questtypeClassname, $seminary, $questgroup, $quest, $character) + { + $task = null; + try { + // Generate request and response + $request = clone $this->request; + $response = $this->createQuesttypeResponse('quest', $seminary, $questgroup, $quest, $character); + + // Load Questtype Agent + $questtypeAgent = $this->loadQuesttypeAgent($questtypeClassname, $request, $response); + + // Solve Quest + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('submit'))) + { + // Get user answers + $answers = $this->request->getPostParam('answers'); + + // Save answers in database + try { + if(!$this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id'])) { + $questtypeAgent->saveAnswersOfCharacter($seminary, $questgroup, $quest, $character, $answers); + } + + // Match answers with correct ones + $status = $questtypeAgent->matchAnswersofCharacter($seminary, $questgroup, $quest, $character, $answers); + if($status === true) + { + // Mark Quest as solved + $this->Quests->setQuestSolved($quest['id'], $character['id']); + + // Notify of XP-level change + $newXPLevel = $this->Xplevels->getXPLevelById($character['xplevel_id']); + if($newXPLevel['level'] > $character['xplevel']) { + $this->Notification->addNotification( + \hhu\z\controllers\components\NotificationComponent::TYPE_LEVELUP, + $newXPLevel['level'], + $this->linker->link(array('characters', 'character', $seminary['url'], $character['url'])) + ); + } + + // Redirect + $this->redirect($this->linker->link(array(), 5, true, array('status'=>'solved'), false, 'task')); + } + elseif($status === false) + { + // Mark Quest as unsolved + $this->Quests->setQuestUnsolved($quest['id'], $character['id']); + + // Redirect + $this->redirect($this->linker->link(array(), 5, true, array('status'=>'unsolved'), false, 'task')); + } + else { + // Mark Quest as submitted + $this->Quests->setQuestSubmitted($quest['id'], $character['id']); + + // Send notification mail + $this->sendSubmissionMail($seminary, $questgroup, $quest, $character); + + // Redirect + $this->redirect($this->linker->link(array(), 5, true, null, false, 'task')); + } + } + catch(\hhu\z\exceptions\SubmissionNotValidException $e) { + $response->addParam($e); + } + } + + // Render Task + $task = $this->runQuesttypeAgent($questtypeAgent, $request, $response); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotFoundException $e) { + $task = $e->getMessage(); + } + + + // Return rendered output + return $task; + } + + + /** + * Render and handle a Character submission for a Quest. + * + * @param string $questtypeClassname Name of the class for the Questtype of a Quest + * @param array $seminary Seminary data + * @param array $questgroup Questgroup data + * @param array $quest Quest data + * @param array $character Character data + * @return string Rendered output + */ + private function renderTaskSubmission($questtypeClassname, $seminary, $questgroup, $quest, $character) + { + $task = null; + try { + // Generate request and response + $request = clone $this->request; + $response = $this->createQuesttypeResponse('submission', $seminary, $questgroup, $quest, $character); + + // Load Questtype Agent + $questtypeAgent = $this->loadQuesttypeAgent($questtypeClassname, $request, $response); + + // Solve Quest + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('submit'))) + { + // Set status + if($this->request->getPostParam('submit') == _('solved')) + { + // Mark Quest as solved + $this->Quests->setQuestSolved($quest['id'], $character['id']); + } + else + { + // Mark Quest as unsolved + $this->Quests->setQuestUnsolved($quest['id'], $character['id']); + } + + // Save additional data for Character answers + $questtypeAgent->controller->saveDataForCharacterAnswers($seminary, $questgroup, $quest, $character, $this->request->getPostParam('characterdata')); + + // Send notification + $this->sendSubmissionApprovedMail($character, $seminary, $questgroup, $quest); + + // Redirect + $this->redirect($this->linker->link(array('submissions', $seminary['url'], $questgroup['url'], $quest['url']), 1)); + } + + // Render task submissions + $task = $this->runQuesttypeAgent($questtypeAgent, $request, $response); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotFoundException $e) { + $task = $e->getMessage(); + } + + + // Return rendered output + return $task; + } + + + /** + * Render editing of a Quest. + * + * @param string $questtypeClassname Name of the class for the Questtype of a Quest + * @param array $seminary Seminary data + * @param array $questgroup Questgroup data + * @param array $quest Quest data + * @return string Rendered output + */ + private function renderTaskEditing($questtypeClassname, $seminary, $questgroup, $quest) + { + $task = null; + try { + // Generate request and response + $request = clone $this->request; + $response = $this->createQuesttypeResponse('edittask', $seminary, $questgroup, $quest); + + // Load Questtype Agent + $questtypeAgent = $this->loadQuesttypeAgent($questtypeClassname, $request, $response); + + // Render Task + $task = $this->runQuesttypeAgent($questtypeAgent, $request, $response); + } + catch(\nre\exceptions\ViewNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\nre\exceptions\ActionNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeModelNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeControllerNotFoundException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotValidException $e) { + $task = $e->getMessage(); + } + catch(\hhu\z\exceptions\QuesttypeAgentNotFoundException $e) { + $task = $e->getMessage(); + } + + + // Return rendered output + return $task; + } + + + /** + * Create a response for the Questtype rendering. + * + * @param string $action Action to run + * @param mixed $param Additional parameters to add to the response + * @return \nre\core\Response Generated response + */ + private function createQuesttypeResponse($action, $param1) + { + // Clone current response + $response = clone $this->response; + // Clear parameters + $response->clearParams(1); + + // Add Action + $response->addParams( + null, + $action + ); + + // Add additional parameters + foreach(array_slice(func_get_args(), 1) as $param) { + $response->addParam($param); + } + + + // Return response + return $response; + } + + + /** + * Load and construct the QuesttypeAgent for a Questtype. + * + * @param string $questtypeClassname Name of the class for the Questtype of a Quest + * @param \nre\core\Request $request Request + * @param \nre\core\Response $response Response + * @return \hhu\z\agents\QuesttypeAgent Questtype Agent + */ + private function loadQuesttypeAgent($questtypeClassname, $request, $response) + { + // Load Agent + \hhu\z\agents\QuesttypeAgent::load($questtypeClassname); + + + // Construct and return Agent + return \hhu\z\agents\QuesttypeAgent::factory($questtypeClassname, $request, $response); + } + + + /** + * Run and render the Agent for a QuesttypeAgent and return ist output. + * + * @param \nre\core\Agent $questtypeAgent QuesttypeAgent to run and render + * @param \nre\core\Request $request Request + * @param \nre\core\Response $response Response + * @return string Rendered output + */ + private function runQuesttypeAgent($questtypeAgent, $request, $response) + { + // Run Agent + $questtypeAgent->run($request, $response); + + + // Render and return output + return $questtypeAgent->render(); + } + + + /** + * Send mail for new Character submission. + * + * @param array $seminary Seminary which the Quest belongs to + * @param array $questgroup Questgroup of Quest + * @param array $quest Quest the answer has been submitted for + * @param array $character Character that send the submission + */ + private function sendSubmissionMail($seminary, $questgroup, $quest, $character) + { + // Get system moderators + $moderators = $this->Characters->getCharactersWithCharacterRole($seminary['id'], 'moderator'); + + // Send notification mail + try { + foreach($moderators as &$moderator) + { + $user = $this->Users->getUserById($moderator['user_id']); + if($user['mailing']) { + \hhu\z\Utils::sendMail( + $user['email'], + 'charactersubmission', + true, + array( + $user, + $seminary, + $questgroup, + $quest, + $character + ), + $this->linker + ); + } + } + } + catch(\hhu\z\exceptions\MailingException $e) { + $this->log($e->getMessage()); + } + } + + + /** + * Send mail for approval of a Character submission. + * + * @param array $character Character of submission that has been approved + * @param array $seminary Seminary which the Quest belongs to + * @param array $questgroup Questgroup of Quest + * @param array $quest Quest the submission has been approved for + */ + private function sendSubmissionApprovedMail($character, $seminary, $questgroup, $quest) + { + // Get user + $user = $this->Users->getUserById($character['user_id']); + if(!$user['mailing']) { + return; + } + + // Send notification mail + try { + \hhu\z\Utils::sendMail( + $user['email'], + 'charactersubmissionapproved', + true, + array( + $user, + $seminary, + $questgroup, + $quest + ), + $this->linker + ); + } + catch(\hhu\z\exceptions\MailingException $e) { + $this->log($e->getMessage()); + } + } + + } + +?> diff --git a/controllers/SeminariesController.inc b/controllers/SeminariesController.inc new file mode 100644 index 00000000..3be361a5 --- /dev/null +++ b/controllers/SeminariesController.inc @@ -0,0 +1,601 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to list registered seminaries. + * + * @author Oliver Hanraths + */ + class SeminariesController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('users', 'seminaries', 'characterroles', 'charactertypes', 'xplevels', 'questgroupshierarchy', 'questgroups', 'questgrouptexts', 'quests', 'questtexts', 'media'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator', 'user'), + 'seminary' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator', 'user'), + 'copy' => array('admin', 'moderator', 'user'), + 'delete' => array('admin', 'moderator', 'user'), + 'calculatexps' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'seminary' => array('admin', 'moderator', 'user', 'guest'), + 'edit' => array('admin'), + 'copy' => array('admin'), + 'delete' => array('admin'), + 'calculatexps' => array('admin', 'moderator') + ); + + + + + /** + * Action: index. + * + * List registered seminaries. + */ + public function index() + { + // Get seminaries + $seminaries = $this->Seminaries->getSeminaries(); + + // Get additional data + foreach($seminaries as &$seminary) + { + $description = \hhu\z\Utils::shortenString($seminary['description'], 100, 120); + $seminary['description'] = $description.(strlen($description) < strlen($seminary['description']) ? ' …' : null); + $seminary['creator'] = $this->Users->getUserById($seminary['created_user_id']); + $seminary['charactertypes'] = $this->Charactertypes->getCharacterTypesForSeminary($seminary['id']); + $seminary['xplevels'] = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + + // Character of currently logged-in user + try { + $seminary['usercharacter'] = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + $seminary['usercharacter']['characterroles'] = $this->Characterroles->getCharacterrolesForCharacterById($seminary['usercharacter']['id']); + $seminary['xps'] = $this->Seminaries->getTotalXPs($seminary['id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + } + + } + + + // Set titile + $this->addTitleLocalized('Seminaries'); + + // Pass data to view + $this->set('seminaries', $seminaries); + } + + + /** + * Action: seminary. + * + * Show a seminary and its details. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a seminary + */ + public function seminary($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Created user + $seminary['creator'] = $this->Users->getUserById($seminary['created_user_id']); + + // Get Character + $character = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + + // Questgrouphierarchy and Questgroups + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyOfSeminary($seminary['id']); + foreach($questgroupshierarchy as &$hierarchy) + { + // Get Questgroups + $hierarchy['questgroups'] = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id']); + + // Get additional data + foreach($hierarchy['questgroups'] as $i => &$questgroup) + { + // Check permission of Questgroups + if($i >= 1 && count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) == 0) + { + if(!$this->Questgroups->hasCharacterSolvedQuestgroup($hierarchy['questgroups'][$i-1]['id'], $character['id'])) + { + $hierarchy['questgroups'] = array_slice($hierarchy['questgroups'], 0, $i); + break; + } + } + + // Get first Questgroup text + $text = $this->getFirstQuestgroupText($questgroup['id']); + if(!is_null($text)) + { + $questgroup['text'] = \hhu\z\Utils::shortenString($text, 100, 120).' …'; + } + + // Get Character XPs + $questgroup['character_xps'] = $this->Questgroups->getAchievedXPsForQuestgroup($questgroup['id'], $character['id']); + + // Get Media + $questgroup['picture'] = null; + try { + $questgroup['picture'] = $this->Media->getSeminaryMediaById($questgroup['questgroupspicture_id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + } + } + } + + + // Set titile + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroupshierarchy', $questgroupshierarchy); + } + + + /** + * Action: create. + * + * Create a new Seminary. + */ + public function create() + { + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = ''; + $course = ''; + $description = ''; + $fields = array('title', 'course'); + $validation = array(); + + // Create a new Seminary + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Seminaries->seminaryTitleExists($title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $course = $this->request->getPostParam('course'); + $description = $this->request->getPostParam('description'); + + // Validate moodpic + $moodpic = null; + if(!empty($_FILES) && array_key_exists('moodpic', $_FILES) && $_FILES['moodpic']['error'] != UPLOAD_ERR_NO_FILE) + { + $moodpic = $_FILES['moodpic']; + + // Check error + if($moodpic['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'error', $moodpic['error']); + } + + // Check mimetype + $mediaMimetype = null; + $moodpic['mimetype'] = \hhu\z\Utils::getMimetype($moodpic['tmp_name'], $moodpic['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $moodpic['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'mimetype', $moodpic['mimetype']); + } + elseif($moodpic['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'size', $mediaMimetype['size']); + } + } + + // Create new Seminary + if($validation === true) + { + $seminaryId = $this->Seminaries->createSeminary( + $this->Auth->getUserId(), + $title, + $course, + $description + ); + $seminary = $this->Seminaries->getSeminaryById($seminaryId); + + // Upload moodpic + if(!is_null($moodpic)) + { + $mediaId = $this->Media->createMoodpic( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('seminarymoodpic-%s', $seminary['url']), + '', + $moodpic['mimetype'], + $moodpic['tmp_name'] + ); + if($mediaId !== false) { + $this->Seminaries->setMoodpicForSeminary($seminary['id'], $mediaId); + } + } + + // Redirect to Seminary overview + $this->redirect($this->linker->link('index', 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('New seminary'); + + // Pass data to view + $this->set('title', $title); + $this->set('course', $course); + $this->set('description', $description); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a seminary + */ + public function edit($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get allowed mimetypes + $mimetypes = \nre\configs\AppConfig::$mimetypes['moodpics']; + + // Values + $title = $seminary['title']; + $course = $seminary['course']; + $description = $seminary['description']; + $fields = array('title', 'course'); + $validation = array(); + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Seminaries->seminaryTitleExists($title, $seminary['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $course = $this->request->getPostParam('course'); + $description = $this->request->getPostParam('description'); + + // Validate moodpic + $moodpic = null; + if(!empty($_FILES) && array_key_exists('moodpic', $_FILES) && $_FILES['moodpic']['error'] != UPLOAD_ERR_NO_FILE) + { + $moodpic = $_FILES['moodpic']; + + // Check error + if($moodpic['error'] !== UPLOAD_ERR_OK) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'error', $moodpic['error']); + } + + // Check mimetype + $mediaMimetype = null; + $moodpic['mimetype'] = \hhu\z\Utils::getMimetype($moodpic['tmp_name'], $moodpic['type']); + foreach($mimetypes as &$mimetype) { + if($mimetype['mimetype'] == $moodpic['mimetype']) { + $mediaMimetype = $mimetype; + break; + } + } + if(is_null($mediaMimetype)) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'mimetype', $moodpic['mimetype']); + } + elseif($moodpic['size'] > $mediaMimetype['size']) { + $validation = $this->Validation->addValidationResult($validation, 'moodpic', 'size', $mediaMimetype['size']); + } + } + + // Edit Seminary + if($validation === true) + { + $this->Seminaries->editSeminary( + $seminary['id'], + $title, + $course, + $description + ); + $seminary = $this->Seminaries->getSeminaryById($seminary['id']); + + // Update moodpic + if(!is_null($moodpic)) + { + $mediaId = $this->Media->createMoodpic( + $this->Auth->getUserId(), + $seminary['id'], + sprintf('seminarymoodpic-%s', $seminary['url']), + '', + $moodpic['mimetype'], + $moodpic['tmp_name'] + ); + if($mediaId !== false) { + $this->Seminaries->setMoodpicForSeminary($seminary['id'], $mediaId); + } + } + + // Redirect to entry + $this->redirect($this->linker->link(array('seminary', $seminary['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Edit seminary'); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('title', $title); + $this->set('course', $course); + $this->set('description', $description); + $this->set('mimetypes', $mimetypes); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Copy a Seminary and selected content. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a seminary + */ + public function copy($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Values + $title = sprintf('%s (%s)', $seminary['title'], _('Copy')); + $course = $seminary['course']; + $description = $seminary['description']; + $elements = array(); + $fields = array('title', 'course'); + $validation = array(); + $exception = null; + + // Check request method + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('edit'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $title = $this->request->getPostParam('title'); + if($this->Seminaries->seminaryTitleExists($title)) { + $validation = $this->Validation->addValidationResult($validation, 'title', 'exist', true); + } + $course = $this->request->getPostParam('course'); + $description = $this->request->getPostParam('description'); + $elements = $this->request->getPostParam('elements'); + if(!is_array($elements)) { + $elements = array(); + } + + // Copy Seminary + if($validation === true) + { + try { + $seminaryId = $this->Seminaries->copySeminary( + $this->Auth->getUserId(), + $seminary['id'], + $title, + $course, + $description, + array_key_exists('seminaryfields', $elements), + array_key_exists('media', $elements), + array_key_exists('questgroupshierarchy', $elements), + array_key_exists('questgroups', $elements), + array_key_exists('quests', $elements), + array_key_exists('questtopics', $elements), + array_key_exists('charactertypes', $elements), + array_key_exists('xplevels', $elements), + array_key_exists('avatars', $elements), + array_key_exists('achievements', $elements), + array_key_exists('charactergroupsgroups', $elements), + array_key_exists('charactergroupsquests', $elements) + ); + $seminary = $this->Seminaries->getSeminaryById($seminaryId); + + // Redirect to overview + $this->redirect($this->linker->link('index', 1)); + } + catch(\hhu\z\exceptions\QuesttypeModelNotValidException $e) { + $exception = $e; + } + catch(\hhu\z\exceptions\QuesttypeModelNotFoundException $e) { + $exception = $e; + } + catch(\hhu\z\exceptions\FileCopyException $e) { + $exception = $e; + } + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('title', $title); + $this->set('course', $course); + $this->set('description', $description); + $this->set('elements', $elements); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + $this->set('exception', $exception); + } + + + /** + * Action: delete. + * + * Delete a seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a seminary + */ + public function delete($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete seminary + $this->Seminaries->deleteSeminary($seminary['id']); + + // Redirect to overview + $this->redirect($this->linker->link(null, 1)); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('seminary', $seminary['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete seminary'); + + // Show confirmation + $this->set('seminary', $seminary); + } + + + /** + * Action: calculatexps. + * + * (Re-) Calculate the amount of achievable XPs for a Seminary. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function calculatexps($seminaryUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // (Re-) Calculate XPs + $this->Seminaries->calculateXPsForSeminary($seminary['id']); + + // Redirect to Questgroup + $this->redirect($this->linker->link(array('seminary', $seminary['url']), 1)); + } + + + + + /** + * Get the first text of a Questgroup. + * + * @param int $questgroupId ID of a Questgroup + * @return string First text of this Questgroup or NULL + */ + private function getFirstQuestgroupText($questgroupId) + { + // Text of Questgroup itself + $questgroupTexts = $this->Questgrouptexts->getQuestgroupTexts($questgroupId); + if(!empty($questgroupTexts)) { + return $questgroupTexts[0]['text']; + } + + // Text of first Quest + $quest = $this->Quests->getFirstQuestOfQuestgroup($questgroupId); + if(!is_null($quest)) + { + $questText = $this->Questtexts->getFirstQuestText($quest['id']); + if(!is_null($questText)) { + return $questText; + } + } + + // Text of ChildQuestgroups + $questgroupHierarchy = $this->Questgroupshierarchy->getHierarchyForQuestgroup($questgroupId); + $childQuestgroupshierarchy = $this->Questgroupshierarchy->getChildQuestgroupshierarchy($questgroupHierarchy['id']); + foreach($childQuestgroupshierarchy as &$hierarchy) + { + // Get Questgroups + $questgroups = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id'], $questgroupId); + foreach($questgroups as &$group) + { + $childQuestgroupText = $this->getFirstQuestgroupText($group['id']); + if(!is_null($childQuestgroupText)) { + return $childQuestgroupText; + } + } + } + + + // No text found + return null; + } + + } + +?> diff --git a/controllers/SeminarybarController.inc b/controllers/SeminarybarController.inc new file mode 100644 index 00000000..00e7ee70 --- /dev/null +++ b/controllers/SeminarybarController.inc @@ -0,0 +1,89 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to display a sidebar with Seminary related + * information. + * + * @author Oliver Hanraths + */ + class SeminarybarController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('characters', 'quests', 'questgroups', 'achievements', 'charactergroups', 'avatars', 'media', 'xplevels'); + + + + + /** + * Action: index. + */ + public function index() + { + // Do not render at first + $this->set('render', false); + + // Get Seminary + $seminary = SeminaryController::$seminary; + if(is_null($seminary)) { + return; + } + + // Get Character + $character = SeminaryController::$character; + if(is_null($character)) { + return; + } + $character['rank'] = $this->Characters->getXPRank($seminary['id'], $character['xps']); + + // Get “last” Quest + $lastQuest = $this->Quests->getLastQuestForCharacter($character['id']); + if(!is_null($lastQuest)) { + $lastQuest['questgroup'] = $this->Questgroups->getQuestgroupById($lastQuest['questgroup_id']); + } + + // Get last achieved Achievement + $achievements = $this->Achievements->getAchievedAchievementsForCharacter($character['id'], false); + $lastAchievement = array_shift($achievements); + + // Get Character group members + $characterGroups = array(); + foreach($this->Charactergroups->getGroupsForCharacter($character['id']) as $group) + { + $groupsgroup = $this->Charactergroups->getGroupsgroupById($group['charactergroupsgroup_id']); + if($groupsgroup['preferred']) + { + $group['members'] = $this->Characters->getCharactersForGroup($group['id']); + $characterGroups[] = $group; + } + } + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('character', $character); + $this->set('lastQuest', $lastQuest); + $this->set('lastAchievement', $lastAchievement); + $this->set('characterGroups', $characterGroups); + // Render now + $this->set('render', true); + } + + } + +?> diff --git a/controllers/SeminarymenuController.inc b/controllers/SeminarymenuController.inc new file mode 100644 index 00000000..ff9d34d5 --- /dev/null +++ b/controllers/SeminarymenuController.inc @@ -0,0 +1,53 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to display a menu with Seminary related + * links. + * + * @author Oliver Hanraths + */ + class SeminarymenuController extends \hhu\z\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set userdata + $this->set('loggedUser', \hhu\z\controllers\IntermediateController::$user); + $this->set('loggedSeminary', \hhu\z\controllers\SeminaryController::$seminary); + $this->set('loggedCharacter', \hhu\z\controllers\SeminaryController::$character); + } + + + /** + * Action: index. + */ + public function index() + { + } + + } + +?> diff --git a/controllers/TextmailController.inc b/controllers/TextmailController.inc new file mode 100644 index 00000000..d6b28068 --- /dev/null +++ b/controllers/TextmailController.inc @@ -0,0 +1,55 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the TextmailAgent for generating a simple text-mail + * message. + * + * @author Oliver Hanraths + */ + class TextmailController extends \nre\core\Controller + { + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + + // Set linker + $this->set('linker', ($request instanceof \hhu\z\requests\MailRequest && !is_null($request->getLinker())) ? $request->getLinker() : null); + } + + + /** + * Action: index. + * + * Create simple text-mail message. + */ + public function index() + { + $this->set('appname', \nre\configs\AppConfig::$app['name']); + } + + } + +?> diff --git a/controllers/UploadsController.inc b/controllers/UploadsController.inc new file mode 100644 index 00000000..eb208b4d --- /dev/null +++ b/controllers/UploadsController.inc @@ -0,0 +1,318 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the UploadsAgent to process and show user uploads. + * + * @author Oliver Hanraths + */ + class UploadsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required models + * + * @var array + */ + public $models = array('uploads', 'users', 'userroles', 'characterroles', 'seminaries', 'charactergroups'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'seminary' => array('admin', 'moderator', 'user', 'guest'), + 'charactergroup' => array('admin', 'moderator', 'user', 'guest') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'seminary' => array('admin', 'moderator', 'user', 'guest'), + 'charactergroup' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Prefilter. + * + * @param \nre\core\Request $request Current request + * @param \nre\core\Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + // Set headers for caching control + $response->addHeader("Pragma: public"); + $response->addHeader("Cache-control: public, max-age=".(60*60*24)); + $response->addHeader("Expires: ".gmdate('r', time()+(60*60*24))); + $response->addHeader("Date: ".gmdate(\DateTime::RFC822)); + } + + + /** + * Action: seminary. + * + * Display a Seminary upload. + * + * @throws \nre\exceptions\AccessDeniedException + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-title of Seminary + * @param string $uploadUrl URL-name of the upload + * @param string $action Current action (optional) + */ + public function seminary($seminaryUrl, $uploadUrl, $action=null) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Upload + $upload = $this->Uploads->getSeminaryuploadByUrl($seminary['id'], $uploadUrl); + + // Check permissions + if(!$upload['public']) + { + $user = $this->Users->getUserById($this->Auth->getUserId()); + $user['roles'] = array_map(function($r) { return $r['name']; }, $this->Userroles->getUserrolesForUserById($user['id'])); + + // System roles + if(count(array_intersect(array('admin', 'moderator'), $user['roles'])) == 0) + { + // Owner of file + if($upload['created_user_id'] != $user['id']) + { + // Seminary permissions + $characterRoles = array_map(function($r) { return $r['name']; }, $this->Characterroles->getCharacterrolesForCharacterById($character['id'])); + if(count(array_intersect(array('admin', 'moderator'), $characterRoles)) == 0) { + throw new \nre\exceptions\AccessDeniedException(); + } + } + } + } + + // Get file + switch($action) + { + case null: + $file = $this->getUploadFile($upload); + break; + case 'thumbnail': + $file = $this->createThumbnail($upload); + break; + default: + throw new \nre\exceptions\ParamsNotValidException($action); + break; + } + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('upload', $upload); + $this->set('file', $file); + } + + + /** + * Action: charactergroup. + * + * Display the icon of a Character group. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $groupsgroupUrl URL-Title of a Character groups-group + * @param string $groupUrl URL-Title of a Character group + */ + public function charactergroup($seminaryUrl, $groupsgroupUrl, $groupUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Character groups-group + $groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl); + + // Get Character group + $group = $this->Charactergroups->getGroupByUrl($groupsgroup['id'], $groupUrl); + + // Get Upload + $upload = $this->Uploads->getSeminaryuploadById($group['seminaryupload_id']); + + // Get file + $file = $this->getUploadFile($upload); + if(is_null($file)) { + return; + } + + + // Pass data to view + $this->set('upload', $upload); + $this->set('file', $file); + } + + + + + /** + * Determine the file for an upload. + * + * @throws \nre\exceptions\IdNotFoundException + * @param array $upload Upload to get file for + * @return object File for the upload (or null if upload is cached) + */ + private function getUploadFile($upload) + { + // Set content-type + $this->response->addHeader("Content-type: ".$upload['mimetype'].""); + + // Set filename + $upload['filename'] = ROOT.DS.\nre\configs\AppConfig::$dirs['seminaryuploads'].DS.$upload['url']; + if(!file_exists($upload['filename'])) { + throw new \nre\exceptions\IdNotFoundException($uploadUrl); + } + + // Cache + if($this->setCacheHeaders($upload['filename'])) { + return null; + } + + + return file_get_contents($upload['filename']); + } + + + /** + * Create a thumbnail from an upload. + * + * @param array $upload Upload to create thumbnail for + * @return object Thumbnail for the upload (or null if thumbnail is cached) + */ + private function createThumbnail($upload) + { + // Set filename + $upload['filename'] = ROOT.DS.\nre\configs\AppConfig::$dirs['seminaryuploads'].DS.$upload['url']; + + // Set content-type + $this->response->addHeader("Content-type: image/jpeg"); + + // Check file + if(!file_exists($upload['filename'])) { + throw new \nre\exceptions\IdNotFoundException($upload['url']); + } + + // Cache + if($this->setCacheHeaders($upload['filename'])) { + return null; + } + + // Set geometry + $width = 100; + $height = 100; + + switch($upload['mimetype']) + { + case 'image/jpeg': + case 'image/png': + // Read image from cache + $tempFileName = ROOT.DS.\nre\configs\AppConfig::$dirs['temporary'].DS.$upload['url'].'-'.$width.'x'.$height; + if(file_exists($tempFileName)) + { + // Check age of file + if(date('r', filemtime($tempFileName)+(60*60*24)) > date('r', time())) { + // Too old, delete + unlink($tempFileName); + } + else { + // Valid, read and return + return file_get_contents($tempFileName); + } + } + + // ImageMagick + $im = new \Imagick($upload['filename']); + + // Calculate new size + $geometry = $im->getImageGeometry(); + if($geometry['width'] < $width) { + $width = $geometry['width']; + } + if($geometry['height'] < $height) { + $height = $geometry['width']; + } + + // Process + $im->thumbnailImage($width, $height, true); + $im->contrastImage(1); + $im->setImageFormat('jpeg'); + + // Save temporary file + $im->writeImage($tempFileName); + + + // Return resized image + return $im; + break; + default: + throw new \nre\exceptions\ParamsNotValidException('thumbnail'); + break; + } + + + return $this->getUploadFile($upload); + } + + + /** + * Determine file information and set the HTTP-header for + * caching accordingly. + * + * @param string $fileName Filename + * @return boolean HTTP-status 304 was set (in cache) + */ + private function setCacheHeaders($fileName) + { + // Determine last change of file + $fileLastModified = gmdate('r', filemtime($fileName)); + + // Generate E-Tag + $fileEtag = hash('sha256', $fileLastModified.$fileName); + + + // Set header + $this->response->addHeader("Last-Modified: ".$fileLastModified); + $this->response->addHeader("Etag: ".$fileEtag); + // HTTP-status + $headerModifiedSince = $this->request->getServerParam('HTTP_IF_MODIFIED_SINCE'); + $headerNoneMatch = $this->request->getServerParam('HTTP_IF_NONE_MATCH'); + if( + !is_null($headerModifiedSince) && $fileLastModified < strtotime($headerModifiedSince) && + !is_null($headerNoneMatch) && $headerNoneMatch == $fileEtag + ) { + $this->response->setExit(true); + $this->response->addHeader(\nre\core\WebUtils::getHttpHeader(304)); + + return true; + } + + + return false; + } + + } + +?> diff --git a/controllers/UserrolesController.inc b/controllers/UserrolesController.inc new file mode 100644 index 00000000..238f189b --- /dev/null +++ b/controllers/UserrolesController.inc @@ -0,0 +1,47 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to display and manage userroles. + * + * @author Oliver Hanraths + */ + class UserrolesController extends \hhu\z\Controller + { + + + + + /** + * Action: user. + * + * Show a user and its details. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $userUrl URL-Username of an user + */ + public function user($userUrl) + { + // Get userroles + $roles = $this->Userroles->getUserrolesForUserByUrl($userUrl); + + + // Pass data to view + $this->set('roles', $roles); + } + + + } + +?> diff --git a/controllers/UsersController.inc b/controllers/UsersController.inc new file mode 100644 index 00000000..f0e254fd --- /dev/null +++ b/controllers/UsersController.inc @@ -0,0 +1,641 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the Agent to list registered users and their data. + * + * @author Oliver Hanraths + */ + class UsersController extends \hhu\z\controllers\IntermediateController + { + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'index' => array('admin', 'moderator'), + 'user' => array('admin', 'moderator', 'user'), + 'create' => array('admin', 'moderator'), + 'edit' => array('admin', 'moderator', 'user'), + 'delete' => array('admin') + ); + /** + * Required models + * + * @var array + */ + public $models = array('users', 'userroles', 'characters', 'characterroles', 'avatars', 'media', 'xplevels'); + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + + + + + /** + * Action: index. + * + * @param string $all Whether to list all users at once or not (optional) + */ + public function index($all=null) + { + // Set filters + $sortorder = 'username'; + $username = null; + $name = null; + $email = null; + $page = 1; + if($this->request->getRequestMethod() == 'GET') + { + $sortorder = $this->request->getGetParam('sortorder'); + $sortorder = !empty($sortorder) ? $sortorder : 'username'; + $username = (!is_null($this->request->getGetParam('username'))) ? $this->request->getGetParam('username') : $username; + $name = (!is_null($this->request->getGetParam('name'))) ? $this->request->getGetParam('name') : $name; + $email = (!is_null($this->request->getGetParam('email'))) ? $this->request->getGetParam('email') : $email; + $page = $this->request->getGetParam('page'); + $page = !empty($page) ? intval($page) : 1; + } + + // Get registered users + $limit = ($all != 'all') ? \nre\configs\AppConfig::$misc['lists_limit'] : null; + $offset = ($all != 'all') ? max((intval($page) - 1), 0) * $limit : 0; + $usersCount = $this->Users->getUsersCount($username, $name, $email); + $users = $this->Users->getUsers($sortorder, $username, $name, $email, $limit, $offset); + foreach($users as &$user) { + $user['roles'] = array_map(function($r) { return $r['name']; }, $this->Userroles->getUserrolesForUserById($user['id'])); + } + + + // Set titile + $this->addTitleLocalized('Users'); + + // Pass data to view + $this->set('users', $users); + $this->set('usersCount', $usersCount); + $this->set('sortorder', $sortorder); + $this->set('username', $username); + $this->set('name', $name); + $this->set('email', $email); + $this->set('all', $all); + $this->set('page', $page); + $this->set('limit', $limit); + } + + + /** + * Action: user. + * + * Show a user and its details. + * + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\AccessDeniedException + * @param string $userUrl URL-Username of an user + */ + public function user($userUrl) + { + // Get user + $user = $this->Users->getUserByUrl($userUrl); + + // Check permissions + if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0 && $user['id'] != IntermediateController::$user['id']) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get Characters + $characters = $this->Characters->getCharactersForUser($user['id']); + + // Additional Character information + foreach($characters as &$character) + { + // Seminary roles + $character['characterroles'] = $this->Characterroles->getCharacterrolesForCharacterById($character['id']); + $character['characterroles'] = array_map(function($a) { return $a['name']; }, $character['characterroles']); + + // Level + try { + $character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']); + } + catch(\nre\Exceptions\IdNotFoundException $e) { + // No XP-level + } + + // Avatar + $avatar = $this->Avatars->getAvatarById($character['avatar_id']); + if(!is_null($avatar['small_avatarpicture_id'])) + { + //$character['seminary'] = + $character['small_avatar'] = $this->Media->getSeminaryMediaById($avatar['small_avatarpicture_id']); + } + } + + + // Set titile + $this->addTitleLocalized($user['username']); + $this->addTitleLocalized('Users'); + + // Pass data to view + $this->set('user', $user); + $this->set('characters', $characters); + } + + + /** + * Action: login. + * + * Log in a user. + */ + public function login() + { + $username = ''; + $referrer = null; + + // Log the user in + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('login'))) + { + $username = $this->request->getPostParam('username'); + $referrer = $this->request->getPostParam('referrer'); + $userId = $this->Users->login( + $username, + $this->request->getPostParam('password') + ); + + if(!is_null($userId)) + { + $this->Auth->setUserId($userId); + $user = $this->Users->getUserById($userId); + + if(!empty($referrer)) { + $this->redirect($referrer); + } + else { + $this->redirect($this->linker->link(array($user['url']), 1)); + } + } + } + + + // Set titile + $this->addTitleLocalized('Login'); + + // Pass data to view + $this->set('username', $username); + $this->set('referrer', $referrer); + $this->set('failed', ($this->request->getRequestMethod() == 'POST')); + } + + + /** + * Action: register. + * + * Register a new user. + */ + public function register() + { + $username = ''; + $prename = ''; + $surname = ''; + $email = ''; + + $fields = array('username', 'prename', 'surname', 'email', 'password'); + $validation = array(); + $emailhost = \nre\configs\AppConfig::$app['registration_host']; + + // Register a new user + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('register'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $username = $this->request->getPostParam('username'); + if($this->Users->usernameExists($username)) { + $validation = $this->Validation->addValidationResult($validation, 'username', 'exist', true); + } + $prename = $this->request->getPostParam('prename'); + $surname = $this->request->getPostParam('surname'); + $email = $this->request->getPostParam('email'); + if(!empty($emailhost)) { + if(substr_compare($email, $emailhost, max(0, strlen($email)-strlen($emailhost)), strlen($emailhost)) !== 0) { + $validation = $this->Validation->addValidationResult($validation, 'email', 'host', 'invalid'); + } + } + if($this->Users->emailExists($email)) { + $validation = $this->Validation->addValidationResult($validation, 'email', 'exist', true); + } + $password = $this->request->getPostParam('password'); + if($password != $this->request->getPostParam('passwordrepeat')) { + $validation = $this->Validation->addValidationResult($validation, 'password', 'repeat', false); + } + + + // Register + if($validation === true) + { + $userId = $this->Users->createUser( + $username, + $prename, + $surname, + $email, + $password + ); + $user = $this->Users->getUserById($userId); + + // Send mail + $this->sendRegistrationMail($user); + + // Login + $this->Auth->setUserId($userId); + + + // Redirect to user page + $this->redirect($this->linker->link(array($user['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('Registration'); + + // Pass data to view + $this->set('username', $username); + $this->set('prename', $prename); + $this->set('surname', $surname); + $this->set('email', $email); + $this->set('emailhost', $emailhost); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: logout. + * + * Log out a user. + */ + public function logout() + { + // Unset the currently logged in user + $this->Auth->setUserId(null); + + // Redirect + $this->redirect($this->linker->link(array())); + } + + + /** + * Action: manage. + * + * Manage users. + */ + public function manage() + { + $selectedUsers = array(); + //global $sortorder; + $sortorder = 'username'; + + if($this->request->getRequestMethod() == 'POST') + { + // Set sortorder + $sortorder = $this->request->getPostParam('sortorder'); + + // Do action + $selectedUsers = $this->request->getPostParam('users'); + if(!is_array($selectedUsers)) { + $selectedUsers = array(); + } + if(!is_null($this->request->getPostParam('actions')) && count($this->request->getPostParam('actions')) > 0 && !is_null($this->request->getPostParam('users')) && count($this->request->getPostParam('users')) > 0) + { + $actions = $this->request->getPostParam('actions'); + $action = array_keys($actions)[0]; + + switch($action) + { + // Add/remove role to/from Characters + case 'addrole': + case 'removerole': + // Determine role and check permissions + $role = null; + switch($actions[$action]) + { + case _('Admin'): + if(!in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'admin'; + break; + case _('Moderator'): + if(!in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'moderator'; + break; + case _('User'): + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0) { + throw new \nre\exceptions\AccessDeniedException(); + } + $role = 'user'; + break; + } + + // Add role + if($action == 'addrole') { + foreach($selectedUsers as &$userId) { + $this->Userroles->addUserroleToUser($userId, $role); + } + } + // Remove role + else { + foreach($selectedUsers as &$userId) { + $this->Userroles->removeUserroleFromUser($userId, $role); + } + } + break; + } + } + } + + // Get registered users + $users = $this->Users->getUsers($sortorder); + foreach($users as &$user) { + $user['roles'] = array_map(function($r) { return $r['name']; }, $this->Userroles->getUserrolesForUserById($user['id'])); + } + + + // Set titile + $this->addTitleLocalized('Manage users'); + + // Pass data to view + $this->set('users', $users); + $this->set('selectedUsers', $selectedUsers); + $this->set('sortorder', $sortorder); + } + + + /** + * Action: create. + * + * Create a new user. + */ + public function create() + { + // Values + $username = ''; + $prename = ''; + $surname = ''; + $email = ''; + $fields = array('username', 'prename', 'surname', 'email', 'password'); + $validation = array(); + + // Create new user + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('create'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $username = $this->request->getPostParam('username'); + if($this->Users->usernameExists($username)) { + $validation = $this->Validation->addValidationResult($validation, 'username', 'exist', true); + } + $prename = $this->request->getPostParam('prename'); + $surname = $this->request->getPostParam('surname'); + $email = $this->request->getPostParam('email'); + if($this->Users->emailExists($email)) { + $validation = $this->Validation->addValidationResult($validation, 'email', 'exist', true); + } + $password = $this->request->getPostParam('password'); + if($password != $this->request->getPostParam('passwordrepeat')) { + $validation = $this->Validation->addValidationResult($validation, 'password', 'repeat', false); + } + + // Create + if($validation === true) + { + $userId = $this->Users->createUser( + $this->request->getPostParam('username'), + $this->request->getPostParam('prename'), + $this->request->getPostParam('surname'), + $this->request->getPostParam('email'), + $this->request->getPostParam('password') + ); + + // Redirect to user + $user = $this->Users->getUserById($userId); + $this->redirect($this->linker->link(array($user['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + + + // Set titile + $this->addTitleLocalized('New user'); + + // Pass data to view + $this->set('username', $username); + $this->set('prename', $prename); + $this->set('surname', $surname); + $this->set('email', $email); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: edit. + * + * Edit a user. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $userUrl URL-Username of an user + */ + public function edit($userUrl) + { + // User + $user = $this->Users->getUserByUrl($userUrl); + + // Check permissions + if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0 && $user['id'] != \hhu\z\controllers\IntermediateController::$user['id']) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Values + $username = $user['username']; + $prename = $user['prename']; + $surname = $user['surname']; + $email = $user['email']; + $mailing = $user['mailing']; + $fields = array('username', 'prename', 'surname', 'email'); + $validation = array(); + + // Edit user + if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('save'))) + { + // Get params and validate them + $validation = $this->Validation->validateParams($this->request->getPostParams(), $fields); + $username = $this->request->getPostParam('username'); + if($this->Users->usernameExists($username, $user['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'username', 'exist', true); + } + $password = $this->request->getPostParam('password'); + if(!empty($password)) + { + $validation = $this->Validation->addValidationResults($validation, + 'password', + $this->Validation->validateParam( + $this->request->getPostParams(), + 'password' + ) + ); + if($password != $this->request->getPostParam('passwordrepeat')) { + $validation = $this->Validation->addValidationResult($validation, 'password', 'repeat', false); + } + } + $prename = $this->request->getPostParam('prename'); + $surname = $this->request->getPostParam('surname'); + $email = $this->request->getPostParam('email'); + if($this->Users->emailExists($email, $user['id'])) { + $validation = $this->Validation->addValidationResult($validation, 'email', 'exist', true); + } + $mailing = !is_null($this->request->getPostParam('mailing')); + + // Save changes + if($validation === true) + { + // Edit user + $this->Users->editUser( + $user['id'], + (count(array_intersect(array('admin','moderator'),\hhu\z\controllers\IntermediateController::$user['roles'])) > 0) ? $this->request->getPostParam('username') : $user['username'], + $prename, + $surname, + $email, + $password, + $mailing + ); + + // Redirect to entry + $user = $this->Users->getUserById($user['id']); + $this->redirect($this->linker->link(array('user', $user['url']), 1)); + } + } + + // Get validation settings + $validationSettings = array(); + foreach($fields as &$field) { + $validationSettings[$field] = \nre\configs\AppConfig::$validation[$field]; + } + $validationSettings['password'] = \nre\configs\AppConfig::$validation['password']; + + + // Set titile + $this->addTitleLocalized('Edit user'); + + // Pass data to view + $this->set('username', $username); + $this->set('prename', $prename); + $this->set('surname', $surname); + $this->set('email', $email); + $this->set('mailing', $mailing); + $this->set('validation', $validation); + $this->set('validationSettings', $validationSettings); + } + + + /** + * Action: delete. + * + * Delete a user. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $userUrl URL-Username of an user + */ + public function delete($userUrl) + { + // User + $user = $this->Users->getUserByUrl($userUrl); + + // Check request method + if($this->request->getRequestMethod() == 'POST') + { + // Check confirmation + if(!is_null($this->request->getPostParam('delete'))) + { + // Delete user + $this->Users->deleteUser($user['id']); + + // Redirect to overview + $this->redirect($this->linker->link(null, 1)); + } + + // Redirect to entry + $this->redirect($this->linker->link(array('user', $user['url']), 1)); + } + + + // Set titile + $this->addTitleLocalized('Delete user'); + + // Show confirmation + $this->set('user', $user); + } + + + + + /** + * Send mail for new user registration. + * + * @param array $user Newly registered user + */ + private function sendRegistrationMail($user) + { + // Get system moderators + $moderators = $this->Users->getUsersWithRole('moderator'); + + // Send notification mail + try { + foreach($moderators as &$moderator) + { + if($moderator['mailing']) { + \hhu\z\Utils::sendMail( + $moderator['email'], + 'userregistration', + true, + array( + $moderator, + $user + ), + $this->linker + ); + } + } + } + catch(\hhu\z\exceptions\MailingException $e) { + $this->log($e->getMessage()); + } + } + + } + +?> diff --git a/controllers/XplevelsController.inc b/controllers/XplevelsController.inc new file mode 100644 index 00000000..91bb32f5 --- /dev/null +++ b/controllers/XplevelsController.inc @@ -0,0 +1,188 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the XplevelsAgent to handle XP-levels of a + * Seminary. + * + * @author Oliver Hanraths + */ + class XplevelsController extends \hhu\z\controllers\SeminaryController + { + /** + * Required components + * + * @var array + */ + public $components = array('validation'); + /** + * Required models + * + * @var array + */ + public $models = array('xplevels'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'manage' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: manage. + * + * Manage XP-levels. + * + * @throws \nre\exceptions\IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + */ + public function manage($seminaryUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Check permissions + if( + (is_null(self::$character) && count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0) && + $seminary['created_user_id'] != self::$user['id'] + ) { + throw new \nre\exceptions\AccessDeniedException(); + } + + // Get XP-levels + $xplevels = $this->Xplevels->getXPLevelsForSeminary($seminary['id']); + + // Values + $xplevelsValues = array(); + foreach($xplevels as &$xplevel) { + $xplevelsValues[$xplevel['id']] = $xplevel; + } + $deletes = array(); + $validations = array( + 'edit' => true, + 'create' => true + ); + + // Edit + $action = null; + if($this->request->getRequestMethod() == 'POST') + { + // Edit and delete XP-levels + if(!is_null($this->request->getPostParam('edit'))) + { + $action = 'edit'; + + // Get params + $xplevelsValues = $this->request->getPostParam('xplevels'); + $deletes = $this->request->getPostParam('deletes'); + + // Validate params + if(!is_array($deletes)) { + $deletes = array(); + } + foreach($xplevels as &$xplevel) + { + if(array_key_exists($xplevel['id'], $deletes)) { + continue; + } + + $xplevelValidation = $this->Validation->validateParams($xplevelsValues[$xplevel['id']], array('xps')); + if($xplevelValidation !== true) + { + if(!is_array($validations['edit'])) { + $validations['edit'] = array(); + } + if(!array_key_exists($xplevel['id'], $validations['edit']) || !is_array($validations['edit'][$xplevel['id']])) { + $validations['edit'][$xplevel['id']] = array(); + } + $validations['edit'][$xplevel['id']] = $this->Validation->addValidationResults($validations['edit'][$xplevel['id']], 'xps', $xplevelValidation); + } + } + + // Edit and delete + if($validations['edit'] === true) + { + foreach($xplevels as &$xplevel) + { + // Delete + if(array_key_exists($xplevel['id'], $deletes)) { + $this->Xplevels->deleteXPLevel($xplevel); + } + // Edit + elseif(array_key_exists($xplevel['id'], $xplevelsValues)) + { + $this->Xplevels->editXPLevel( + $xplevel['id'], + $xplevelsValues[$xplevel['id']]['xps'] + ); + } + } + + // Redirect + $this->redirect($this->linker->link(null, 3)); + } + } + + // Create XP-level + if(!is_null($this->request->getPostParam('create'))) + { + $action = 'create'; + + // Get params and validate them + $xplevelnew = $this->request->getPostParam('xplevelnew'); + $validations[$action] = $this->Validation->validateParams($xplevelnew, array('xps')); + + // Create + if($validations[$action] === true) + { + $this->Xplevels->createXPLevel( + $this->Auth->getUserId(), + $seminary['id'], + $xplevelnew['xps'] + ); + + // Redirect + $this->redirect($this->linker->link(null, 3)); + } + } + } + + // Get validation settings + $validationSettings = array( + 'xps' => \nre\configs\AppConfig::$validation['xps'] + ); + + + // Set titile + $this->addTitleLocalized('Manage XP-levels'); + $this->addTitle($seminary['title']); + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('xplevels', $xplevels); + $this->set('xplevelsValues', $xplevelsValues); + $this->set('deletes', $deletes); + $this->set('action', $action); + $this->set('validations', $validations); + $this->set('validationSettings', $validationSettings); + } + + } + +?> diff --git a/controllers/components/AchievementComponent.inc b/controllers/components/AchievementComponent.inc new file mode 100644 index 00000000..70601543 --- /dev/null +++ b/controllers/components/AchievementComponent.inc @@ -0,0 +1,41 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers\components; + + + /** + * Component to handle achievements. + * + * @author Oliver Hanraths + */ + class AchievementComponent extends \nre\core\Component + { + /** + * Required models + * + * @var array + */ + public $models = array('achievements'); + + + + + /** + * Construct a new Achievements-component. + */ + public function __construct() + { + } + + } + +?> diff --git a/controllers/components/AuthComponent.inc b/controllers/components/AuthComponent.inc new file mode 100644 index 00000000..0db6c69d --- /dev/null +++ b/controllers/components/AuthComponent.inc @@ -0,0 +1,79 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers\components; + + + /** + * Component to handle authentication and authorization. + * + * @author Oliver Hanraths + */ + class AuthComponent extends \nre\core\Component + { + /** + * Key to save a user-ID as + * + * @var string + */ + const KEY_USER_ID = 'user_id'; + + + + + /** + * Construct a new Auth-component. + */ + public function __construct() + { + // Start session + if(session_id() === '') { + session_start(); + } + } + + + + + /** + * Set the ID of the user that is currently logged in. + * + * @param int $userId ID of the currently logged in user + */ + public function setUserId($userId) + { + if(is_null($userId)) { + unset($_SESSION[self::KEY_USER_ID]); + } + else { + $_SESSION[self::KEY_USER_ID] = $userId; + } + } + + + /** + * Get the ID of the user that is currently logged in. + * + * @return int ID of the currently logged in user + */ + public function getUserId() + { + if(array_key_exists(self::KEY_USER_ID, $_SESSION)) { + return $_SESSION[self::KEY_USER_ID]; + } + + + return null; + } + + } + +?> diff --git a/controllers/components/NotificationComponent.inc b/controllers/components/NotificationComponent.inc new file mode 100644 index 00000000..bddffc80 --- /dev/null +++ b/controllers/components/NotificationComponent.inc @@ -0,0 +1,108 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers\components; + + + /** + * Component to handle user notifications + * + * @author Oliver Hanraths + */ + class NotificationComponent extends \nre\core\Component + { + /** + * Type: Achievement + * + * @var string + */ + const TYPE_ACHIEVEMENT = 'achievement'; + /** + * Type: Level-up + * + * @var string + */ + const TYPE_LEVELUP = 'levelup'; + /** + * Key for Session-Array to store notifications in + * + * @var string + */ + const SESSION_KEY = 'notifications'; + + + + + /** + * Construct a new Notification-component. + */ + public function __construct() + { + // Start session + if(session_id() === '') { + session_start(); + } + + // Prepare array + if(!array_key_exists(self::SESSION_KEY, $_SESSION)) { + $_SESSION[self::SESSION_KEY] = array(); + } + } + + + + + /** + * Add a notification. + * + * @param string $type Type of notification + * @param string $message Message to display + * @param string $link Optional URL to link to + * @param string $image Optional URL of image to display + */ + public function addNotification($type, $message, $link=null, $image=null) + { + $_SESSION[self::SESSION_KEY][] = array( + 'type' => $type, + 'message' => $message, + 'link' => $link, + 'image' => $image + ); + } + + + /** + * Get all registered notifiactions and clear them. + * + * @return array List of existing notifications + */ + public function getNotifications() + { + $notifications = $_SESSION[self::SESSION_KEY]; + $this->clearNotifications(); + + + return $notifications; + } + + + /** + * Clear all notifications currently registered + */ + public function clearNotifications() + { + unset($_SESSION[self::SESSION_KEY]); + $_SESSION[self::SESSION_KEY] = array(); + } + + } + +?> diff --git a/controllers/components/QuesttypedataComponent.inc b/controllers/components/QuesttypedataComponent.inc new file mode 100644 index 00000000..6c23e4f6 --- /dev/null +++ b/controllers/components/QuesttypedataComponent.inc @@ -0,0 +1,89 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers\components; + + + /** + * Component to handle data for Questtypes between different Quest states. + * + * @author Oliver Hanraths + */ + class QuesttypedataComponent extends \nre\core\Component + { + /** + * Session key + * + * @var string + */ + const SESSION_KEY = 'questtypes'; + + + + + /** + * Construct a new QuesttypesData-component. + */ + public function __construct() + { + // Construct session place + if(!array_key_exists(self::SESSION_KEY, $_SESSION)) { + $_SESSION[self::SESSION_KEY] = array(); + } + } + + + + + /** + * Set data with a key-value pair. + * + * @param int $questId ID of Quest to set data for + * @param mixed $key Key + * @param mixed $value Value + */ + public function set($questId, $key, $value) + { + // Construct array + if(!array_key_exists($questId, $_SESSION[self::SESSION_KEY])) { + $_SESSION[self::SESSION_KEY][$questId] = array(); + } + + // Set data + $_SESSION[self::SESSION_KEY][$questId][$key] = $value; + } + + + /** + * Get data by a key. + * + * @param int $questId ID of Quest to set data for + * @param mixed $key Key + * @return mixed Value + */ + public function get($questId, $key) + { + // Check array + if(!array_key_exists($questId, $_SESSION[self::SESSION_KEY])) { + return null; + } + if(!array_key_exists($key, $_SESSION[self::SESSION_KEY][$questId])) { + return null; + } + + + // Return data + return $_SESSION[self::SESSION_KEY][$questId][$key]; + } + + } + +?> diff --git a/controllers/components/ValidationComponent.inc b/controllers/components/ValidationComponent.inc new file mode 100644 index 00000000..33f7963d --- /dev/null +++ b/controllers/components/ValidationComponent.inc @@ -0,0 +1,183 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers\components; + + + /** + * Component to validate user input. + * + * @author Oliver Hanraths + */ + class ValidationComponent extends \nre\core\Component + { + /** + * Validation settings + * + * @var array + */ + private $config; + + + + + /** + * Construct a new Validation-component. + */ + public function __construct() + { + // Get validation settings from configuration + $this->config = \nre\configs\AppConfig::$validation; + } + + + + + /** + * Validate an user input. + * + * @param mixed $input User input to validate + * @param array $settings Validation setting + * @return mixed True or the settings the validation fails on + */ + public function validate($input, $settings) + { + $validation = array(); + + // Min string length + if(array_key_exists('minlength', $settings) && strlen($input) < $settings['minlength']) { + $validation['minlength'] = $settings['minlength']; + } + // Max string length + if(array_key_exists('maxlength', $settings) && strlen($input) > $settings['maxlength']) { + $validation['maxlength'] = $settings['maxlength']; + } + + // Regex + if(array_key_exists('regex', $settings) && !preg_match($settings['regex'], $input)) { + $validation['regex'] = $settings['regex']; + } + + + // Return true or the failed fields + if(empty($validation)) { + return true; + } + return $validation; + } + + + /** + * Validate an user input parameter. + * + * @param array $params User input parameters + * @param array $index Names of parameter to validate and to validate against + * @return mixed True or the parameter with settings the validation failed on + */ + public function validateParam($params, $index) + { + // Check parameter + if(!array_key_exists($index, $params)) { + throw new \nre\exceptions\ParamsNotValidException($index); + } + // Check settings + if(!array_key_exists($index, $this->config)) { + return true; + } + + + // Validate parameter and return result + return $this->validate($params[$index], $this->config[$index]); + } + + + /** + * Validate user input parameters. + * + * @param array $params User input parameters + * @param array $indices Names of parameters to validate and to validate against + * @return mixed True or the parameters with settings the validation failed on + */ + public function validateParams($params, $indices) + { + // Validate parameters + $validation = true; + foreach($indices as $index) { + $validation = $this->addValidationResults($validation, $index, $this->validateParam($params, $index)); + } + + + // Return validation results + return $validation; + } + + + /** + * Add a custom determined validation result to a validation + * array. + * + * @param mixed $validation Validation array to add result to + * @param string $index Name of parameter of the custom validation result + * @param string $setting Name of setting of the custom validation result + * @param mixed $result Validation result + * @return mixed The altered validation array + */ + public function addValidationResult($validation, $index, $setting, $result) + { + // Create validation array + if(!is_array($validation)) { + $validation = array(); + } + + // Add validation results + if(!array_key_exists($index, $validation)) { + $validation[$index] = array(); + } + $validation[$index][$setting] = $result; + + + // Return new validation result + return $validation; + } + + + /** + * Add custom determined validation results to a validation + * arary. + * + * @param mixed $validation Validation array to add result to + * @param string $index Name of parameter of the custom validation result + * @param mixed $result Validation result + * @return mixed The altered validation array + */ + public function addValidationResults($validation, $index, $results) + { + // Create validation array + if(!is_array($validation)) { + $validation = array(); + } + + // Add validation results + if($results !== true) { + $validation[$index] = $results; + } + + + // Return new validation result + if(empty($validation)) { + return true; + } + return $validation; + } + + } + +?> diff --git a/controllers/components/empty b/controllers/components/empty new file mode 100644 index 00000000..e69de29b diff --git a/controllers/empty b/controllers/empty new file mode 100644 index 00000000..e69de29b diff --git a/core/Agent.inc b/core/Agent.inc new file mode 100644 index 00000000..fb8fe8ac --- /dev/null +++ b/core/Agent.inc @@ -0,0 +1,608 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class for the implementation af an Agent. + * + * @author coderkun + */ + abstract class Agent + { + /** + * Name of BottomlevelAgent for showing inline errors + * + * @var string + */ + const INLINEERROR_AGENT = 'inlineerror'; + + /** + * Current request + * + * @var Request + */ + private $request; + /** + * Current response + * + * @var Response + */ + private $response; + /** + * Log-system + * + * @var Logger + */ + protected $log; + /** + * SubAgents + * + * @var array + */ + protected $subAgents = array(); + /** + * Controller of this Agent + * + * @var Controller + */ + public $controller = null; + + + + + /** + * Load the class of an Agent. + * + * @static + * @throws \nre\exceptions\AgentNotFoundException + * @throws \nre\exceptions\AgentNotValidException + * @param string $agentName Name of the Agent to load + */ + public static function load($agentName) + { + // Determine full classname + $agentType = self::getAgentType(); + $className = self::getClassName($agentName, $agentType); + + try { + // Load class + ClassLoader::load($className); + + // Validate class + $parentAgentClassName = ClassLoader::concatClassNames($agentType, 'agent'); + $parentAgentClassName = "\\nre\\agents\\$parentAgentClassName"; + ClassLoader::check($className, $parentAgentClassName); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \nre\exceptions\AgentNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \nre\exceptions\AgentNotFoundException($e->getClassName()); + } + } + + + + /** + * Instantiate an Agent (Factory Pattern). + * + * @static + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @throws \nre\exceptions\ControllerNotFoundException + * @param string $agentName Name of the Agent to instantiate + * @param Request $request Current request + * @param Response $respone Current respone + * @param Logger $log Log-system + */ + public static function factory($agentName, Request $request, Response $response, Logger $log=null) + { + // Determine full classname + $agentType = self::getAgentType(); + $className = self::getClassName($agentName, $agentType); + + + // Construct and return Agent + return new $className($request, $response, $log); + } + + + /** + * Determine the type of an Agent. + * + * @static + * @return string Agent type + */ + private static function getAgentType() + { + return strtolower(ClassLoader::getClassName(get_called_class())); + } + + + /** + * Determine the classname for the given Agent name. + * + * @static + * @param string $agentName Agent name to get classname of + * @param string $agentType Agent type of given Agent name + * @return string Classname for the Agent name + */ + private static function getClassName($agentName, $agentType) + { + $className = ClassLoader::concatClassNames($agentName, 'agent'); + + + return \nre\configs\AppConfig::$app['namespace']."agents\\$agentType\\$className"; + } + + + + + /** + * Construct a new Agent. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @throws \nre\exceptions\ControllerNotFoundException + * @param Request $request Current request + * @param Response $respone Current response + * @param Logger $log Log-system + */ + protected function __construct(Request $request, Response $response, Logger $log=null) + { + // Store values + $this->request = $request; + $this->response = $response; + $this->log = $log; + + // Construct SubAgent + $this->actionConstruct(); + + // Load corresponding Controller + $this->loadController(); + } + + + + + /** + * Run the Controller of this Agent and its SubAgents. + * + * @throws \nre\exceptions\ParamsNotValidException + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\ActionNotFoundException + * @param Request $request Current request + * @param Response $response Current response + * @return \Exception Last occurred exception of SubAgents + */ + public function run(Request $request, Response $response) + { + // Check Controller + if(!is_null($this->controller)) + { + // Call prefilter + $this->controller->preFilter($request, $response); + + // Run controller + $this->controller->run($request, $response); + + // Call postfilter + $this->controller->postFilter($request, $response); + } + + + // Run SubAgents + $exception = null; + foreach($this->subAgents as &$subAgent) + { + try { + $subAgent['object']->run( + $request, + $subAgent['response'] + ); + } + catch(ParamsNotValidException $e) { + $subAgent = $this->errorInline($subAgent, $request, $e); + } + catch(IdNotFoundException $e) { + $subAgent = $this->errorInline($subAgent, $request, $e); + } + catch(DatamodelException $e) { + $exception = $e; + $subAgent = $this->errorInline($subAgent, $request, $e); + } + catch(ActionNotFoundException $e) { + $subAgent = $this->errorInline($subAgent, $request, $e); + } + } + + + // Return last occurred exception + return $exception; + } + + + /** + * Generate output of the Controller of this Agent and its + * SubAgents. + * + * @param array $data View data + * @return string Generated output + */ + public function render($data=array()) + { + // Check Controller + if(!is_null($this->controller)) + { + // Render SubAgents + foreach($this->subAgents as $subAgent) + { + $label = array_key_exists('label', $subAgent) ? $subAgent['label'] : $subAgent['name']; + $data[$label] = $this->renderSubAgent($subAgent); + } + + // Render the Controller of this agent + return $this->controller->render($data); + } + } + + + + + /** + * Construct SubAgents (per Action). + */ + protected function actionConstruct() + { + // Action ermitteln + $action = $this->response->getParam(2); + if(is_null($action)) { + $action = $this->request->getParam(2, 'action'); + $this->response->addParam($action); + } + + // Initialisierungsmethode für diese Action ausführen + if(method_exists($this, $action)) + { + call_user_func_array( + array( + $this, + $action + ), + array( + $this->request, + $this->response + ) + ); + } + } + + + /** + * Load the Controller of this Agent. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @throws \nre\exceptions\ControllerNotFoundException + */ + protected function loadController() + { + // Determine Controller name + $controllerName = ClassLoader::getClassName(get_class($this)); + + // Determine ToplevelAgent + $toplevelAgentName = $this->response->getParam(0); + if(is_null($toplevelAgentName)) { + $toplevelAgentName = $this->request->getParam(0, 'toplevel'); + $this->response->addParam($toplevelAgentName); + } + + // Determine Action + $action = $this->response->getParam(2); + if(is_null($action)) { + $action = $this->request->getParam(2, 'action'); + $this->response->addParam($action); + } + + + // Load Controller + Controller::load($controllerName); + + // Construct Controller + $this->controller = Controller::factory($controllerName, $toplevelAgentName, $action, $this); + } + + + /** + * Log an error. + * + * @param \Exception $exception Occurred exception + * @param int $logMode Log mode + */ + protected function log($exception, $logMode) + { + if(is_null($this->log)) { + return; + } + + $this->log->log( + $exception->getMessage(), + $logMode + ); + } + + + /** + * Load a SubAgent and add it. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\AgentNotFoundException + * @throws \nre\exceptions\AgentNotValidException + * @param string $agentName Name of the Agent to load + * @param mixed … Additional parameters for the agent + */ + protected function addSubAgent($agentName) + { + try { + call_user_func_array( + array( + $this, + '_addSubAgent' + ), + func_get_args() + ); + } + catch(DatamodelException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + } + + + /** + * Load a SubAgent and add it. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\AgentNotFoundException + * @throws \nre\exceptions\AgentNotValidException + * @param string $agentName Name of the Agent to load + * @param mixed … Additional parameters for the agent + */ + protected function _addSubAgent($agentName) + { + try { + // Load Agent + \nre\agents\BottomlevelAgent::load($agentName); + + // Construct Agent + $this->subAgents[] = call_user_func_array( + array( + $this, + 'newSubAgent' + ), + func_get_args() + ); + } + catch(ViewNotFoundException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(DriverNotValidException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(DriverNotFoundException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(ModelNotValidException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(ModelNotFoundException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(ControllerNotValidException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(ControllerNotFoundException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(AgentNotValidException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + catch(AgentNotFoundException $e) { + $this->subAgents[] = $this->newInlineError($agentName, $e); + } + } + + + + + /** + * Create a new SubAgent. + * + * @throws \nre\exceptions\DatamodelException + * @param string $agentName Agent name + * @return array SubAgent + */ + private function newSubAgent($agentName) + { + // Response + $response = clone $this->response; + $response->clearParams(1); + $params = func_get_args(); + if(count($params) < 2 || empty($params[1])) { + $params[1] = \nre\configs\CoreConfig::$defaults['action']; + } + call_user_func_array( + array( + $response, + 'addParams' + ), + $params + ); + + return array( + 'name' => strtolower($agentName), + 'response' => $response, + 'object' => \nre\agents\BottomlevelAgent::factory( + $agentName, + $this->request, + $response, + $this->log + ) + ); + } + + + /** + * Render a SubAgent. + * + * @param array $subAgent SubAgent to render + * @return string Generated output + */ + private function renderSubAgent(&$subAgent) + { + // Check for InlineError + if(array_key_exists('inlineerror', $subAgent) && !empty($subAgent['inlineerror'])) { + return file_get_contents($subAgent['inlineerror']); + } + + + // Rendern SubAgent and return its output + return $subAgent['object']->render(); + } + + + /** + * Handle the exception of a SubAgent. + * + * @param array $subAgent Original (Sub-) Agent + * @param Request $request Current request + * @param Excepiton $exception Occurred exception + * @return array InlineError-SubAgent + */ + private function errorInline($subAgent, $request, $exception) + { + // Create the SubAgent for the exception + $subAgent = $this->newInlineError($subAgent['name'], $exception); + + + // Run the InlineError-SubAgent + try { + $subAgent['object']->run( + $request, + $subAgent['response'] + ); + } + catch(ActionNotFoundException $e) { + $this->log($e, Logger::LOGMODE_AUTO); + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + + + // Return the InlineError-SubAgent + return $subAgent; + } + + + /** + * Create a new InlineError. + * + * @param string $label Name of the original Agent + * @param \Exception $exception Occurred exception + */ + private function newInlineError($label, $exception) + { + // Log error + $this->log($exception, Logger::LOGMODE_AUTO); + + // Determine Agent name + $agentName = self::INLINEERROR_AGENT; + + // Create SugAgent + $subAgent = array(); + + + try { + // Load Agenten + \nre\agents\BottomlevelAgent::load($agentName); + + // Construct Agent + $subAgent = $this->newSubAgent($agentName); + $subAgent['label'] = $label; + $subAgent['response']->addParam($exception); + } + catch(ViewNotFoundException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(DatamodelException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(DriverNotValidException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(DriverNotFoundException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(ModelNotValidException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(ModelNotFoundException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(ControllerNotValidException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(ControllerNotFoundException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(AgentNotValidException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + catch(AgentNotFoundException $e) { + $subAgent['inlineerror'] = $this->newInlineErrorService(); + } + + + // Return SubAgent + return $subAgent; + } + + + /** + * Handle a hardcore error that could not be handled by the + * system. + */ + private function newInlineErrorService() + { + // Read and return static error file + return ROOT.DS.\nre\configs\CoreConfig::getClassDir('views').DS.\nre\configs\CoreConfig::$defaults['inlineErrorFile'].\nre\configs\Config::getFileExt('views'); + } + + } + +?> diff --git a/core/Api.inc b/core/Api.inc new file mode 100644 index 00000000..9cd1cfdc --- /dev/null +++ b/core/Api.inc @@ -0,0 +1,163 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class to implement an API. + * + * The API is the center of each application and specifies how and what + * to run and render. + * + * @author coderkun + */ + abstract class Api + { + /** + * Die aktuelle Anfrage + * + * @var Request + */ + protected $request; + /** + * Der Toplevelagent + * + * @var \nre\agents\ToplevelAgent + */ + private $toplevelAgent = null; + /** + * Die aktuelle Antwort + * + * @var Response + */ + protected $response; + /** + * Log-System + * + * @var Logger + */ + protected $log; + + + + + /** + * Construct a new API. + * + * @param Request $request Current request + * @param Response $response Current response + */ + public function __construct(Request $request, Response $response) + { + // Store request + $this->request = $request; + + // Store response + $this->response = $response; + + // Init logging + $this->log = new \nre\core\Logger(); + } + + + + + /** + * Run the application. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @throws \nre\exceptions\ControllerNotFoundException + * @throws \nre\exceptions\AgentNotValidException + * @throws \nre\exceptions\AgentNotFoundException + * @return \Exception Last occurred exception of an subagent + */ + public function run() + { + // Load ToplevelAgent + $this->loadToplevelAgent(); + + // Run ToplevelAgent + return $this->toplevelAgent->run($this->request, $this->response); + } + + + /** + * Render the output. + */ + public function render() + { + // Check exit-status + if($this->response->getExit()) { + return; + } + + // Render ToplevelAgent + $this->response->setOutput($this->toplevelAgent->render()); + } + + + + + /** + * Log an exception + * + * @param \Exception $exception Occurred exception + * @param int $logMode Log-mode + */ + protected function log($exception, $logMode) + { + $this->log->log( + $exception->getMessage(), + $logMode + ); + } + + + + + /** + * Load the ToplevelAgent specified by the request. + * + * @throws \nre\exceptions\ServiceUnavailableException + * @throws \nre\exceptions\AgentNotValidException + * @throws \nre\exceptions\AgentNotFoundException + */ + private function loadToplevelAgent() + { + // Determine agent + $agentName = $this->response->getParam(0); + if(is_null($agentName)) { + $agentName = $this->request->getParam(0, 'toplevel'); + $this->response->addParam($agentName); + } + + // Load agent + \nre\agents\ToplevelAgent::load($agentName); + + // Construct agent + $this->toplevelAgent = \nre\agents\ToplevelAgent::factory( + $agentName, + $this->request, + $this->response, + $this->log + ); + } + + } + +?> diff --git a/core/Autoloader.inc b/core/Autoloader.inc new file mode 100644 index 00000000..fdbf73bc --- /dev/null +++ b/core/Autoloader.inc @@ -0,0 +1,98 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Autoloader. + * + * This class tries to load not yet used classes. + * + * @author coderkun + */ + class Autoloader + { + /** + * Private construct(). + */ + private function __construct() {} + + /** + * Private clone(). + */ + private function __clone() {} + + + + + /** + * Register load-method. + */ + public static function register() + { + spl_autoload_register( + array( + get_class(), + 'load' + ) + ); + } + + + /** + * Look for the given class and try to load it. + * + * @param string $fullClassName Name of class to load + */ + public static function load($fullClassName) + { + $fullClassNameA = explode('\\', $fullClassName); + + if(strpos($fullClassName, \nre\configs\CoreConfig::$core['namespace']) !== 0) + { + // App + $className = array_slice($fullClassNameA, substr_count(\nre\configs\AppConfig::$app['namespace'], '\\')); + array_unshift($className, \nre\configs\CoreConfig::getClassDir('app')); + $filename = ROOT.DS.implode(DS, $className).\nre\configs\CoreConfig::getFileExt('includes'); + if(file_exists($filename)) { + require_once($filename); + } + } + else + { + // Core + $className = array_slice($fullClassNameA, substr_count(\nre\configs\CoreConfig::$core['namespace'], '\\')); + $filename = ROOT.DS.implode(DS, $className).\nre\configs\CoreConfig::getFileExt('includes'); + if(file_exists($filename)) { + require_once($filename); + } + } + + + } + + + /** + * Determine classtype of a class. + * + * @param string $className Name of the class to determine the classtype of + * @return string Classtype of the given class + */ + public static function getClassType($className) + { + // CamelCase + return strtolower(preg_replace('/^.*([A-Z][^A-Z]+)$/', '$1', $className)); + } + + } + +?> diff --git a/core/ClassLoader.inc b/core/ClassLoader.inc new file mode 100644 index 00000000..e999568a --- /dev/null +++ b/core/ClassLoader.inc @@ -0,0 +1,129 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Class for safely loading classes. + * + * @author coderkun + */ + class ClassLoader + { + + + + + /** + * Load a class. + * + * @throws \nre\exceptions\ClassNotFoundException + * @param string $className Name of the class to load + */ + public static function load($fullClassName) + { + // Determine folder to look in + $className = explode('\\', $fullClassName); + $className = array_slice($className, substr_count(\nre\configs\AppConfig::$app['namespace'], '\\')); + + // Determine filename + $fileName = ROOT.DS.implode(DS, $className). \nre\configs\CoreConfig::getFileExt('includes'); + + + // Check file + if(!file_exists($fileName)) + { + throw new \nre\exceptions\ClassNotFoundException( + $fullClassName + ); + } + + // Include file + include_once($fileName); + } + + + /** + * Check inheritance of a class. + * + * @throws \nre\exceptions\ClassNotValidException + * @param string $className Name of the class to check + * @param string $parentClassName Name of the parent class + */ + public static function check($className, $parentClassName) + { + // Check if class is subclass of parent class + if(!is_subclass_of($className, $parentClassName)) { + throw new \nre\exceptions\ClassNotValidException( + $className + ); + } + } + + + /** + * Strip the namespace from a class name. + * + * @param string $class Name of a class including its namespace + * @return string Name of the given class without its namespace + */ + public static function stripNamespace($class) + { + return array_slice(explode('\\', $class), -1)[0]; + } + + + /** + * Strip the class type from a class name. + * + * @param string $className Name of a class + * @return string Name of the given class without its class type + */ + public static function stripClassType($className) + { + return preg_replace('/^(.*)[A-Z][^A-Z]+$/', '$1', $className); + } + + + /** + * Strip the namespace and the class type of a full class name + * to get only its name. + * + * @param string $class Full name of a class + * @return string Only the name of the given class + */ + public static function getClassName($class) + { + return self::stripClassType(self::stripNamespace($class)); + } + + + /** + * Concatenate strings to a class name following the CamelCase + * pattern. + * + * @param string $className1 Arbitrary number of strings to concat + * @return string Class name as CamelCase + */ + public static function concatClassNames($className1) + { + return implode('', array_map( + function($arg) { + return ucfirst(strtolower($arg)); + }, + func_get_args() + )); + } + + } + +?> diff --git a/core/Component.inc b/core/Component.inc new file mode 100644 index 00000000..ae219970 --- /dev/null +++ b/core/Component.inc @@ -0,0 +1,85 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class to implement a (Controller) Component. + * + * @author coderkun + */ + abstract class Component + { + + + + + /** + * Load the class of a Component. + * + * @throws \nre\exceptions\ComponentNotFoundException + * @throws \nre\exceptions\ComponentNotValidException + * @param string $componentName Name of the Component to load + */ + public static function load($componentName) + { + // Determine full classname + $className = self::getClassName($componentName); + + try { + // Load class + ClassLoader::load($className); + + // Validate class + ClassLoader::check($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \nre\exceptions\ComponentNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \nre\exceptions\ComponentNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a Component (Factory Pattern). + * + * @param string $componentName Name of the Component to instantiate + */ + public static function factory($componentName) + { + // Determine full classname + $className = self::getClassName($componentName); + + // Construct and return Controller + return new $className(); + } + + + /** + * Determine the classname for the given Component name. + * + * @param string $componentName Component name to get classname of + * @return string Classname for the Component name + */ + private static function getClassName($componentName) + { + $className = \nre\core\ClassLoader::concatClassNames($componentName, \nre\core\ClassLoader::stripNamespace(get_class())); + + + return \nre\configs\AppConfig::$app['namespace']."controllers\\components\\$className"; + } + + } + +?> diff --git a/core/Config.inc b/core/Config.inc new file mode 100644 index 00000000..adf858cd --- /dev/null +++ b/core/Config.inc @@ -0,0 +1,49 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Configuration. + * + * This class does not hold any configuration value but helps to + * determine values that can be hold by AppConfig or CoreConfig. + * + * @author coderkun + */ + final class Config + { + + + + + /** + * Get a default value. + * + * @param string $index Index of value to get + */ + public static function getDefault($index) + { + if(array_key_exists($index, \nre\configs\AppConfig::$defaults)) { + return \nre\configs\AppConfig::$defaults[$index]; + } + if(array_key_exists($index, \nre\configs\CoreConfig::$defaults)) { + return \nre\configs\CoreConfig::$defaults[$index]; + } + + + return null; + } + + } + +?> diff --git a/core/Controller.inc b/core/Controller.inc new file mode 100644 index 00000000..fd74a79f --- /dev/null +++ b/core/Controller.inc @@ -0,0 +1,431 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class for implementing a Controller. + * + * @author coderkun + */ + abstract class Controller + { + /** + * Corresponding Agent + * + * @var Agent + */ + protected $agent; + /** + * View of the Controller + * + * @var View + */ + protected $view = null; + /** + * Data to pass to the View + * + * @var array + */ + protected $viewData = array(); + /** + * Current request + * + * @var Request + */ + protected $request = null; + /** + * Current response + * + * @var Response + */ + protected $response = null; + + + + + /** + * Load the class of a Controller. + * + * @throws \nre\exceptions\ControllerNotFoundException + * @throws \nre\exceptions\ControllerNotValidException + * @param string $controllerName Name of the Controller to load + */ + public static function load($controllerName) + { + // Determine full classname + $className = self::getClassName($controllerName); + + try { + // Load class + ClassLoader::load($className); + + // Validate class + ClassLoader::check($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \nre\exceptions\ControllerNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \nre\exceptions\ControllerNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a Controller (Factory Pattern). + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @param string $controllerName Name of the Controller to instantiate + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param string $agent Corresponding Agent + */ + public static function factory($controllerName, $layoutName, $action, $agent) + { + // Determine full classname + $className = self::getClassName($controllerName); + + // Construct and return Controller + return new $className($layoutName, $action, $agent); + } + + + /** + * Determine the classname for the given Controller name. + * + * @param string $controllerName Controller name to get classname of + * @return string Classname for the Controller name + */ + private static function getClassName($controllerName) + { + $className = \nre\core\ClassLoader::concatClassNames($controllerName, \nre\core\ClassLoader::stripNamespace(get_class())); + + + return \nre\configs\AppConfig::$app['namespace']."controllers\\$className"; + } + + + + + /** + * Construct a new Controller. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + * @param Agent $agent Corresponding Agent + */ + protected function __construct($layoutName, $action, $agent) + { + // Store values + $this->agent = $agent; + + // Load Components + $this->loadComponents(); + + // Load Models + $this->loadModels(); + + // Load View + $this->loadView($layoutName, $action); + } + + + + + /** + * Prefilter that is executed before running the Controller. + * + * @param Request $request Current request + * @param Response $response Current response + */ + public function preFilter(Request $request, Response $response) + { + // Request speichern + $this->request = $request; + + // Response speichern + $this->response = $response; + + } + + + /** + * Prefilter that is executed after running the Controller. + * + * @param Request $request Current request + * @param Response $response Current response + */ + public function postFilter(Request $request, Response $response) + { + } + + + /** + * Run the Controller. + * + * This method executes the Action of the Controller defined by + * the current Request. + * + * @throws \nre\exceptions\ParamsNotValidException + * @throws \nre\exceptions\IdNotFoundException + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\ActionNotFoundException + * @param Request $request Current request + * @param Response $response Current response + */ + public function run(Request $request, Response $response) + { + // Determine Action + $action = $response->getParam(2, 'action'); + if(!method_exists($this, $action)) { + throw new \nre\exceptions\ActionNotFoundException($action); + } + + // Determine parameters + $params = $response->getParams(3); + if(empty($params)) { + $params = $request->getParams(3); + } + + // Fill missing parameters + $rc = new \ReflectionClass($this); + $nullParamsCount = $rc->getMethod($action)->getNumberOfParameters() - count($params); + $nullParams = ($nullParamsCount > 0 ? array_fill(0, $nullParamsCount, NULL) : array()); + + + // Call Action + call_user_func_array( + array( + $this, + $action + ), + array_merge( + $params, + $nullParams + ) + ); + } + + + /** + * Generate the output. + * + * @param array $viewData Data to pass to the View + * @return string Generated output + */ + public function render($viewData=null) + { + // Combine given data and data of this Controller + $data = $this->viewData; + if(!is_null($viewData)) { + $data = array_merge($viewData, $data); + } + + // Rendern and return output + return $this->view->render($data); + } + + + + + /** + * Set data for the View. + * + * @param string $name Key + * @param mixed $data Value + */ + protected function set($name, $data) + { + $this->viewData[$name] = $data; + } + + + /** + * Redirect to the given URL. + * + * @param string $url Relative URL + */ + protected function redirect($url) + { + $url = 'http://'.$_SERVER['HTTP_HOST'].$url; + header('Location: '.$url); + exit; + } + + + /** + * Check if Models of this Controller are loaded and available. + * + * @param string $modelName Arbitrary number of Models to check + * @return bool All given Models are loaded and available + */ + protected function checkModels($modelName) + { + foreach(func_get_args() as $modelName) + { + if(!isset($this->$modelName) || !is_subclass_of($this->$modelName, 'Model')) { + return false; + } + } + + + return true; + } + + + /** + * Get the View of the Controller + * + * @return View View of the Controller + */ + protected function getView() + { + return $this->view; + } + + + + + /** + * Load the Components of this Controller. + * + * @throws \nre\exceptions\ComponentNotValidException + * @throws \nre\exceptions\ComponentNotFoundException + */ + private function loadComponents() + { + // Determine components + $components = array(); + if(property_exists($this, 'components')) { + $components = $this->components; + } + if(!is_array($components)) { + $components = array($components); + } + // Components of parent classes + $parent = $this; + while($parent = get_parent_class($parent)) + { + $properties = get_class_vars($parent); + if(array_key_exists('components', $properties)) { + $components = array_merge($components, $properties['components']); + } + } + + // Load components + foreach($components as &$component) + { + // Load class + Component::load($component); + + // Construct component + $componentName = ucfirst(strtolower($component)); + $this->$componentName = Component::factory($component); + } + } + + + /** + * Load the Models of this Controller. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + */ + protected function loadModels() + { + // Determine Models + $explicit = false; + $models = \nre\core\ClassLoader::stripClassType(\nre\core\ClassLoader::stripNamespace(get_class($this))); + if(property_exists($this, 'models')) + { + $models = $this->models; + $explicit = true; + } + if(!is_array($models)) { + $models = array($models); + } + // Models of parent classes + $parent = $this; + while($parent = get_parent_class($parent)) + { + $properties = get_class_vars($parent); + if(array_key_exists('models', $properties)) { + $models = array_merge($models, $properties['models']); + } + } + $models = array_unique($models); + + // Load Models + foreach($models as &$model) + { + try { + // Load class + Model::load($model); + + // Construct Model + $modelName = ucfirst(strtolower($model)); + $this->$modelName = Model::factory($model); + } + catch(\nre\exceptions\ModelNotValidException $e) { + if($explicit) { + throw $e; + } + } + catch(\nre\exceptions\ModelNotFoundException $e) { + if($explicit) { + throw $e; + } + } + } + } + + + /** + * Load the View of this Controller. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of the current Layout + * @param string $action Current Action + */ + protected function loadView($layoutName, $action) + { + // Check Layout name + if(is_null($layoutName)) { + return; + } + + // Determine controller name + $controllerName = \nre\core\ClassLoader::getClassName(get_class($this)); + + + // Load view + $isToplevel = is_subclass_of($this->agent, '\nre\agents\ToplevelAgent'); + $this->view = View::loadAndFactory($layoutName, $controllerName, $action, $isToplevel); + } + + } + +?> diff --git a/core/Driver.inc b/core/Driver.inc new file mode 100644 index 00000000..ac2fa050 --- /dev/null +++ b/core/Driver.inc @@ -0,0 +1,97 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class for implementing a Driver. + * + * @author coderkun + */ + abstract class Driver + { + + + + + /** + * Load the class of a Driver. + * + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @param string $driverName Name of the Driver to load + */ + public static function load($driverName) + { + // Determine full classname + $className = self::getClassName($driverName); + + try { + // Load class + ClassLoader::load($className); + + // Validate class + ClassLoader::check($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \nre\exceptions\DriverNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \nre\exceptions\DriverNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a Driver (Factory Pattern). + * + * @param string $driverName Name of the Driver to instantiate + * @param array $config Configuration settings + */ + public static function factory($driverName, $config) + { + // Determine full classname + $className = self::getClassName($driverName); + + + // Construct and return Driver + return $className::singleton($config); + } + + + /** + * Determine the classname for the given Driver name. + * + * @param string $driverName Driver name to get classname of + * @return string Classname fore the Driver name + */ + private static function getClassName($driverName) + { + $className = ClassLoader::concatClassNames($driverName, ClassLoader::stripNamespace(get_class())); + + + return "\\nre\\drivers\\$className"; + } + + + + + /** + * Construct a new Driver. + */ + protected function __construct() + { + } + + } + +?> diff --git a/core/Exception.inc b/core/Exception.inc new file mode 100644 index 00000000..21ed842b --- /dev/null +++ b/core/Exception.inc @@ -0,0 +1,65 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Exception class. + * + * @author coderkun + */ + class Exception extends \Exception + { + + + + + /** + * Construct a new exception. + * + * @param string $message Error message + * @param int $code Error code + * @param string $name Name to insert + */ + function __construct($message, $code, $name=null) + { + parent::__construct( + $this->concat( + $message, + $name + ), + $code + ); + } + + + + + /** + * Insert the name in a message + * + * @param string $message Error message + * @param string $name Name to insert + */ + private function concat($message, $name) + { + if(is_null($name)) { + return $message; + } + + + return "$message: $name"; + } + + } + +?> diff --git a/core/Linker.inc b/core/Linker.inc new file mode 100644 index 00000000..68c1902f --- /dev/null +++ b/core/Linker.inc @@ -0,0 +1,313 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Class to create web links based on the current request. + * + * @author coderkun + */ + class Linker + { + /** + * Current request + * + * @var Request + */ + private $request; + + + + + /** + * Construct a new linker. + * + * @param Request $request Current request + */ + function __construct(\nre\requests\WebRequest $request) + { + $this->request = $request; + } + + + + + /** + * Mask parameters to be used in an URL. + * + * @param string $param1 First parameter + * @return string Masked parameters as string + */ + public static function createLinkParam($param1) + { + return implode( + \nre\configs\CoreConfig::$classes['linker']['url']['delimiter'], + call_user_func_array( + '\nre\core\Linker::createLinkParams', + func_get_args() + ) + ); + } + + + /** + * Mask parameters to be used in an URL. + * + * @param string $param1 First parameter + * @return string Masked parameters as array + */ + public static function createLinkParams($param1) + { + // Parameters + $linkParams = array(); + $params = func_get_args(); + + foreach($params as $param) + { + // Delete critical signs + $specials = array('/', '?', '&', '#'); + foreach($specials as &$special) { + $param = str_replace($special, '', $param); + } + + // Process parameter + $param = str_replace( + ' ', + \nre\configs\CoreConfig::$classes['linker']['url']['delimiter'], + substr( + $param, + 0, + \nre\configs\CoreConfig::$classes['linker']['url']['length'] + ) + ); + + // Encode parameter + $linkParams[] = $param; + } + + + // Return link parameters + return $linkParams; + } + + + + + /** + * Create a web link. + * + * @param array $params Parameters to use + * @param int $offset Ignore first parameters + * @param bool $exclusiveParams Use only the given parameters + * @param array $getParams GET-parameter to use + * @param bool $exclusiveGetParams Use only the given GET-parameters + * @param string $anchor Target anchor + * @param bool $absolute Include hostname etc. for an absolute URL + * @return string Created link + */ + public function link($params=null, $offset=0, $exclusiveParams=true, $getParams=null, $exclusiveGetParams=true, $anchor=null, $absolute=false) + { + // Make current request to response + $response = new \nre\responses\WebResponse(); + + + // Check parameters + if(is_null($params)) { + $params = array(); + } + elseif(!is_array($params)) { + $params = array($params); + } + + // Set parameters from request + $reqParams = array_slice($this->request->getParams(), 1, $offset); + if(count($reqParams) < $offset && $offset > 0) { + $reqParams[] = $this->request->getParam(1, 'intermediate'); + } + if(count($reqParams) < $offset && $offset > 1) { + $reqParams[] = $this->request->getParam(2, 'action'); + } + $params = array_merge($reqParams, $params); + + // Use Layout + $layout = \nre\configs\AppConfig::$defaults['toplevel']; + if(!empty($getParams) && array_key_exists('layout', $getParams)) { + $layout = $getParams['layout']; + } + array_unshift($params, $layout); + + // Use parameters from request only + if(!$exclusiveParams) + { + $params = array_merge( + $params, + array_slice( + $this->request->getParams(), + count($params) + ) + ); + } + + // Encode parameters + $params = array_map('rawurlencode', $params); + + // Set parameters + call_user_func_array( + array( + $response, + 'addParams' + ), + $params + ); + + + // Check GET-parameters + if(is_null($getParams)) { + $getParams = array(); + } + elseif(!is_array($params)) { + $params = array($params); + } + if(!$exclusiveGetParams) + { + $getParams = array_merge( + $this->request->getGetParams(), + $getParams + ); + } + + // Set GET-parameters + $response->addGetParams($getParams); + + + // Create and return link + return self::createLink($this->request, $response, $anchor, $absolute); + } + + + /** + * Create a link from an URL. + * + * @param string $url URL to create link from + * @param bool $absolute Create absolute URL + * @return string Created link + */ + public function hardlink($url, $absolute=false) + { + return $this->createUrl($url, $this->request, $absolute); + } + + + + + /** + * Create a link. + * + * @param Request $request Current request + * @param Response $response Current response + * @param string $anchor Anchor on target + * @param bool $absolute Create absolute link + * @return string Created link + */ + private static function createLink(Request $request, Response $response, $anchor=null, $absolute=false) + { + // Check response + if(is_null($response)) { + return null; + } + + + // Get parameters + $params = $response->getParams(1); + + // Check Action + if(count($params) == 2 && $params[1] == \nre\configs\CoreConfig::$defaults['action']) { + array_pop($params); + } + + // Set parameters + $link = implode('/', $params); + + // Apply reverse-routes + $link = $request->applyReverseRoutes($link); + + + // Get GET-parameters + $getParams = $response->getGetParams(); + + // Layout überprüfen + if(array_key_exists('layout', $getParams) && $getParams['layout'] == \nre\configs\AppConfig::$defaults['toplevel']) { + unset($getParams['layout']); + } + + // Set GET-parameters + if(array_key_exists('url', $getParams)) { + unset($getParams['url']); + } + if(count($getParams) > 0) { + $link .= '?'.http_build_query($getParams); + } + + // Add anchor + if(!is_null($anchor)) { + $link .= "#$anchor"; + } + + + // Create URL + $url = self::createUrl($link, $request, $absolute); + + + return $url; + } + + + /** + * Adapt a link to the environment. + * + * @param string $url URL + * @param Request $request Current request + * @param bool $absolute Create absolute URL + * @return string Adapted URL + */ + private static function createUrl($url, Request $request, $absolute=false) + { + // Variables + $server = $_SERVER['SERVER_NAME']; + $uri = $_SERVER['REQUEST_URI']; + $prefix = ''; + + + // Determine prefix + $ppos = array(strlen($uri)); + if(($p = strpos($uri, '/'.$request->getParam(1, 'intermediate'))) !== false) { + $ppos[] = $p; + } + $prefix = substr($uri, 0, min($ppos)); + + // Create absolute URL + if($absolute) { + $prefix = "http://$server/".trim($prefix, '/'); + } + + // Put URL together + $url = rtrim($prefix, '/').'/'.ltrim($url, '/'); + + + // Return URL + return $url; + } + + } + +?> diff --git a/core/Logger.inc b/core/Logger.inc new file mode 100644 index 00000000..0ea34757 --- /dev/null +++ b/core/Logger.inc @@ -0,0 +1,143 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Class to log messages to different targets. + * + * @author coderkun + */ + class Logger + { + /** + * Log mode: Detect automatic + * + * @var int + */ + const LOGMODE_AUTO = 0; + /** + * Log mode: Print to screen + * + * @var int + */ + const LOGMODE_SCREEN = 1; + /** + * Log mode: Use PHP-logging mechanism + * + * @var int + */ + const LOGMODE_PHP = 2; + + /** + * Do not auto-log to screen + * + * @var boolean + */ + private $autoLogToScreenDisabled = false; + + + + + /** + * Construct a new logger. + */ + public function __construct() + { + } + + + + + /** + * Log a message. + * + * @param string $message Message to log + * @param int $logMode Log mode to use + */ + public function log($message, $logMode=self::LOGMODE_SCREEN) + { + // Choose log mode automatically + if($logMode == self::LOGMODE_AUTO) { + $logMode = $this->getAutoLogMode(); + } + + // Print message to screen + if($logMode & self::LOGMODE_SCREEN) { + $this->logToScreen($message); + } + + // Use PHP-logging mechanism + if($logMode & self::LOGMODE_PHP) { + $this->logToPhp($message); + } + } + + + /** + * Disable logging to screen when the log mode is automatically + * detected. + */ + public function disableAutoLogToScreen() + { + $this->autoLogToScreenDisabled = true; + } + + + + /** + * Print a message to screen. + * + * @param string $message Message to print + */ + private function logToScreen($message) + { + echo "$message
\n"; + } + + + /** + * Log a message by using PHP-logging mechanism. + * + * @param string $message Message to log + */ + private function logToPhp($message) + { + error_log($message, 0); + } + + + /** + * Detect log mode automatically by distinguishing between + * production and test environment. + * + * @return int Automatically detected log mode + */ + private function getAutoLogMode() + { + return ($this->isLocalhost() && !$this->autoLogToScreenDisabled) ? self::LOGMODE_SCREEN : self::LOGMODE_PHP; + } + + + /** + * Detect if the server is running as localhost without domain. + * + * @return boolean Wheather server is running as localhost or not + */ + private function isLocalhost() + { + return ($_SERVER['SERVER_ADDR'] == '127.0.0.1' || $_SERVER['SERVER_ADDR'] = '::1'); + } + + } + +?> diff --git a/core/Model.inc b/core/Model.inc new file mode 100644 index 00000000..0ede5369 --- /dev/null +++ b/core/Model.inc @@ -0,0 +1,141 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Abstract class for implementing a Model. + * + * @author coderkun + */ + abstract class Model + { + + + + + /** + * Load the class of a Model. + * + * @throws \nre\exceptions\ModelNotFoundException + * @throws \nre\exceptions\ModelNotValidException + * @param string $modelName Name of the Model to load + */ + public static function load($modelName) + { + // Determine full classname + $className = self::getClassName($modelName); + + try { + // Load class + ClassLoader::load($className); + + // Validate class + ClassLoader::check($className, get_class()); + } + catch(\nre\exceptions\ClassNotValidException $e) { + throw new \nre\exceptions\ModelNotValidException($e->getClassName()); + } + catch(\nre\exceptions\ClassNotFoundException $e) { + throw new \nre\exceptions\ModelNotFoundException($e->getClassName()); + } + } + + + /** + * Instantiate a Model (Factory Pattern). + * + * @param string $modelName Name of the Model to instantiate + */ + public static function factory($modelName) + { + // Determine full classname + $className = self::getClassName($modelName); + + // Construct and return Model + return new $className(); + } + + + /** + * Determine the classname for the given Model name. + * + * @param string $modelName Model name to get classname of + * @return string Classname fore the Model name + */ + private static function getClassName($modelName) + { + $className = ClassLoader::concatClassNames($modelName, ClassLoader::stripNamespace(get_class())); + + + return \nre\configs\AppConfig::$app['namespace']."models\\$className"; + } + + + + + /** + * Construct a new Model. + * + * TODO Catch exception + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + */ + protected function __construct() + { + // Load Models + $this->loadModels(); + } + + + + + /** + * Load the Models of this Model. + * + * @throws \nre\exceptions\DatamodelException + * @throws \nre\exceptions\DriverNotFoundException + * @throws \nre\exceptions\DriverNotValidException + * @throws \nre\exceptions\ModelNotValidException + * @throws \nre\exceptions\ModelNotFoundException + */ + private function loadModels() + { + // Determine Models + $models = array(); + if(property_exists($this, 'models')) { + $models = $this->models; + } + if(!is_array($models)) { + $models = array($models); + } + + + // Load Models + foreach($models as $model) + { + // Load class + Model::load($model); + + // Construct Model + $modelName = ucfirst(strtolower($model)); + $this->$modelName = Model::factory($model); + } + } + + } + +?> diff --git a/core/Request.inc b/core/Request.inc new file mode 100644 index 00000000..efd9c834 --- /dev/null +++ b/core/Request.inc @@ -0,0 +1,64 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Base class to represent a request. + * + * @author coderkun + */ + class Request + { + /** + * Passed parameters + * + * @var array + */ + protected $params = array(); + + + + + /** + * Get a parameter. + * + * @param int $index Index of parameter + * @param string $defaultIndex Index of default configuration value for this parameter + * @return string Value of parameter + */ + public function getParam($index, $defaultIndex=null) + { + // Return parameter + if(count($this->params) > $index) { + return $this->params[$index]; + } + + // Return default value + return \nre\core\Config::getDefault($defaultIndex); + } + + + /** + * Get all parameters from index on. + * + * @param int $offset Offset-index + * @return array Parameter values + */ + public function getParams($offset=0) + { + return array_slice($this->params, $offset); + } + + } + +?> diff --git a/core/Response.inc b/core/Response.inc new file mode 100644 index 00000000..e273cba4 --- /dev/null +++ b/core/Response.inc @@ -0,0 +1,158 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Base class to represent a response. + * + * @author coderkun + */ + class Response + { + /** + * Applied parameters + * + * @var array + */ + protected $params = array(); + /** + * Generated output + * + * @var string + */ + private $output = ''; + /** + * Abort futher execution + * + * @var bool + */ + private $exit = false; + + + + + /** + * Add a parameter. + * + * @param mixed $value Value of parameter + */ + public function addParam($value) + { + $this->params[] = $value; + } + + + /** + * Add multiple parameters. + * + * @param mixed $value1 Value of first parameter + * @param mixed … Values of further parameters + */ + public function addParams($value1) + { + $this->params = array_merge( + $this->params, + func_get_args() + ); + } + + + /** + * Delete all stored parameters (from offset on). + * + * @param int $offset Offset-index + */ + public function clearParams($offset=0) + { + $this->params = array_slice($this->params, 0, $offset); + } + + + /** + * Get a parameter. + * + * @param int $index Index of parameter + * @param string $defaultIndex Index of default configuration value for this parameter + * @return string Value of parameter + */ + public function getParam($index, $defaultIndex=null) + { + // Return parameter + if(count($this->params) > $index) { + return $this->params[$index]; + } + + + // Return default value + return \nre\core\Config::getDefault($defaultIndex); + } + + + /** + * Get all parameters from index on. + * + * @param int $offset Offset-index + * @return array Parameter values + */ + public function getParams($offset=0) + { + return array_slice($this->params, $offset); + } + + + /** + * Set output. + * + * @param string $output Generated output + */ + public function setOutput($output) + { + $this->output = $output; + } + + + /** + * Get generated output. + * + * @return string Generated output + */ + public function getOutput() + { + return $this->output; + } + + + /** + * Set exit-state. + * + * @param bool $exit Abort further execution + */ + public function setExit($exit=true) + { + $this->exit = $exit; + } + + + /** + * Get exit-state. + * + * @return bool Abort further execution + */ + public function getExit() + { + return $this->exit; + } + + } + +?> diff --git a/core/View.inc b/core/View.inc new file mode 100644 index 00000000..386d37f8 --- /dev/null +++ b/core/View.inc @@ -0,0 +1,124 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * View. + * + * Class to encapsulate a template file and to provide rendering methods. + * + * @author coderkun + */ + class View + { + /** + * Template filename + * + * @var string + */ + protected $templateFilename; + + + + + /** + * Load and instantiate the View of an Agent. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of Layout in use + * @param string $agentName Name of the Agent + * @param string $action Current Action + * @param bool $isToplevel Agent is a ToplevelAgent + */ + public static function loadAndFactory($layoutName, $agentName=null, $action=null, $isToplevel=false) + { + return new View($layoutName, $agentName, $action, $isToplevel); + } + + + + + /** + * Construct a new View. + * + * @throws \nre\exceptions\ViewNotFoundException + * @param string $layoutName Name of Layout in use + * @param string $agentName Name of the Agent + * @param string $action Current Action + * @param bool $isToplevel Agent is a ToplevelAgent + */ + protected function __construct($layoutName, $agentName=null, $action=null, $isToplevel=false) + { + // Create template filename + // LayoutName + $fileName = ROOT.DS. \nre\configs\CoreConfig::getClassDir('views').DS. strtolower($layoutName).DS; + // AgentName and Action + if(strtolower($agentName) != strtolower($layoutName) || !$isToplevel) { + $fileName .= strtolower($agentName).DS.strtolower($action); + } + else { + $fileName .= strtolower($layoutName); + } + // File extension + $fileName .= \nre\configs\CoreConfig::getFileExt('views'); + + + // Check template file + if(!file_exists($fileName)) { + throw new \nre\exceptions\ViewNotFoundException($fileName); + } + + // Save filename + $this->templateFilename = $fileName; + } + + + + + /** + * Generate output + * + * @param array $data Data to have available in the template file + */ + public function render($data) + { + // Extract data + if(!is_null($data)) { + extract($data, EXTR_SKIP); + } + + // Buffer output + ob_start(); + + // Include template + include($this->templateFilename); + + + // Return buffered output + return ob_get_clean(); + } + + + /** + * Get template filename. + * + * @return string Template filename + */ + public function getTemplateFilename() + { + return $this->templateFilename; + } + + } + +?> diff --git a/core/WebUtils.inc b/core/WebUtils.inc new file mode 100644 index 00000000..ed726576 --- /dev/null +++ b/core/WebUtils.inc @@ -0,0 +1,75 @@ + + * @copyright 2013 coderkun (http://www.coderkun.de) + * @license http://www.gnu.org/licenses/gpl.html + * @link http://www.coderkun.de/projects/nre + */ + + namespace nre\core; + + + /** + * Class that holds several web-specific methods and properties. + * + * @author coderkun + */ + class WebUtils + { + /** + * HTTP-statuscode 403: Forbidden + * + * @var int + */ + const HTTP_FORBIDDEN = 403; + /** + * HTTP-statuscode 404: Not Found + * + * @var int + */ + const HTTP_NOT_FOUND = 404; + /** + * HTTP-statuscode 503: Service Unavailable + * + * @var int + */ + const HTTP_SERVICE_UNAVAILABLE = 503; + + /** + * HTTP-header strings + * + * @var array + */ + public static $httpStrings = array( + 200 => 'OK', + 304 => 'Not Modified', + 403 => 'Forbidden', + 404 => 'Not Found', + 503 => 'Service Unavailable' + ); + + + + + /** + * Get the HTTP-header of a HTTP-statuscode + * + * @param int $httpStatusCode HTTP-statuscode + * @return string HTTP-header of HTTP-statuscode + */ + public static function getHttpHeader($httpStatusCode) + { + if(!array_key_exists($httpStatusCode, self::$httpStrings)) { + $httpStatusCode = 200; + } + + + return sprintf("HTTP/1.1 %d %s\n", $httpStatusCode, self::$httpStrings[$httpStatusCode]); + } + + } + +?> diff --git a/db/create.sql b/db/create.sql new file mode 100644 index 00000000..57551f36 --- /dev/null +++ b/db/create.sql @@ -0,0 +1,1956 @@ +-- MySQL dump 10.15 Distrib 10.0.17-MariaDB, for Linux (x86_64) +-- +-- Host: localhost Database: z +-- ------------------------------------------------------ +-- Server version 10.0.17-MariaDB-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `achievementconditions` +-- + +DROP TABLE IF EXISTS `achievementconditions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementconditions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `condition` varchar(32) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievementconditions_achievement` +-- + +DROP TABLE IF EXISTS `achievementconditions_achievement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementconditions_achievement` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `achievement_id` int(11) NOT NULL, + `field` varchar(128) NOT NULL, + `count` tinyint(1) NOT NULL DEFAULT '0', + `value` int(11) NOT NULL, + `meta_achievement_id` int(11) DEFAULT NULL, + `groupby` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_user_id` (`created_user_id`), + KEY `achievement_id` (`achievement_id`), + KEY `meta_achievement_id` (`meta_achievement_id`), + CONSTRAINT `achievementconditions_achievement_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `achievementconditions_achievement_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `achievementconditions_achievement_ibfk_3` FOREIGN KEY (`meta_achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievementconditions_character` +-- + +DROP TABLE IF EXISTS `achievementconditions_character`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementconditions_character` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `achievement_id` int(11) NOT NULL, + `field` varchar(128) NOT NULL, + `value` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + KEY `created_user_id` (`created_user_id`), + KEY `achievement_id` (`achievement_id`), + CONSTRAINT `achievementconditions_character_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `achievementconditions_character_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievementconditions_date` +-- + +DROP TABLE IF EXISTS `achievementconditions_date`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementconditions_date` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `achievement_id` int(11) NOT NULL, + `select` varchar(512) NOT NULL, + PRIMARY KEY (`id`), + KEY `created_user_id` (`created_user_id`), + KEY `achievement_id` (`achievement_id`), + CONSTRAINT `achievementconditions_date_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `achievementconditions_date_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievementconditions_quest` +-- + +DROP TABLE IF EXISTS `achievementconditions_quest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementconditions_quest` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `achievement_id` int(11) NOT NULL, + `field` varchar(128) NOT NULL, + `count` tinyint(1) NOT NULL DEFAULT '0', + `value` int(11) NOT NULL, + `quest_id` int(11) DEFAULT NULL, + `status` tinyint(3) unsigned DEFAULT NULL, + `groupby` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_user_id` (`created_user_id`), + KEY `achievement_id` (`achievement_id`), + KEY `quest_id` (`quest_id`), + CONSTRAINT `achievementconditions_quest_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `achievementconditions_quest_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `achievementconditions_quest_ibfk_3` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievements` +-- + +DROP TABLE IF EXISTS `achievements`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievements` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `achievementcondition_id` int(11) NOT NULL, + `pos` int(10) unsigned NOT NULL DEFAULT '1', + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `description` text NOT NULL, + `progress` tinyint(1) NOT NULL, + `hidden` tinyint(1) NOT NULL DEFAULT '0', + `only_once` tinyint(1) NOT NULL DEFAULT '0', + `all_conditions` tinyint(1) NOT NULL DEFAULT '1', + `deadline` datetime DEFAULT NULL, + `unachieved_achievementsmedia_id` int(11) DEFAULT NULL, + `achieved_achievementsmedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`seminary_id`,`url`), + UNIQUE KEY `pos` (`seminary_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + KEY `achieved_seminarymedia_id` (`achieved_achievementsmedia_id`), + KEY `unachieved_seminarymedia_id` (`unachieved_achievementsmedia_id`), + KEY `achievementcondition_id` (`achievementcondition_id`), + CONSTRAINT `achievements_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `achievements_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `achievements_ibfk_3` FOREIGN KEY (`unachieved_achievementsmedia_id`) REFERENCES `achievementsmedia` (`seminarymedia_id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `achievements_ibfk_4` FOREIGN KEY (`achieved_achievementsmedia_id`) REFERENCES `achievementsmedia` (`seminarymedia_id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `achievements_ibfk_5` FOREIGN KEY (`achievementcondition_id`) REFERENCES `achievementconditions` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievements_characters` +-- + +DROP TABLE IF EXISTS `achievements_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievements_characters` ( + `achievement_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`achievement_id`,`character_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `achievements_characters_ibfk_1` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `achievements_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `achievementsmedia` +-- + +DROP TABLE IF EXISTS `achievementsmedia`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievementsmedia` ( + `seminarymedia_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`seminarymedia_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `achievementsmedia_ibfk_1` FOREIGN KEY (`seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `achievementsmedia_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `avatarpictures` +-- + +DROP TABLE IF EXISTS `avatarpictures`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `avatarpictures` ( + `seminarymedia_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`seminarymedia_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `avatarpictures_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `avatarpictures_ibfk_3` FOREIGN KEY (`seminarymedia_id`) REFERENCES `seminarymedia` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `avatars` +-- + +DROP TABLE IF EXISTS `avatars`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `avatars` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `charactertype_id` int(11) NOT NULL, + `xplevel_id` int(11) NOT NULL, + `avatarpicture_id` int(11) DEFAULT NULL, + `small_avatarpicture_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `charactertype_id_2` (`charactertype_id`,`xplevel_id`), + KEY `created_user_id` (`created_user_id`), + KEY `charactertype_id` (`charactertype_id`), + KEY `xplevel_id` (`xplevel_id`), + KEY `avatarpicture_id` (`avatarpicture_id`), + KEY `small_avatarpicture_id` (`small_avatarpicture_id`), + CONSTRAINT `avatars_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `avatars_ibfk_2` FOREIGN KEY (`charactertype_id`) REFERENCES `charactertypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `avatars_ibfk_3` FOREIGN KEY (`xplevel_id`) REFERENCES `xplevels` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `avatars_ibfk_4` FOREIGN KEY (`avatarpicture_id`) REFERENCES `avatarpictures` (`seminarymedia_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `avatars_ibfk_5` FOREIGN KEY (`small_avatarpicture_id`) REFERENCES `avatarpictures` (`seminarymedia_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `cache_charactergroups` +-- + +DROP TABLE IF EXISTS `cache_charactergroups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache_charactergroups` ( + `charactergroup_id` int(11) NOT NULL, + `xps` int(10) unsigned NOT NULL, + PRIMARY KEY (`charactergroup_id`), + CONSTRAINT `cache_charactergroups_ibfk_1` FOREIGN KEY (`charactergroup_id`) REFERENCES `charactergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_cache_charactergroups_insert` AFTER INSERT ON `cache_charactergroups` FOR EACH ROW BEGIN + CALL update_cache_characters_charactergroup(NEW.charactergroup_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_cache_charactergroups_update` AFTER UPDATE ON `cache_charactergroups` FOR EACH ROW BEGIN + CALL update_cache_characters_charactergroup(NEW.charactergroup_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `cache_characters` +-- + +DROP TABLE IF EXISTS `cache_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache_characters` ( + `character_id` int(11) NOT NULL, + `xps` int(10) unsigned NOT NULL, + `quest_xps` int(10) unsigned NOT NULL, + `xplevel_id` int(11) NOT NULL, + `avatar_id` int(11) NOT NULL, + PRIMARY KEY (`character_id`), + KEY `xplevel_id` (`xplevel_id`), + KEY `avatar_id` (`avatar_id`), + CONSTRAINT `cache_characters_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `cache_characters_ibfk_2` FOREIGN KEY (`xplevel_id`) REFERENCES `xplevels` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `cache_characters_ibfk_3` FOREIGN KEY (`avatar_id`) REFERENCES `avatars` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `charactergroups` +-- + +DROP TABLE IF EXISTS `charactergroups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `charactergroupsgroup_id` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(128) NOT NULL, + `motto` varchar(255) NOT NULL, + `charactergroupsmedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `charactergroupsgroup_id_2` (`charactergroupsgroup_id`,`name`), + UNIQUE KEY `charactergroupsgroup_id_3` (`charactergroupsgroup_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `charactergroupsgroup_id` (`charactergroupsgroup_id`), + KEY `charactergroupsmedia_id` (`charactergroupsmedia_id`), + CONSTRAINT `charactergroups_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `charactergroups_ibfk_3` FOREIGN KEY (`charactergroupsgroup_id`) REFERENCES `charactergroupsgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroups_ibfk_4` FOREIGN KEY (`charactergroupsmedia_id`) REFERENCES `charactergroupsmedia` (`seminarymedia_id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Charaktergruppen'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_charactergroups_insert` AFTER INSERT ON `charactergroups` FOR EACH ROW BEGIN + CALL update_cache_charactergroups(NEW.id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `charactergroupsgroups` +-- + +DROP TABLE IF EXISTS `charactergroupsgroups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroupsgroups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `preferred` tinyint(1) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `seminary_id_3` (`seminary_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + KEY `seminary_id_2` (`seminary_id`), + CONSTRAINT `charactergroupsgroups_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `charactergroupsgroups_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `charactergroupsmedia` +-- + +DROP TABLE IF EXISTS `charactergroupsmedia`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroupsmedia` ( + `seminarymedia_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`seminarymedia_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `charactergroupsmedia_ibfk_1` FOREIGN KEY (`seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsmedia_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `charactergroupsquests` +-- + +DROP TABLE IF EXISTS `charactergroupsquests`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroupsquests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `charactergroupsgroup_id` int(11) NOT NULL, + `questgroups_id` int(11) NOT NULL, + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `description` text NOT NULL, + `xps` int(10) unsigned NOT NULL, + `rules` text NOT NULL, + `won_text` text NOT NULL, + `lost_text` text NOT NULL, + `questsmedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `charactergroupsgroup_id_2` (`charactergroupsgroup_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `charactergroupsgroup_id` (`charactergroupsgroup_id`), + KEY `questgroups_id` (`questgroups_id`), + KEY `questsmedia_id` (`questsmedia_id`), + CONSTRAINT `charactergroupsquests_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `charactergroupsquests_ibfk_2` FOREIGN KEY (`charactergroupsgroup_id`) REFERENCES `charactergroupsgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsquests_ibfk_3` FOREIGN KEY (`questgroups_id`) REFERENCES `questgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsquests_ibfk_4` FOREIGN KEY (`questsmedia_id`) REFERENCES `questsmedia` (`media_id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_charactergroupsquests_update` AFTER UPDATE ON `charactergroupsquests` FOR EACH ROW BEGIN + CALL update_cache_charactergroups_charactergroupsquest(NEW.id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `charactergroupsquests_groups` +-- + +DROP TABLE IF EXISTS `charactergroupsquests_groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroupsquests_groups` ( + `charactergroupsquest_id` int(11) NOT NULL, + `charactergroup_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `xps_factor` float NOT NULL, + PRIMARY KEY (`charactergroupsquest_id`,`charactergroup_id`), + KEY `charactergroup_id` (`charactergroup_id`), + CONSTRAINT `charactergroupsquests_groups_ibfk_1` FOREIGN KEY (`charactergroupsquest_id`) REFERENCES `charactergroupsquests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsquests_groups_ibfk_2` FOREIGN KEY (`charactergroup_id`) REFERENCES `charactergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_charactergroupsquests_groups_insert` AFTER INSERT ON `charactergroupsquests_groups` FOR EACH ROW BEGIN + CALL update_cache_charactergroups(NEW.charactergroup_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_charactergroupsquests_groups_update` AFTER UPDATE ON `charactergroupsquests_groups` FOR EACH ROW BEGIN + CALL update_cache_charactergroups(OLD.charactergroup_id); + CALL update_cache_charactergroups(NEW.charactergroup_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_charactergroupsquests_groups_delete` AFTER DELETE ON `charactergroupsquests_groups` FOR EACH ROW BEGIN + CALL update_cache_charactergroups(OLD.charactergroup_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `charactergroupsquests_seminaryuploads` +-- + +DROP TABLE IF EXISTS `charactergroupsquests_seminaryuploads`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactergroupsquests_seminaryuploads` ( + `seminaryupload_id` int(11) NOT NULL, + `charactergroupsquest_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`seminaryupload_id`), + KEY `charactergroupsquest_id` (`charactergroupsquest_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `charactergroupsquests_seminaryuploads_ibfk_1` FOREIGN KEY (`seminaryupload_id`) REFERENCES `seminaryuploads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsquests_seminaryuploads_ibfk_2` FOREIGN KEY (`charactergroupsquest_id`) REFERENCES `charactergroupsquests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `charactergroupsquests_seminaryuploads_ibfk_3` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `characterroles` +-- + +DROP TABLE IF EXISTS `characterroles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characterroles` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `characters` +-- + +DROP TABLE IF EXISTS `characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characters` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `user_id` int(11) NOT NULL, + `charactertype_id` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `charactertype_id` (`charactertype_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `characters_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `characters_ibfk_2` FOREIGN KEY (`charactertype_id`) REFERENCES `charactertypes` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Charaktere'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_characters_insert` AFTER INSERT ON `characters` FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `characters_charactergroups` +-- + +DROP TABLE IF EXISTS `characters_charactergroups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characters_charactergroups` ( + `character_id` int(11) NOT NULL, + `charactergroup_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`character_id`,`charactergroup_id`), + KEY `charactergroup_id` (`charactergroup_id`), + CONSTRAINT `characters_charactergroups_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `characters_charactergroups_ibfk_2` FOREIGN KEY (`charactergroup_id`) REFERENCES `charactergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_characters_charactergroups_insert` AFTER INSERT ON `characters_charactergroups` FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_characters_charactergroups_update` AFTER UPDATE ON `characters_charactergroups` FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); + CALL update_cache_characters(NEW.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_characters_charactergroups_delete` AFTER DELETE ON `characters_charactergroups` FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `characters_characterroles` +-- + +DROP TABLE IF EXISTS `characters_characterroles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characters_characterroles` ( + `character_id` int(11) NOT NULL, + `characterrole_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`character_id`,`characterrole_id`), + KEY `userseminaryrole_id` (`characterrole_id`), + CONSTRAINT `characters_characterroles_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `characters_characterroles_ibfk_2` FOREIGN KEY (`characterrole_id`) REFERENCES `characterroles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `characters_seminarycharacterfields` +-- + +DROP TABLE IF EXISTS `characters_seminarycharacterfields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characters_seminarycharacterfields` ( + `character_id` int(11) NOT NULL, + `seminarycharacterfield_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `value` varchar(256) NOT NULL, + PRIMARY KEY (`character_id`,`seminarycharacterfield_id`), + KEY `seminarycharacterfield_id` (`seminarycharacterfield_id`), + CONSTRAINT `characters_seminarycharacterfields_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `characters_seminarycharacterfields_ibfk_2` FOREIGN KEY (`seminarycharacterfield_id`) REFERENCES `seminarycharacterfields` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `charactertypes` +-- + +DROP TABLE IF EXISTS `charactertypes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `charactertypes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `name` varchar(128) NOT NULL, + `url` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`,`seminary_id`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `charactertypes_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `charactertypes_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Charaktertypen'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `maps` +-- + +DROP TABLE IF EXISTS `maps`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `maps` ( + `seminary_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `seminarymedia_id` int(11) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + PRIMARY KEY (`seminary_id`), + KEY `seminarymedia_id` (`seminarymedia_id`), + CONSTRAINT `maps_ibfk_1` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`), + CONSTRAINT `maps_ibfk_2` FOREIGN KEY (`seminarymedia_id`) REFERENCES `seminarymedia` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `media` +-- + +DROP TABLE IF EXISTS `media`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `media` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `description` varchar(128) NOT NULL, + `mimetype` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `seminary_id_2` (`name`), + UNIQUE KEY `seminary_id_3` (`url`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `media_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroups` +-- + +DROP TABLE IF EXISTS `questgroups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `title` varchar(128) NOT NULL, + `url` varchar(128) NOT NULL, + `questgroupspicture_id` int(11) DEFAULT NULL, + `achievable_xps` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `title` (`seminary_id`,`title`), + KEY `created_user_id` (`created_user_id`), + KEY `questgroupspicture_id` (`questgroupspicture_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `questgroups_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questgroups_ibfk_4` FOREIGN KEY (`questgroupspicture_id`) REFERENCES `questgroupspictures` (`media_id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `questgroups_ibfk_5` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Aufgabengruppen'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroups_characters` +-- + +DROP TABLE IF EXISTS `questgroups_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroups_characters` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questgroup_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `status` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `questgroup_id` (`questgroup_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questgroups_characters_ibfk_1` FOREIGN KEY (`questgroup_id`) REFERENCES `questgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questgroups_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroups_questgroupshierarchy` +-- + +DROP TABLE IF EXISTS `questgroups_questgroupshierarchy`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroups_questgroupshierarchy` ( + `questgroup_id` int(11) NOT NULL, + `questgroupshierarchy_id` int(11) NOT NULL, + `parent_questgroup_id` int(11) DEFAULT NULL, + `pos` int(10) unsigned NOT NULL, + PRIMARY KEY (`questgroup_id`), + UNIQUE KEY `pos` (`parent_questgroup_id`,`pos`), + KEY `parent_questgoup_id` (`parent_questgroup_id`), + KEY `questgroupshierarchy_id` (`questgroupshierarchy_id`), + CONSTRAINT `questgroups_questgroupshierarchy_ibfk_1` FOREIGN KEY (`questgroup_id`) REFERENCES `questgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questgroups_questgroupshierarchy_ibfk_2` FOREIGN KEY (`questgroupshierarchy_id`) REFERENCES `questgroupshierarchy` (`id`), + CONSTRAINT `questgroups_questgroupshierarchy_ibfk_3` FOREIGN KEY (`parent_questgroup_id`) REFERENCES `questgroups` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroups_questtexts` +-- + +DROP TABLE IF EXISTS `questgroups_questtexts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroups_questtexts` ( + `questgroup_id` int(11) NOT NULL, + `questtext_id` int(11) NOT NULL, + `entry_text` text NOT NULL, + PRIMARY KEY (`questgroup_id`,`questtext_id`), + KEY `questtext_id` (`questtext_id`), + CONSTRAINT `questgroups_questtexts_ibfk_1` FOREIGN KEY (`questgroup_id`) REFERENCES `questgroups` (`id`), + CONSTRAINT `questgroups_questtexts_ibfk_2` FOREIGN KEY (`questtext_id`) REFERENCES `questtexts` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroupshierarchy` +-- + +DROP TABLE IF EXISTS `questgroupshierarchy`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroupshierarchy` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `parent_questgroupshierarchy_id` int(11) DEFAULT NULL, + `pos` int(10) unsigned NOT NULL, + `title_singular` varchar(128) NOT NULL, + `title_plural` varchar(128) NOT NULL, + `url` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `pos` (`parent_questgroupshierarchy_id`,`pos`), + UNIQUE KEY `url` (`seminary_id`,`parent_questgroupshierarchy_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + KEY `parent_questhierarchy_id` (`parent_questgroupshierarchy_id`), + CONSTRAINT `questgroupshierarchy_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questgroupshierarchy_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questgroupshierarchy_ibfk_3` FOREIGN KEY (`parent_questgroupshierarchy_id`) REFERENCES `questgroupshierarchy` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Aufgabengruppenhierarchie'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgroupspictures` +-- + +DROP TABLE IF EXISTS `questgroupspictures`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgroupspictures` ( + `media_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`media_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `questgroupspictures_ibfk_1` FOREIGN KEY (`media_id`) REFERENCES `seminarymedia` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questgroupspictures_ibfk_3` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questgrouptexts` +-- + +DROP TABLE IF EXISTS `questgrouptexts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questgrouptexts` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questgroup_id` int(11) NOT NULL, + `pos` int(11) NOT NULL DEFAULT '1', + `text` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questgroup_id_2` (`questgroup_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `questgroup_id` (`questgroup_id`), + CONSTRAINT `questgrouptexts_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questgrouptexts_ibfk_2` FOREIGN KEY (`questgroup_id`) REFERENCES `questgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `quests` +-- + +DROP TABLE IF EXISTS `quests`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questgroup_id` int(11) NOT NULL, + `questtype_id` int(11) NOT NULL, + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `xps` int(11) unsigned NOT NULL, + `entry_text` text, + `wrong_text` text NOT NULL, + `task` text NOT NULL, + `questsmedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questgroup_id_url` (`questgroup_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `questtype_id` (`questtype_id`), + KEY `questmedia_id` (`questsmedia_id`), + KEY `questgroup_id` (`questgroup_id`), + CONSTRAINT `quests_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `quests_ibfk_2` FOREIGN KEY (`questtype_id`) REFERENCES `questtypes` (`id`), + CONSTRAINT `quests_ibfk_4` FOREIGN KEY (`questgroup_id`) REFERENCES `questgroups` (`id`), + CONSTRAINT `quests_ibfk_5` FOREIGN KEY (`questsmedia_id`) REFERENCES `questsmedia` (`media_id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_quests_update` AFTER UPDATE ON `quests` FOR EACH ROW BEGIN + CALL update_cache_characters_quest(NEW.id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `quests_characters` +-- + +DROP TABLE IF EXISTS `quests_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quests_characters` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `quest_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `status` tinyint(4) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `quest_id` (`quest_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `quests_characters_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `quests_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_quests_characters_insert` AFTER INSERT ON `quests_characters` FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_quests_characters_update` AFTER UPDATE ON `quests_characters` FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); + CALL update_cache_characters(NEW.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`z`@`%`*/ /*!50003 TRIGGER `update_cache_quests_characters_delete` AFTER DELETE ON `quests_characters` FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Table structure for table `quests_previousquests` +-- + +DROP TABLE IF EXISTS `quests_previousquests`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quests_previousquests` ( + `quest_id` int(11) NOT NULL, + `previous_quest_id` int(11) NOT NULL, + PRIMARY KEY (`quest_id`,`previous_quest_id`), + KEY `previous_quest_id` (`previous_quest_id`), + CONSTRAINT `quests_previousquests_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `quests_previousquests_ibfk_2` FOREIGN KEY (`previous_quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Vorherige Aufgaben'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `quests_questsubtopics` +-- + +DROP TABLE IF EXISTS `quests_questsubtopics`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quests_questsubtopics` ( + `quest_id` int(11) NOT NULL, + `questsubtopic_id` int(11) NOT NULL, + PRIMARY KEY (`quest_id`,`questsubtopic_id`), + KEY `questsubtopic_id` (`questsubtopic_id`), + CONSTRAINT `quests_questsubtopics_ibfk_3` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `quests_questsubtopics_ibfk_4` FOREIGN KEY (`questsubtopic_id`) REFERENCES `questsubtopics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questsmedia` +-- + +DROP TABLE IF EXISTS `questsmedia`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questsmedia` ( + `media_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`media_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `questsmedia_ibfk_1` FOREIGN KEY (`media_id`) REFERENCES `seminarymedia` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questsmedia_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questsubtopics` +-- + +DROP TABLE IF EXISTS `questsubtopics`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questsubtopics` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questtopic_id` int(11) NOT NULL, + `title` varchar(255) NOT NULL, + `url` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `title` (`title`,`questtopic_id`), + KEY `created_user_id` (`created_user_id`), + KEY `questtopic_id` (`questtopic_id`), + CONSTRAINT `questsubtopics_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questsubtopics_ibfk_2` FOREIGN KEY (`questtopic_id`) REFERENCES `questtopics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Aufgabenbereiche'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtexts` +-- + +DROP TABLE IF EXISTS `questtexts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtexts` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `quest_id` int(11) NOT NULL, + `questtexttype_id` int(11) NOT NULL, + `pos` int(11) NOT NULL DEFAULT '1', + `text` text NOT NULL, + `out_text` text NOT NULL, + `abort_text` text NOT NULL, + `questsmedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `quest_id_2` (`quest_id`,`questtexttype_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `quest_id` (`quest_id`), + KEY `questtexttype_id` (`questtexttype_id`), + KEY `questsmedia_id` (`questsmedia_id`), + CONSTRAINT `questtexts_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtexts_ibfk_3` FOREIGN KEY (`questtexttype_id`) REFERENCES `questtexttypes` (`id`), + CONSTRAINT `questtexts_ibfk_4` FOREIGN KEY (`questsmedia_id`) REFERENCES `questsmedia` (`media_id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `questtexts_ibfk_5` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtexttypes` +-- + +DROP TABLE IF EXISTS `questtexttypes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtexttypes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `type` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `type` (`type`), + UNIQUE KEY `url` (`url`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtopics` +-- + +DROP TABLE IF EXISTS `questtopics`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtopics` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `title` varchar(255) NOT NULL, + `url` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`seminary_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `questtopics_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtopics_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Aufgabenbereiche'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes` +-- + +DROP TABLE IF EXISTS `questtypes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `classname` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `title` (`title`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_bossfight` +-- + +DROP TABLE IF EXISTS `questtypes_bossfight`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_bossfight` ( + `quest_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `bossname` varchar(64) NOT NULL, + `boss_seminarymedia_id` int(11) NOT NULL, + `lives_character` smallint(5) unsigned NOT NULL, + `lives_boss` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`quest_id`), + KEY `created_user_id` (`created_user_id`), + KEY `boss_seminarymedia_id` (`boss_seminarymedia_id`), + CONSTRAINT `questtypes_bossfight_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_bossfight_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_bossfight_ibfk_3` FOREIGN KEY (`boss_seminarymedia_id`) REFERENCES `seminarymedia` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_bossfight_stages` +-- + +DROP TABLE IF EXISTS `questtypes_bossfight_stages`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_bossfight_stages` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questtypes_bossfight_quest_id` int(11) NOT NULL, + `parent_stage_id` int(11) DEFAULT NULL, + `text` text NOT NULL, + `question` varchar(255) NOT NULL, + `livedrain_character` smallint(6) NOT NULL, + `livedrain_boss` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + KEY `parent_stage_id` (`parent_stage_id`), + KEY `questtypes_bossfight_quest_id` (`questtypes_bossfight_quest_id`), + CONSTRAINT `questtypes_bossfight_stages_ibfk_1` FOREIGN KEY (`questtypes_bossfight_quest_id`) REFERENCES `questtypes_bossfight` (`quest_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_bossfight_stages_ibfk_2` FOREIGN KEY (`parent_stage_id`) REFERENCES `questtypes_bossfight_stages` (`id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_bossfight_stages_characters` +-- + +DROP TABLE IF EXISTS `questtypes_bossfight_stages_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_bossfight_stages_characters` ( + `questtypes_bossfight_stage_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`questtypes_bossfight_stage_id`,`character_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questtypes_bossfight_stages_characters_ibfk_1` FOREIGN KEY (`questtypes_bossfight_stage_id`) REFERENCES `questtypes_bossfight_stages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_bossfight_stages_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_choiceinput` +-- + +DROP TABLE IF EXISTS `questtypes_choiceinput`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_choiceinput` ( + `quest_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `text` text NOT NULL, + PRIMARY KEY (`quest_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `questtypes_choiceinput_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_choiceinput_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_choiceinput_choices` +-- + +DROP TABLE IF EXISTS `questtypes_choiceinput_choices`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_choiceinput_choices` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questtypes_choiceinput_list_id` int(11) NOT NULL, + `pos` int(10) unsigned NOT NULL DEFAULT '1', + `text` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questtypes_choiceinput_list_id` (`questtypes_choiceinput_list_id`,`pos`), + CONSTRAINT `questtypes_choiceinput_choices_ibfk_1` FOREIGN KEY (`questtypes_choiceinput_list_id`) REFERENCES `questtypes_choiceinput_lists` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_choiceinput_lists` +-- + +DROP TABLE IF EXISTS `questtypes_choiceinput_lists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_choiceinput_lists` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questtypes_choiceinput_quest_id` int(11) NOT NULL, + `number` int(10) unsigned NOT NULL, + `questtypes_choiceinput_choice_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questtypes_textinput_quest_id` (`questtypes_choiceinput_quest_id`,`number`), + KEY `questtypes_choiceinput_choice_id` (`questtypes_choiceinput_choice_id`), + CONSTRAINT `questtypes_choiceinput_lists_ibfk_1` FOREIGN KEY (`questtypes_choiceinput_quest_id`) REFERENCES `questtypes_choiceinput` (`quest_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_choiceinput_lists_ibfk_2` FOREIGN KEY (`questtypes_choiceinput_choice_id`) REFERENCES `questtypes_choiceinput_choices` (`id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_choiceinput_lists_characters` +-- + +DROP TABLE IF EXISTS `questtypes_choiceinput_lists_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_choiceinput_lists_characters` ( + `character_id` int(11) NOT NULL, + `questtypes_choiceinput_list_id` int(11) NOT NULL, + `questtypes_choiceinput_choice_id` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`character_id`,`questtypes_choiceinput_list_id`), + KEY `questtypes_choiceinput_choice_id` (`questtypes_choiceinput_choice_id`), + KEY `questtypes_choiceinput_list_id` (`questtypes_choiceinput_list_id`), + CONSTRAINT `questtypes_choiceinput_lists_characters_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_choiceinput_lists_characters_ibfk_2` FOREIGN KEY (`questtypes_choiceinput_list_id`) REFERENCES `questtypes_choiceinput_lists` (`id`), + CONSTRAINT `questtypes_choiceinput_lists_characters_ibfk_3` FOREIGN KEY (`questtypes_choiceinput_choice_id`) REFERENCES `questtypes_choiceinput_choices` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_crossword_words` +-- + +DROP TABLE IF EXISTS `questtypes_crossword_words`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_crossword_words` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `quest_id` int(11) NOT NULL, + `question` text NOT NULL, + `word` varchar(64) NOT NULL, + `vertical` tinyint(1) NOT NULL, + `pos_x` int(10) unsigned NOT NULL, + `pos_y` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `quest_id_2` (`quest_id`,`vertical`,`pos_x`,`pos_y`), + KEY `quest_id` (`quest_id`), + CONSTRAINT `questtypes_crossword_words_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_crossword_words_characters` +-- + +DROP TABLE IF EXISTS `questtypes_crossword_words_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_crossword_words_characters` ( + `questtypes_crossword_word_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `answer` varchar(64) NOT NULL, + PRIMARY KEY (`questtypes_crossword_word_id`,`character_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questtypes_crossword_words_characters_ibfk_1` FOREIGN KEY (`questtypes_crossword_word_id`) REFERENCES `questtypes_crossword_words` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_crossword_words_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_dragndrop` +-- + +DROP TABLE IF EXISTS `questtypes_dragndrop`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_dragndrop` ( + `quest_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questmedia_id` int(11) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + PRIMARY KEY (`quest_id`), + KEY `questmedia_id` (`questmedia_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `questtypes_dragndrop_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_dragndrop_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_dragndrop_ibfk_3` FOREIGN KEY (`questmedia_id`) REFERENCES `questsmedia` (`media_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_dragndrop_drags` +-- + +DROP TABLE IF EXISTS `questtypes_dragndrop_drags`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_dragndrop_drags` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `questtypes_dragndrop_id` int(11) NOT NULL, + `questmedia_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `questtypes_dragndrop_id` (`questtypes_dragndrop_id`), + KEY `questmedia_id` (`questmedia_id`), + CONSTRAINT `questtypes_dragndrop_drags_ibfk_1` FOREIGN KEY (`questtypes_dragndrop_id`) REFERENCES `questtypes_dragndrop` (`quest_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_dragndrop_drags_ibfk_2` FOREIGN KEY (`questmedia_id`) REFERENCES `questsmedia` (`media_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_dragndrop_drops` +-- + +DROP TABLE IF EXISTS `questtypes_dragndrop_drops`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_dragndrop_drops` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questtypes_dragndrop_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `top` int(11) NOT NULL, + `left` int(11) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `questtypes_dragndrop_id` (`questtypes_dragndrop_id`), + CONSTRAINT `questtypes_dragndrop_drops_ibfk_4` FOREIGN KEY (`questtypes_dragndrop_id`) REFERENCES `questtypes_dragndrop` (`quest_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_dragndrop_drops_characters` +-- + +DROP TABLE IF EXISTS `questtypes_dragndrop_drops_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_dragndrop_drops_characters` ( + `questtypes_dragndrop_drop_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `questtypes_dragndrop_drag_id` int(11) NOT NULL, + PRIMARY KEY (`questtypes_dragndrop_drop_id`,`character_id`), + KEY `questtypes_dragndrop_drag_id` (`questtypes_dragndrop_drag_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questtypes_dragndrop_drops_characters_ibfk_1` FOREIGN KEY (`questtypes_dragndrop_drop_id`) REFERENCES `questtypes_dragndrop_drops` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_dragndrop_drops_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_dragndrop_drops_characters_ibfk_3` FOREIGN KEY (`questtypes_dragndrop_drag_id`) REFERENCES `questtypes_dragndrop_drags` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_dragndrop_drops_drags` +-- + +DROP TABLE IF EXISTS `questtypes_dragndrop_drops_drags`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_dragndrop_drops_drags` ( + `questtypes_dragndrop_drop_id` int(11) NOT NULL, + `questtypes_dragndrop_drag_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + PRIMARY KEY (`questtypes_dragndrop_drop_id`,`questtypes_dragndrop_drag_id`), + KEY `created_user_id` (`created_user_id`), + KEY `questtypes_dragndrop_drag_id` (`questtypes_dragndrop_drag_id`), + CONSTRAINT `questtypes_dragndrop_drops_drags_ibfk_1` FOREIGN KEY (`questtypes_dragndrop_drop_id`) REFERENCES `questtypes_dragndrop_drops` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_dragndrop_drops_drags_ibfk_3` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_dragndrop_drops_drags_ibfk_4` FOREIGN KEY (`questtypes_dragndrop_drag_id`) REFERENCES `questtypes_dragndrop_drags` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_multiplechoice` +-- + +DROP TABLE IF EXISTS `questtypes_multiplechoice`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_multiplechoice` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `quest_id` int(11) NOT NULL, + `pos` int(10) unsigned NOT NULL DEFAULT '1', + `question` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `quest_id_2` (`quest_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `quest_id` (`quest_id`), + CONSTRAINT `questtypes_multiplechoice_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_multiplechoice_ibfk_2` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_multiplechoice_answers` +-- + +DROP TABLE IF EXISTS `questtypes_multiplechoice_answers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_multiplechoice_answers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questtypes_multiplechoice_id` int(11) NOT NULL, + `pos` int(11) NOT NULL, + `answer` varchar(255) NOT NULL, + `tick` tinyint(1) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questtypes_multiplechoice_id_2` (`questtypes_multiplechoice_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `questtypes_multiplechoice_id` (`questtypes_multiplechoice_id`), + CONSTRAINT `questtypes_multiplechoice_answers_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_multiplechoice_answers_ibfk_2` FOREIGN KEY (`questtypes_multiplechoice_id`) REFERENCES `questtypes_multiplechoice` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_multiplechoice_characters` +-- + +DROP TABLE IF EXISTS `questtypes_multiplechoice_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_multiplechoice_characters` ( + `questtypes_multiplechoice_answer_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `ticked` tinyint(1) NOT NULL, + PRIMARY KEY (`questtypes_multiplechoice_answer_id`,`character_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questtypes_multiplechoice_characters_ibfk_1` FOREIGN KEY (`questtypes_multiplechoice_answer_id`) REFERENCES `questtypes_multiplechoice_answers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_multiplechoice_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_submit_characters` +-- + +DROP TABLE IF EXISTS `questtypes_submit_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_submit_characters` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `quest_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `upload_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `character_id` (`character_id`), + KEY `upload_id` (`upload_id`), + KEY `quest_id` (`quest_id`), + CONSTRAINT `questtypes_submit_characters_ibfk_3` FOREIGN KEY (`upload_id`) REFERENCES `seminaryuploads` (`id`), + CONSTRAINT `questtypes_submit_characters_ibfk_4` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_submit_characters_ibfk_5` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_submit_characters_comments` +-- + +DROP TABLE IF EXISTS `questtypes_submit_characters_comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_submit_characters_comments` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `questtypes_submit_character_id` int(11) NOT NULL, + `comment` text NOT NULL, + PRIMARY KEY (`id`), + KEY `created_user_id` (`created_user_id`), + KEY `questtypes_submit_character_id` (`questtypes_submit_character_id`), + CONSTRAINT `questtypes_submit_characters_comments_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_submit_characters_comments_ibfk_2` FOREIGN KEY (`questtypes_submit_character_id`) REFERENCES `questtypes_submit_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_submit_mimetypes` +-- + +DROP TABLE IF EXISTS `questtypes_submit_mimetypes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_submit_mimetypes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `mimetype` varchar(32) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `mimetype` (`mimetype`,`seminary_id`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `questtypes_submit_mimetypes_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `questtypes_submit_mimetypes_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_textinput` +-- + +DROP TABLE IF EXISTS `questtypes_textinput`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_textinput` ( + `quest_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `text` text NOT NULL, + PRIMARY KEY (`quest_id`), + KEY `created_user_id` (`created_user_id`), + CONSTRAINT `questtypes_textinput_ibfk_1` FOREIGN KEY (`quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_textinput_ibfk_2` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_textinput_fields` +-- + +DROP TABLE IF EXISTS `questtypes_textinput_fields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_textinput_fields` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `questtypes_textinput_quest_id` int(11) NOT NULL, + `number` int(10) unsigned NOT NULL, + `questtypes_textinput_fieldsize_id` int(11) NOT NULL DEFAULT '1', + `regex` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `questtypes_textinput_quest_id` (`questtypes_textinput_quest_id`,`number`), + KEY `questtypes_textinput_fieldsize_id` (`questtypes_textinput_fieldsize_id`), + CONSTRAINT `questtypes_textinput_fields_ibfk_1` FOREIGN KEY (`questtypes_textinput_quest_id`) REFERENCES `quests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_textinput_fields_ibfk_2` FOREIGN KEY (`questtypes_textinput_fieldsize_id`) REFERENCES `questtypes_textinput_fieldsizes` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_textinput_fields_characters` +-- + +DROP TABLE IF EXISTS `questtypes_textinput_fields_characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_textinput_fields_characters` ( + `questtypes_textinput_field_id` int(11) NOT NULL, + `character_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`questtypes_textinput_field_id`,`character_id`), + KEY `character_id` (`character_id`), + CONSTRAINT `questtypes_textinput_fields_characters_ibfk_2` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `questtypes_textinput_fields_characters_ibfk_3` FOREIGN KEY (`questtypes_textinput_field_id`) REFERENCES `questtypes_textinput_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `questtypes_textinput_fieldsizes` +-- + +DROP TABLE IF EXISTS `questtypes_textinput_fieldsizes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `questtypes_textinput_fieldsizes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `size` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `size` (`size`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `seminaries` +-- + +DROP TABLE IF EXISTS `seminaries`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `seminaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `title` varchar(255) NOT NULL, + `url` varchar(128) NOT NULL, + `course` varchar(255) NOT NULL, + `description` text NOT NULL, + `seminarymedia_id` int(11) DEFAULT NULL, + `charactergroups_seminarymedia_id` int(11) DEFAULT NULL, + `achievements_seminarymedia_id` int(11) DEFAULT NULL, + `library_seminarymedia_id` int(11) DEFAULT NULL, + `map_seminarymedia_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `title` (`title`), + UNIQUE KEY `url` (`url`), + KEY `created_user_id` (`created_user_id`), + KEY `media_id` (`seminarymedia_id`), + KEY `charactergroups_seminarymedia_id` (`charactergroups_seminarymedia_id`), + KEY `achievements_seminarymedia_id` (`achievements_seminarymedia_id`), + KEY `library_seminarymedia_id` (`library_seminarymedia_id`), + KEY `map_seminarymedia_id` (`map_seminarymedia_id`), + CONSTRAINT `seminaries_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `seminaries_ibfk_2` FOREIGN KEY (`seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `seminaries_ibfk_3` FOREIGN KEY (`charactergroups_seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `seminaries_ibfk_4` FOREIGN KEY (`achievements_seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `seminaries_ibfk_5` FOREIGN KEY (`library_seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `seminaries_ibfk_6` FOREIGN KEY (`map_seminarymedia_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Lehrveranstaltungen'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `seminarycharacterfields` +-- + +DROP TABLE IF EXISTS `seminarycharacterfields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `seminarycharacterfields` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `pos` int(10) unsigned NOT NULL, + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `seminarycharacterfieldtype_id` int(11) NOT NULL, + `regex` varchar(512) NOT NULL, + `required` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`seminary_id`,`url`), + UNIQUE KEY `seminary_id_2` (`seminary_id`,`pos`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + KEY `seminarycharacterfieldtype_id` (`seminarycharacterfieldtype_id`), + CONSTRAINT `seminarycharacterfields_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `seminarycharacterfields_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `seminarycharacterfields_ibfk_3` FOREIGN KEY (`seminarycharacterfieldtype_id`) REFERENCES `seminarycharacterfieldtypes` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `seminarycharacterfieldtypes` +-- + +DROP TABLE IF EXISTS `seminarycharacterfieldtypes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `seminarycharacterfieldtypes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `title` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `seminarymedia` +-- + +DROP TABLE IF EXISTS `seminarymedia`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `seminarymedia` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(64) NOT NULL, + `description` varchar(128) NOT NULL, + `mimetype` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `seminary_id_2` (`seminary_id`,`name`), + UNIQUE KEY `seminary_id_3` (`seminary_id`,`url`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `seminarymedia_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `seminarymedia_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `seminaryuploads` +-- + +DROP TABLE IF EXISTS `seminaryuploads`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `seminaryuploads` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) DEFAULT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(255) NOT NULL, + `mimetype` varchar(32) NOT NULL, + `public` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`url`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `seminaryuploads_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `seminaryuploads_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `userroles` +-- + +DROP TABLE IF EXISTS `userroles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `userroles` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `username` varchar(32) NOT NULL, + `url` varchar(128) NOT NULL, + `surname` varchar(128) NOT NULL, + `prename` varchar(128) NOT NULL, + `email` varchar(64) NOT NULL, + `password` varchar(64) NOT NULL, + `mailing` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `url` (`url`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Benutzer'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users_userroles` +-- + +DROP TABLE IF EXISTS `users_userroles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_userroles` ( + `user_id` int(11) NOT NULL, + `userrole_id` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`user_id`,`userrole_id`), + KEY `userrole_id` (`userrole_id`), + CONSTRAINT `users_userroles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `users_userroles_ibfk_3` FOREIGN KEY (`userrole_id`) REFERENCES `userroles` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `xplevels` +-- + +DROP TABLE IF EXISTS `xplevels`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `xplevels` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_user_id` int(11) NOT NULL, + `seminary_id` int(11) NOT NULL, + `xps` int(10) unsigned NOT NULL, + `level` int(11) NOT NULL, + `name` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `xps` (`seminary_id`,`xps`), + UNIQUE KEY `level` (`level`,`seminary_id`), + KEY `created_user_id` (`created_user_id`), + KEY `seminary_id` (`seminary_id`), + CONSTRAINT `xplevels_ibfk_1` FOREIGN KEY (`created_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `xplevels_ibfk_2` FOREIGN KEY (`seminary_id`) REFERENCES `seminaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2015-04-26 13:28:31 diff --git a/db/import.sql b/db/import.sql new file mode 100644 index 00000000..da3199f6 --- /dev/null +++ b/db/import.sql @@ -0,0 +1,717 @@ +-- MySQL dump 10.15 Distrib 10.0.17-MariaDB, for Linux (x86_64) +-- +-- Host: localhost Database: z_default +-- ------------------------------------------------------ +-- Server version 10.0.17-MariaDB-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Dumping data for table `achievementconditions` +-- + +LOCK TABLES `achievementconditions` WRITE; +/*!40000 ALTER TABLE `achievementconditions` DISABLE KEYS */; +INSERT INTO `achievementconditions` VALUES (1,'2014-04-16 19:36:54','date'),(2,'2014-04-16 19:36:54','character'),(3,'2014-04-16 19:36:59','quest'),(4,'2014-04-16 19:36:59','achievement'); +/*!40000 ALTER TABLE `achievementconditions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievementconditions_achievement` +-- + +LOCK TABLES `achievementconditions_achievement` WRITE; +/*!40000 ALTER TABLE `achievementconditions_achievement` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievementconditions_achievement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievementconditions_character` +-- + +LOCK TABLES `achievementconditions_character` WRITE; +/*!40000 ALTER TABLE `achievementconditions_character` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievementconditions_character` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievementconditions_date` +-- + +LOCK TABLES `achievementconditions_date` WRITE; +/*!40000 ALTER TABLE `achievementconditions_date` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievementconditions_date` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievementconditions_quest` +-- + +LOCK TABLES `achievementconditions_quest` WRITE; +/*!40000 ALTER TABLE `achievementconditions_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievementconditions_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievements` +-- + +LOCK TABLES `achievements` WRITE; +/*!40000 ALTER TABLE `achievements` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievements` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievements_characters` +-- + +LOCK TABLES `achievements_characters` WRITE; +/*!40000 ALTER TABLE `achievements_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievements_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `achievementsmedia` +-- + +LOCK TABLES `achievementsmedia` WRITE; +/*!40000 ALTER TABLE `achievementsmedia` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievementsmedia` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `avatarpictures` +-- + +LOCK TABLES `avatarpictures` WRITE; +/*!40000 ALTER TABLE `avatarpictures` DISABLE KEYS */; +/*!40000 ALTER TABLE `avatarpictures` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `avatars` +-- + +LOCK TABLES `avatars` WRITE; +/*!40000 ALTER TABLE `avatars` DISABLE KEYS */; +/*!40000 ALTER TABLE `avatars` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `cache_charactergroups` +-- + +LOCK TABLES `cache_charactergroups` WRITE; +/*!40000 ALTER TABLE `cache_charactergroups` DISABLE KEYS */; +/*!40000 ALTER TABLE `cache_charactergroups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `cache_characters` +-- + +LOCK TABLES `cache_characters` WRITE; +/*!40000 ALTER TABLE `cache_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `cache_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroups` +-- + +LOCK TABLES `charactergroups` WRITE; +/*!40000 ALTER TABLE `charactergroups` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroupsgroups` +-- + +LOCK TABLES `charactergroupsgroups` WRITE; +/*!40000 ALTER TABLE `charactergroupsgroups` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroupsgroups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroupsmedia` +-- + +LOCK TABLES `charactergroupsmedia` WRITE; +/*!40000 ALTER TABLE `charactergroupsmedia` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroupsmedia` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroupsquests` +-- + +LOCK TABLES `charactergroupsquests` WRITE; +/*!40000 ALTER TABLE `charactergroupsquests` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroupsquests` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroupsquests_groups` +-- + +LOCK TABLES `charactergroupsquests_groups` WRITE; +/*!40000 ALTER TABLE `charactergroupsquests_groups` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroupsquests_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactergroupsquests_seminaryuploads` +-- + +LOCK TABLES `charactergroupsquests_seminaryuploads` WRITE; +/*!40000 ALTER TABLE `charactergroupsquests_seminaryuploads` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactergroupsquests_seminaryuploads` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `characterroles` +-- + +LOCK TABLES `characterroles` WRITE; +/*!40000 ALTER TABLE `characterroles` DISABLE KEYS */; +INSERT INTO `characterroles` VALUES (1,'2014-04-16 14:42:54','admin'),(2,'2014-04-16 14:42:54','moderator'),(3,'2014-04-16 14:43:00','user'),(4,'2014-04-16 14:43:00','guest'); +/*!40000 ALTER TABLE `characterroles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `characters` +-- + +LOCK TABLES `characters` WRITE; +/*!40000 ALTER TABLE `characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `characters_charactergroups` +-- + +LOCK TABLES `characters_charactergroups` WRITE; +/*!40000 ALTER TABLE `characters_charactergroups` DISABLE KEYS */; +/*!40000 ALTER TABLE `characters_charactergroups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `characters_characterroles` +-- + +LOCK TABLES `characters_characterroles` WRITE; +/*!40000 ALTER TABLE `characters_characterroles` DISABLE KEYS */; +/*!40000 ALTER TABLE `characters_characterroles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `characters_seminarycharacterfields` +-- + +LOCK TABLES `characters_seminarycharacterfields` WRITE; +/*!40000 ALTER TABLE `characters_seminarycharacterfields` DISABLE KEYS */; +/*!40000 ALTER TABLE `characters_seminarycharacterfields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `charactertypes` +-- + +LOCK TABLES `charactertypes` WRITE; +/*!40000 ALTER TABLE `charactertypes` DISABLE KEYS */; +/*!40000 ALTER TABLE `charactertypes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `maps` +-- + +LOCK TABLES `maps` WRITE; +/*!40000 ALTER TABLE `maps` DISABLE KEYS */; +/*!40000 ALTER TABLE `maps` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `media` +-- + +LOCK TABLES `media` WRITE; +/*!40000 ALTER TABLE `media` DISABLE KEYS */; +/*!40000 ALTER TABLE `media` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroups` +-- + +LOCK TABLES `questgroups` WRITE; +/*!40000 ALTER TABLE `questgroups` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroups_characters` +-- + +LOCK TABLES `questgroups_characters` WRITE; +/*!40000 ALTER TABLE `questgroups_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroups_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroups_questgroupshierarchy` +-- + +LOCK TABLES `questgroups_questgroupshierarchy` WRITE; +/*!40000 ALTER TABLE `questgroups_questgroupshierarchy` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroups_questgroupshierarchy` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroups_questtexts` +-- + +LOCK TABLES `questgroups_questtexts` WRITE; +/*!40000 ALTER TABLE `questgroups_questtexts` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroups_questtexts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroupshierarchy` +-- + +LOCK TABLES `questgroupshierarchy` WRITE; +/*!40000 ALTER TABLE `questgroupshierarchy` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroupshierarchy` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgroupspictures` +-- + +LOCK TABLES `questgroupspictures` WRITE; +/*!40000 ALTER TABLE `questgroupspictures` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgroupspictures` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questgrouptexts` +-- + +LOCK TABLES `questgrouptexts` WRITE; +/*!40000 ALTER TABLE `questgrouptexts` DISABLE KEYS */; +/*!40000 ALTER TABLE `questgrouptexts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `quests` +-- + +LOCK TABLES `quests` WRITE; +/*!40000 ALTER TABLE `quests` DISABLE KEYS */; +/*!40000 ALTER TABLE `quests` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `quests_characters` +-- + +LOCK TABLES `quests_characters` WRITE; +/*!40000 ALTER TABLE `quests_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `quests_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `quests_previousquests` +-- + +LOCK TABLES `quests_previousquests` WRITE; +/*!40000 ALTER TABLE `quests_previousquests` DISABLE KEYS */; +/*!40000 ALTER TABLE `quests_previousquests` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `quests_questsubtopics` +-- + +LOCK TABLES `quests_questsubtopics` WRITE; +/*!40000 ALTER TABLE `quests_questsubtopics` DISABLE KEYS */; +/*!40000 ALTER TABLE `quests_questsubtopics` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questsmedia` +-- + +LOCK TABLES `questsmedia` WRITE; +/*!40000 ALTER TABLE `questsmedia` DISABLE KEYS */; +/*!40000 ALTER TABLE `questsmedia` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questsubtopics` +-- + +LOCK TABLES `questsubtopics` WRITE; +/*!40000 ALTER TABLE `questsubtopics` DISABLE KEYS */; +/*!40000 ALTER TABLE `questsubtopics` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtexts` +-- + +LOCK TABLES `questtexts` WRITE; +/*!40000 ALTER TABLE `questtexts` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtexts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtexttypes` +-- + +LOCK TABLES `questtexttypes` WRITE; +/*!40000 ALTER TABLE `questtexttypes` DISABLE KEYS */; +INSERT INTO `questtexttypes` VALUES (1,'2014-04-17 09:24:21','Prolog','Prolog'),(2,'2014-04-17 09:24:21','Hint','Hint'),(3,'2014-04-17 09:24:27','Epilog','Epilog'); +/*!40000 ALTER TABLE `questtexttypes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtopics` +-- + +LOCK TABLES `questtopics` WRITE; +/*!40000 ALTER TABLE `questtopics` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtopics` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes` +-- + +LOCK TABLES `questtypes` WRITE; +/*!40000 ALTER TABLE `questtypes` DISABLE KEYS */; +INSERT INTO `questtypes` VALUES (1,'2014-04-16 18:44:44','Empty','Empty',NULL),(2,'2014-04-16 18:44:44','Boss Fight','Boss-Fight','bossfight'),(3,'2014-04-16 18:45:19','Choice Input','Choice-Input','choiceinput'),(4,'2014-04-16 18:46:02','Crossword','Crossword','crossword'),(5,'2014-04-16 18:46:02','Drag&Drop','Drag&Drop','dragndrop'),(6,'2014-04-16 18:46:23','Multiple Choice','Multiple-Choice','multiplechoice'),(7,'2014-04-16 18:46:23','Submit','Submit','submit'),(8,'2014-04-16 18:46:43','Text Input','Text-Input','textinput'); +/*!40000 ALTER TABLE `questtypes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_bossfight` +-- + +LOCK TABLES `questtypes_bossfight` WRITE; +/*!40000 ALTER TABLE `questtypes_bossfight` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_bossfight` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_bossfight_stages` +-- + +LOCK TABLES `questtypes_bossfight_stages` WRITE; +/*!40000 ALTER TABLE `questtypes_bossfight_stages` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_bossfight_stages` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_bossfight_stages_characters` +-- + +LOCK TABLES `questtypes_bossfight_stages_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_bossfight_stages_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_bossfight_stages_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_choiceinput` +-- + +LOCK TABLES `questtypes_choiceinput` WRITE; +/*!40000 ALTER TABLE `questtypes_choiceinput` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_choiceinput` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_choiceinput_choices` +-- + +LOCK TABLES `questtypes_choiceinput_choices` WRITE; +/*!40000 ALTER TABLE `questtypes_choiceinput_choices` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_choiceinput_choices` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_choiceinput_lists` +-- + +LOCK TABLES `questtypes_choiceinput_lists` WRITE; +/*!40000 ALTER TABLE `questtypes_choiceinput_lists` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_choiceinput_lists` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_choiceinput_lists_characters` +-- + +LOCK TABLES `questtypes_choiceinput_lists_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_choiceinput_lists_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_choiceinput_lists_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_crossword_words` +-- + +LOCK TABLES `questtypes_crossword_words` WRITE; +/*!40000 ALTER TABLE `questtypes_crossword_words` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_crossword_words` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_crossword_words_characters` +-- + +LOCK TABLES `questtypes_crossword_words_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_crossword_words_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_crossword_words_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_dragndrop` +-- + +LOCK TABLES `questtypes_dragndrop` WRITE; +/*!40000 ALTER TABLE `questtypes_dragndrop` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_dragndrop` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_dragndrop_drags` +-- + +LOCK TABLES `questtypes_dragndrop_drags` WRITE; +/*!40000 ALTER TABLE `questtypes_dragndrop_drags` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_dragndrop_drags` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_dragndrop_drops` +-- + +LOCK TABLES `questtypes_dragndrop_drops` WRITE; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_dragndrop_drops_characters` +-- + +LOCK TABLES `questtypes_dragndrop_drops_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_dragndrop_drops_drags` +-- + +LOCK TABLES `questtypes_dragndrop_drops_drags` WRITE; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops_drags` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_dragndrop_drops_drags` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_multiplechoice` +-- + +LOCK TABLES `questtypes_multiplechoice` WRITE; +/*!40000 ALTER TABLE `questtypes_multiplechoice` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_multiplechoice` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_multiplechoice_answers` +-- + +LOCK TABLES `questtypes_multiplechoice_answers` WRITE; +/*!40000 ALTER TABLE `questtypes_multiplechoice_answers` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_multiplechoice_answers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_multiplechoice_characters` +-- + +LOCK TABLES `questtypes_multiplechoice_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_multiplechoice_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_multiplechoice_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_submit_characters` +-- + +LOCK TABLES `questtypes_submit_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_submit_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_submit_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_submit_characters_comments` +-- + +LOCK TABLES `questtypes_submit_characters_comments` WRITE; +/*!40000 ALTER TABLE `questtypes_submit_characters_comments` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_submit_characters_comments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_submit_mimetypes` +-- + +LOCK TABLES `questtypes_submit_mimetypes` WRITE; +/*!40000 ALTER TABLE `questtypes_submit_mimetypes` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_submit_mimetypes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_textinput` +-- + +LOCK TABLES `questtypes_textinput` WRITE; +/*!40000 ALTER TABLE `questtypes_textinput` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_textinput` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_textinput_fields` +-- + +LOCK TABLES `questtypes_textinput_fields` WRITE; +/*!40000 ALTER TABLE `questtypes_textinput_fields` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_textinput_fields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_textinput_fields_characters` +-- + +LOCK TABLES `questtypes_textinput_fields_characters` WRITE; +/*!40000 ALTER TABLE `questtypes_textinput_fields_characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_textinput_fields_characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `questtypes_textinput_fieldsizes` +-- + +LOCK TABLES `questtypes_textinput_fieldsizes` WRITE; +/*!40000 ALTER TABLE `questtypes_textinput_fieldsizes` DISABLE KEYS */; +/*!40000 ALTER TABLE `questtypes_textinput_fieldsizes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `seminaries` +-- + +LOCK TABLES `seminaries` WRITE; +/*!40000 ALTER TABLE `seminaries` DISABLE KEYS */; +/*!40000 ALTER TABLE `seminaries` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `seminarycharacterfields` +-- + +LOCK TABLES `seminarycharacterfields` WRITE; +/*!40000 ALTER TABLE `seminarycharacterfields` DISABLE KEYS */; +/*!40000 ALTER TABLE `seminarycharacterfields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `seminarycharacterfieldtypes` +-- + +LOCK TABLES `seminarycharacterfieldtypes` WRITE; +/*!40000 ALTER TABLE `seminarycharacterfieldtypes` DISABLE KEYS */; +INSERT INTO `seminarycharacterfieldtypes` VALUES (1,'2014-04-16 18:50:16','Number','Number'),(2,'2014-04-16 18:50:16','Varchar','Varchar'),(3,'2014-04-16 18:50:24','Text','Text'),(4,'2014-04-16 18:50:24','List','List'); +/*!40000 ALTER TABLE `seminarycharacterfieldtypes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `seminarymedia` +-- + +LOCK TABLES `seminarymedia` WRITE; +/*!40000 ALTER TABLE `seminarymedia` DISABLE KEYS */; +/*!40000 ALTER TABLE `seminarymedia` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `seminaryuploads` +-- + +LOCK TABLES `seminaryuploads` WRITE; +/*!40000 ALTER TABLE `seminaryuploads` DISABLE KEYS */; +/*!40000 ALTER TABLE `seminaryuploads` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `userroles` +-- + +LOCK TABLES `userroles` WRITE; +/*!40000 ALTER TABLE `userroles` DISABLE KEYS */; +INSERT INTO `userroles` VALUES (1,'2014-04-16 14:42:54','admin'),(2,'2014-04-16 14:42:54','moderator'),(3,'2014-04-16 14:43:00','user'),(4,'2014-04-16 14:43:00','guest'); +/*!40000 ALTER TABLE `userroles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES (1,'2015-04-26 11:24:04','admin','admin','Admin','Admin','','$2y$10$1zCozXcIGak552mkv/K3vOPddrisvPlokJvUjHtHj6VBBRcmznXCG',1); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `users_userroles` +-- + +LOCK TABLES `users_userroles` WRITE; +/*!40000 ALTER TABLE `users_userroles` DISABLE KEYS */; +INSERT INTO `users_userroles` VALUES (1,1,'2015-04-26 11:33:36'); +/*!40000 ALTER TABLE `users_userroles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `xplevels` +-- + +LOCK TABLES `xplevels` WRITE; +/*!40000 ALTER TABLE `xplevels` DISABLE KEYS */; +/*!40000 ALTER TABLE `xplevels` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2015-04-26 13:34:20 diff --git a/db/procedures.sql b/db/procedures.sql new file mode 100644 index 00000000..a9a1724e --- /dev/null +++ b/db/procedures.sql @@ -0,0 +1,151 @@ +DROP PROCEDURE IF EXISTS update_cache_characters_quest; +DELIMITER $$ +CREATE PROCEDURE update_cache_characters_quest( + IN QUESTID INT(11) +) +BEGIN + DECLARE CHARACTERID INT; + DECLARE done INT DEFAULT FALSE; + DECLARE characters_cursor CURSOR FOR + SELECT character_id + FROM quests_characters + WHERE quest_id = QUESTID AND status = 3; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + SET done = 0; + OPEN characters_cursor; + get_characters: LOOP + FETCH characters_cursor INTO CHARACTERID; + IF done = TRUE THEN + LEAVE get_characters; + END IF; + CALL update_cache_characters(CHARACTERID); + END LOOP get_characters; +END $$ +DELIMITER ; + + +DROP PROCEDURE IF EXISTS update_cache_characters_charactergroup; +DELIMITER $$ +CREATE PROCEDURE update_cache_characters_charactergroup( + IN CHARACTERGROUPID INT(11) +) +BEGIN + DECLARE CHARACTERID INT; + DECLARE done INT DEFAULT FALSE; + DECLARE characters_cursor CURSOR FOR + SELECT character_id + FROM characters_charactergroups + WHERE charactergroup_id = CHARACTERGROUPID; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + SET done = 0; + OPEN characters_cursor; + get_characters: LOOP + FETCH characters_cursor INTO CHARACTERID; + IF done = TRUE THEN + LEAVE get_characters; + END IF; + CALL update_cache_characters(CHARACTERID); + END LOOP get_characters; +END $$ +DELIMITER ; + + +DROP PROCEDURE IF EXISTS update_cache_characters; +DELIMITER $$ +CREATE PROCEDURE update_cache_characters( + IN CHARACTERID INT(11) +) +BEGIN + DECLARE QUESTXPS INT UNSIGNED; + DECLARE GROUPSXPS INT UNSIGNED; + DECLARE TOTALXPS INT UNSIGNED; + DECLARE XPLEVELID INT; + DECLARE AVATARID INT; + + /* XPs */ + SELECT IFNULL(SUM(quests.xps),0) INTO QUESTXPS + FROM quests_characters + LEFT JOIN quests ON quests.id = quests_characters.quest_id + WHERE quests_characters.character_id = CHARACTERID AND quests_characters.status = 3; + SELECT IFNULL(SUM(cache_charactergroups.xps),0) INTO GROUPSXPS + FROM characters_charactergroups + LEFT JOIN cache_charactergroups ON cache_charactergroups.charactergroup_id = characters_charactergroups.charactergroup_id + WHERE characters_charactergroups.character_id = CHARACTERID; + SET TOTALXPS = QUESTXPS + GROUPSXPS; + + /* XP-level */ + SELECT ( + SELECT id + FROM xplevels + WHERE seminary_id = charactertypes.seminary_id AND xps = ( + SELECT MAX(xps) + FROM xplevels AS xplevels_sub + WHERE xps <= TOTALXPS + ) + ) INTO XPLEVELID + FROM characters + LEFT JOIN charactertypes ON charactertypes.id = characters.charactertype_id + WHERE characters.id = CHARACTERID; + + /* Avatar */ + SELECT avatars.id INTO AVATARID + FROM characters + LEFT JOIN avatars ON avatars.charactertype_id = characters.charactertype_id AND avatars.xplevel_id = XPLEVELID + WHERE characters.id = CHARACTERID; + + /* Set values */ + REPLACE INTO cache_characters + (character_id, xps, quest_xps, xplevel_id, avatar_id) + VALUES + (CHARACTERID, TOTALXPS, QUESTXPS, XPLEVELID, AVATARID); +END $$ +DELIMITER ; + + + + +DROP PROCEDURE IF EXISTS update_cache_charactergroups_charactergroupsquest; +DELIMITER $$ +CREATE PROCEDURE update_cache_charactergroups_charactergroupsquest( + IN CHARACTERGROUPSQUESTID INT(11) +) +BEGIN + DECLARE CHARACTERGROUPID INT; + DECLARE done INT DEFAULT FALSE; + DECLARE charactergroups_cursor CURSOR FOR + SELECT charactergroup_id + FROM charactergroupsquests_groups + WHERE charactergroupsquest_id = CHARACTERGROUPSQUESTID; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + SET done = 0; + OPEN charactergroups_cursor; + get_charactergroups: LOOP + FETCH charactergroups_cursor INTO CHARACTERGROUPID; + IF done = TRUE THEN + LEAVE get_charactergroups; + END IF; + CALL update_cache_charactergroups(CHARACTERGROUPID); + END LOOP get_charactergroups; +END $$ +DELIMITER ; + + +DROP PROCEDURE IF EXISTS update_cache_charactergroups; +DELIMITER $$ +CREATE PROCEDURE update_cache_charactergroups( + IN CHARACTERGROUPID INT(11) +) +BEGIN + /* XPs */ + REPLACE INTO cache_charactergroups + (charactergroup_id, xps) + SELECT charactergroups.id, IFNULL(SUM(ROUND(charactergroupsquests.xps * charactergroupsquests_groups.xps_factor)),0) AS xps + FROM charactergroups + LEFT JOIN charactergroupsquests_groups ON charactergroupsquests_groups.charactergroup_id = charactergroups.id + LEFT JOIN charactergroupsquests ON charactergroupsquests.id = charactergroupsquests_groups.charactergroupsquest_id + WHERE charactergroups.id = CHARACTERGROUPID; +END $$ +DELIMITER ; diff --git a/db/triggers.sql b/db/triggers.sql new file mode 100644 index 00000000..ea8b44ad --- /dev/null +++ b/db/triggers.sql @@ -0,0 +1,155 @@ +/** Characters +Quests **/ + +DROP TRIGGER IF EXISTS update_cache_characters_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_characters_insert` +AFTER INSERT ON characters +FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_quests_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_quests_update` +AFTER UPDATE ON quests +FOR EACH ROW BEGIN + CALL update_cache_characters_quest(NEW.id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_quests_characters_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_quests_characters_insert` +AFTER INSERT ON quests_characters +FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.character_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_quests_characters_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_quests_characters_update` +AFTER UPDATE ON quests_characters +FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); + CALL update_cache_characters(NEW.character_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_quests_characters_delete; +DELIMITER $$ +CREATE TRIGGER `update_cache_quests_characters_delete` +AFTER DELETE ON quests_characters +FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); +END $$ +DELIMITER ; + + + + +/** Charactergroups +Charactergroupsquests **/ + +DROP TRIGGER IF EXISTS update_cache_charactergroups_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_charactergroups_insert` +AFTER INSERT ON charactergroups +FOR EACH ROW BEGIN + CALL update_cache_charactergroups(NEW.id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_charactergroupsquests_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_charactergroupsquests_update` +AFTER UPDATE ON charactergroupsquests +FOR EACH ROW BEGIN + CALL update_cache_charactergroups_charactergroupsquest(NEW.id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_charactergroupsquests_groups_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_charactergroupsquests_groups_insert` +AFTER INSERT ON charactergroupsquests_groups +FOR EACH ROW BEGIN + CALL update_cache_charactergroups(NEW.charactergroup_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_charactergroupsquests_groups_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_charactergroupsquests_groups_update` +AFTER UPDATE ON charactergroupsquests_groups +FOR EACH ROW BEGIN + CALL update_cache_charactergroups(OLD.charactergroup_id); + CALL update_cache_charactergroups(NEW.charactergroup_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_charactergroupsquests_groups_delete; +DELIMITER $$ +CREATE TRIGGER `update_cache_charactergroupsquests_groups_delete` +AFTER DELETE ON charactergroupsquests_groups +FOR EACH ROW BEGIN + CALL update_cache_charactergroups(OLD.charactergroup_id); +END $$ +DELIMITER ; + + + + +/** Characters → Charactergroups **/ + +DROP TRIGGER IF EXISTS update_cache_characters_charactergroups_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_characters_charactergroups_insert` +AFTER INSERT ON characters_charactergroups +FOR EACH ROW BEGIN + CALL update_cache_characters(NEW.character_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_characters_charactergroups_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_characters_charactergroups_update` +AFTER UPDATE ON characters_charactergroups +FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); + CALL update_cache_characters(NEW.character_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_characters_charactergroups_delete; +DELIMITER $$ +CREATE TRIGGER `update_cache_characters_charactergroups_delete` +AFTER DELETE ON characters_charactergroups +FOR EACH ROW BEGIN + CALL update_cache_characters(OLD.character_id); +END $$ +DELIMITER ; + + + + +/** Cache Charactergroups **/ + +DROP TRIGGER IF EXISTS update_cache_cache_charactergroups_insert; +DELIMITER $$ +CREATE TRIGGER `update_cache_cache_charactergroups_insert` +AFTER INSERT ON cache_charactergroups +FOR EACH ROW BEGIN + CALL update_cache_characters_charactergroup(NEW.charactergroup_id); +END $$ +DELIMITER ; + +DROP TRIGGER IF EXISTS update_cache_cache_charactergroups_update; +DELIMITER $$ +CREATE TRIGGER `update_cache_cache_charactergroups_update` +AFTER UPDATE ON cache_charactergroups +FOR EACH ROW BEGIN + CALL update_cache_characters_charactergroup(NEW.charactergroup_id); +END $$ +DELIMITER ; + diff --git a/doc/.htaccess b/doc/.htaccess new file mode 100644 index 00000000..7b01f9bf --- /dev/null +++ b/doc/.htaccess @@ -0,0 +1,5 @@ +# Fixes a vulnerability in CentOS: http://stackoverflow.com/questions/20533279/prevent-php-from-parsing-non-php-files-such-as-somefile-php-txt + + RemoveHandler .php + ForceType text/plain + \ No newline at end of file diff --git a/doc/classes/PHPMailer.html b/doc/classes/PHPMailer.html new file mode 100644 index 00000000..b5d80bfc --- /dev/null +++ b/doc/classes/PHPMailer.html @@ -0,0 +1,7052 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\PHPMailer

+

PHPMailer - PHP email creation and transport class.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ __destruct()
+ isHTML()
+ isSMTP()
+ isMail()
+ isSendmail()
+ isQmail()
+ addAddress()
+ addCC()
+ addBCC()
+ addReplyTo()
+ setFrom()
+ getLastMessageID()
+ validateAddress()
+ send()
+ preSend()
+ postSend()
+ getSMTPInstance()
+ smtpConnect()
+ smtpClose()
+ setLanguage()
+ getTranslations()
+ addrAppend()
+ addrFormat()
+ wrapText()
+ utf8CharBoundary()
+ setWordWrap()
+ createHeader()
+ getMailMIME()
+ getSentMIMEMessage()
+ createBody()
+ headerLine()
+ textLine()
+ addAttachment()
+ getAttachments()
+ encodeString()
+ encodeHeader()
+ hasMultiBytes()
+ has8bitChars()
+ base64EncodeWrapMB()
+ encodeQP()
+ encodeQPphp()
+ encodeQ()
+ addStringAttachment()
+ addEmbeddedImage()
+ addStringEmbeddedImage()
+ inlineImageExists()
+ attachmentExists()
+ alternativeExists()
+ clearAddresses()
+ clearCCs()
+ clearBCCs()
+ clearReplyTos()
+ clearAllRecipients()
+ clearAttachments()
+ clearCustomHeaders()
+ rfcDate()
+ isError()
+ fixEOL()
+ addCustomHeader()
+ msgHTML()
+ html2text()
+ _mime_types()
+ filenameToType()
+ mb_pathinfo()
+ set()
+ secureHeader()
+ normalizeBreaks()
+ sign()
+ DKIM_QP()
+ DKIM_Sign()
+ DKIM_HeaderC()
+ DKIM_BodyC()
+ DKIM_Add()
+ getToAddresses()
+ getCcAddresses()
+ getBccAddresses()
+ getReplyToAddresses()
+ getAllRecipientAddresses()
+
+
+ $Version
+ $Priority
+ $CharSet
+ $ContentType
+ $Encoding
+ $ErrorInfo
+ $From
+ $FromName
+ $Sender
+ $ReturnPath
+ $Subject
+ $Body
+ $AltBody
+ $Ical
+ $WordWrap
+ $Mailer
+ $Sendmail
+ $UseSendmailOptions
+ $PluginDir
+ $ConfirmReadingTo
+ $Hostname
+ $MessageID
+ $MessageDate
+ $Host
+ $Port
+ $Helo
+ $SMTPSecure
+ $SMTPAuth
+ $Username
+ $Password
+ $AuthType
+ $Realm
+ $Workstation
+ $Timeout
+ $SMTPDebug
+ $Debugoutput
+ $SMTPKeepAlive
+ $SingleTo
+ $SingleToArray
+ $do_verp
+ $AllowEmpty
+ $LE
+ $DKIM_selector
+ $DKIM_identity
+ $DKIM_passphrase
+ $DKIM_domain
+ $DKIM_private
+ $action_function
+ $XMailer
+
+
+ STOP_MESSAGE
+ STOP_CONTINUE
+ STOP_CRITICAL
+ CRLF
+
+
+
+
+ edebug()
+ addAnAddress()
+ sendmailSend()
+ mailSend()
+ smtpSend()
+ getBoundary()
+ endBoundary()
+ setMessageType()
+ attachAll()
+ encodeFile()
+ setError()
+ serverHostname()
+ lang()
+ doCallback()
+
+
+ $MIMEBody
+ $MIMEHeader
+ $mailHeader
+ $smtp
+ $to
+ $cc
+ $bcc
+ $ReplyTo
+ $all_recipients
+ $attachment
+ $CustomHeader
+ $lastMessageID
+ $message_type
+ $boundary
+ $language
+ $error_count
+ $sign_cert_file
+ $sign_key_file
+ $sign_key_pass
+ $exceptions
+
+
+ N/A +
+
+
+
+ mailPassthru()
+
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

STOP_MESSAGE

+
STOP_MESSAGE
+

Error severity: message only, continue processing

+ +
+
+ +
+ +
+
+ +
+

STOP_CONTINUE

+
STOP_CONTINUE
+

Error severity: message, likely ok to continue processing

+ +
+
+ +
+ +
+
+ +
+

STOP_CRITICAL

+
STOP_CRITICAL
+

Error severity: message, plus full stop, critical error reached

+ +
+
+ +
+ +
+
+ +
+

CRLF

+
CRLF
+

SMTP RFC standard line ending

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$Version

+
$Version : 
+

The PHPMailer Version number.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Priority

+
$Priority : 
+

Email priority.

+

Options: 1 = High, 3 = Normal, 5 = low.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$CharSet

+
$CharSet : 
+

The character set of the message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$ContentType

+
$ContentType : 
+

The MIME Content-type of the message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Encoding

+
$Encoding : 
+

The message encoding.

+

Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$ErrorInfo

+
$ErrorInfo : 
+

Holds the most recent mailer error message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$From

+
$From : 
+

The From email address for the message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$FromName

+
$FromName : 
+

The From name of the message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Sender

+
$Sender : 
+

The Sender email (Return-Path) of the message.

+

If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$ReturnPath

+
$ReturnPath : 
+

The Return-Path of the message.

+

If empty, it will be set to either From or Sender.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Subject

+
$Subject : 
+

The Subject of the message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Body

+
$Body : 
+

An HTML or plain text message body.

+

If HTML then call isHTML(true).

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$AltBody

+
$AltBody : 
+

The plain-text message body.

+

This body can be read by mail clients that do not have HTML email +capability such as mutt & Eudora. +Clients that can read HTML will view the normal Body.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Ical

+
$Ical : 
+

An iCal message part body.

+

Only supported in simple alt or alt_inline message types +To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$WordWrap

+
$WordWrap : 
+

Word-wrap the message body to this number of chars.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Mailer

+
$Mailer : 
+

Which method to use to send mail.

+

Options: "mail", "sendmail", or "smtp".

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Sendmail

+
$Sendmail : 
+

The path to the sendmail program.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$UseSendmailOptions

+
$UseSendmailOptions : 
+

Whether mail() uses a fully sendmail-compatible MTA.

+

One which supports sendmail's "-oi -f" options.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$PluginDir

+
$PluginDir : 
+

Path to PHPMailer plugins.

+

Useful if the SMTP class is not in the PHP include path.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$ConfirmReadingTo

+
$ConfirmReadingTo : 
+

The email address that a reading confirmation should be sent to.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Hostname

+
$Hostname : 
+

The hostname to use in Message-Id and Received headers +and as default HELO string.

+

If empty, the value returned +by SERVER_NAME is used or 'localhost.localdomain'.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$MessageID

+
$MessageID : 
+

An ID to be used in the Message-Id header.

+

If empty, a unique id will be generated.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$MessageDate

+
$MessageDate : 
+

The message Date to be used in the Date header.

+

If empty, the current date will be added.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Host

+
$Host : 
+

SMTP hosts.

+

Either a single hostname or multiple semicolon-delimited hostnames. +You can also specify a different port +for each host by using this format: [hostname:port] +(e.g. "smtp1.example.com:25;smtp2.example.com"). +Hosts will be tried in order.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Port

+
$Port : 
+

The default SMTP server port.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Helo

+
$Helo : 
+

The SMTP HELO of the message.

+

Default is $Hostname.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$SMTPSecure

+
$SMTPSecure : 
+

The secure connection prefix.

+

Options: "", "ssl" or "tls"

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$SMTPAuth

+
$SMTPAuth : 
+

Whether to use SMTP authentication.

+

Uses the Username and Password properties.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Username

+
$Username : 
+

SMTP username.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Password

+
$Password : 
+

SMTP password.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$AuthType

+
$AuthType : 
+

SMTP auth type.

+

Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Realm

+
$Realm : 
+

SMTP realm.

+

Used for NTLM auth

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Workstation

+
$Workstation : 
+

SMTP workstation.

+

Used for NTLM auth

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Timeout

+
$Timeout : 
+

The SMTP server timeout in seconds.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$SMTPDebug

+
$SMTPDebug : 
+

SMTP class debug output mode.

+

Options: +0: no output +1: commands +2: data and commands +3: as 2 plus connection status +4: low level data output

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Debugoutput

+
$Debugoutput : 
+

How to handle debug output.

+

Options: +'echo': Output plain-text as-is, appropriate for CLI +'html': Output escaped, line breaks converted to
, appropriate for browser output +'error_log': Output to error log as configured in php.ini

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$SMTPKeepAlive

+
$SMTPKeepAlive : 
+

Whether to keep SMTP connection open after each message.

+

If this is set to true then to close the connection +requires an explicit call to smtpClose().

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$SingleTo

+
$SingleTo : 
+

Whether to split multiple to addresses into multiple messages +or send them all in one message.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$SingleToArray

+
$SingleToArray : 
+

Storage for addresses when SingleTo is enabled.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$do_verp

+
$do_verp : 
+

Whether to generate VERP addresses on send.

+

Only applicable when sending via SMTP.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$AllowEmpty

+
$AllowEmpty : 
+

Whether to allow sending messages with an empty body.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$LE

+
$LE : 
+

The default line ending.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$DKIM_selector

+
$DKIM_selector : 
+

DKIM selector.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$DKIM_identity

+
$DKIM_identity : 
+

DKIM Identity.

+

Usually the email address used as the source of the email

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$DKIM_passphrase

+
$DKIM_passphrase : 
+

DKIM passphrase.

+

Used if your key is encrypted.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$DKIM_domain

+
$DKIM_domain : 
+

DKIM signing domain name.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$DKIM_private

+
$DKIM_private : 
+

DKIM private key file path.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$action_function

+
$action_function : 
+

Callback Action function name.

+

The function that handles the result of the send email action. +It is called out by send() for each email sent.

+

Value can be any php callable: http://www.php.net/is_callable

+

Parameters: +bool $result result of the send action +string $to email address of the recipient +string $cc cc email addresses +string $bcc bcc email addresses +string $subject the subject +string $body the email body +string $from email address of sender

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$XMailer

+
$XMailer : 
+

What to use in the X-Mailer header.

+

Options: null for default, whitespace for none, or a string to use

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$MIMEBody

+
$MIMEBody : 
+

The complete compiled MIME message body.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$MIMEHeader

+
$MIMEHeader : 
+

The complete compiled MIME message headers.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$mailHeader

+
$mailHeader : 
+

Extra headers that createHeader() doesn't fold in.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$smtp

+
$smtp : 
+

An instance of the SMTP sender class.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$to

+
$to : 
+

The array of 'to' addresses.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$cc

+
$cc : 
+

The array of 'cc' addresses.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$bcc

+
$bcc : 
+

The array of 'bcc' addresses.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$ReplyTo

+
$ReplyTo : 
+

The array of reply-to names and addresses.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$all_recipients

+
$all_recipients : 
+

An array of all kinds of addresses.

+

Includes all of $to, $cc, $bcc, $replyto

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$attachment

+
$attachment : 
+

The array of attachments.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$CustomHeader

+
$CustomHeader : 
+

The array of custom headers.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$lastMessageID

+
$lastMessageID : 
+

The most recent Message-ID (including angular brackets).

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$message_type

+
$message_type : 
+

The message's MIME type.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$boundary

+
$boundary : 
+

The array of MIME boundary strings.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$language

+
$language : 
+

The array of available languages.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$error_count

+
$error_count : 
+

The number of errors encountered.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$sign_cert_file

+
$sign_cert_file : 
+

The S/MIME certificate file path.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$sign_key_file

+
$sign_key_file : 
+

The S/MIME key file path.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$sign_key_pass

+
$sign_key_pass : 
+

The S/MIME password for the key.

+

Used only if the key is encrypted.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$exceptions

+
$exceptions : 
+

Whether to throw exceptions for errors.

+ + +

Type

+ +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(boolean  $exceptions = false) 
+

Constructor

+ + +

Parameters

+ + + + + + +
boolean$exceptions

Should we throw external exceptions?

+ + + +
+
+ +
+ +
+
+ +
+

__destruct()

+ +
__destruct() 
+

Destructor.

+ + + + + +
+
+ +
+ +
+
+ +
+

isHTML()

+ +
isHTML(boolean  $ishtml = true) : void
+

Sets message type to HTML or plain.

+ + +

Parameters

+ + + + + + +
boolean$ishtml

True for HTML mode.

+ + + +
+
+ +
+ +
+
+ +
+

isSMTP()

+ +
isSMTP() : void
+

Send messages using SMTP.

+ + + + + +
+
+ +
+ +
+
+ +
+

isMail()

+ +
isMail() : void
+

Send messages using PHP's mail() function.

+ + + + + +
+
+ +
+ +
+
+ +
+

isSendmail()

+ +
isSendmail() : void
+

Send messages using $Sendmail.

+ + + + + +
+
+ +
+ +
+
+ +
+

isQmail()

+ +
isQmail() : void
+

Send messages using qmail.

+ + + + + +
+
+ +
+ +
+
+ +
+

addAddress()

+ +
addAddress(string  $address, string  $name = '') : boolean
+

Add a "To" address.

+ + +

Parameters

+ + + + + + + + + + + +
string$address
string$name
+ + +

Returns

+ boolean + —

true on success, false if address already used

+ +
+
+ +
+ +
+
+ +
+

addCC()

+ +
addCC(string  $address, string  $name = '') : boolean
+

Add a "CC" address.

+ + +

Parameters

+ + + + + + + + + + + +
string$address
string$name
+ + +

Returns

+ boolean + —

true on success, false if address already used

+ +
+
+ +
+ +
+
+ +
+

addBCC()

+ +
addBCC(string  $address, string  $name = '') : boolean
+

Add a "BCC" address.

+ + +

Parameters

+ + + + + + + + + + + +
string$address
string$name
+ + +

Returns

+ boolean + —

true on success, false if address already used

+ +
+
+ +
+ +
+
+ +
+

addReplyTo()

+ +
addReplyTo(string  $address, string  $name = '') : boolean
+

Add a "Reply-to" address.

+ + +

Parameters

+ + + + + + + + + + + +
string$address
string$name
+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

setFrom()

+ +
setFrom(string  $address, string  $name = '', boolean  $auto = true) : boolean
+

Set the From and FromName properties.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$address
string$name
boolean$auto

Whether to also set the Sender address, defaults to true

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

getLastMessageID()

+ +
getLastMessageID() : string
+

Return the Message-ID header of the last email.

+

Technically this is the value from the last time the headers were created, +but it's also the message ID of the last sent message except in +pathological cases.

+ + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

validateAddress()

+ +
validateAddress(string  $address, string  $patternselect = 'auto') : boolean
+

Check that a string looks like an email address.

+ + +

Parameters

+ + + + + + + + + + + +
string$address

The email address to check

string$patternselect

A selector for the validation pattern to use :

+
    +
  • auto Pick strictest one automatically;
  • +
  • pcre8 Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
  • +
  • pcre Use old PCRE implementation;
  • +
  • php Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains;
  • +
  • html5 Use the pattern given by the HTML5 spec for 'email' type form input elements.
  • +
  • noregex Don't use a regex: super fast, really dumb.
  • +
+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

send()

+ +
send() : boolean
+

Create a message and send it.

+

Uses the sending method specified by $Mailer.

+ + +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + —

false on error - See the ErrorInfo property for details of the error.

+ +
+
+ +
+ +
+
+ +
+

preSend()

+ +
preSend() : boolean
+

Prepare a message for sending.

+ + + +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

postSend()

+ +
postSend() : boolean
+

Actually send a message.

+

Send the email via the selected mechanism

+ + +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

getSMTPInstance()

+ +
getSMTPInstance() : \SMTP
+

Get an instance to use for SMTP operations.

+

Override this function to load your own SMTP implementation

+ + + +

Returns

+ \SMTP + +
+
+ +
+ +
+
+ +
+

smtpConnect()

+ +
smtpConnect(array  $options = array()) : boolean
+

Initiate a connection to an SMTP server.

+

Returns false if the operation failed.

+ +

Parameters

+ + + + + + +
array$options

An array of options compatible with stream_context_create()

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

smtpClose()

+ +
smtpClose() : void
+

Close the active SMTP session if one exists.

+ + + + + +
+
+ +
+ +
+
+ +
+

setLanguage()

+ +
setLanguage(string  $langcode = 'en', string  $lang_path = '') : boolean
+

Set the language for error messages.

+

Returns false if it cannot load the language file. +The default language is English.

+ +

Parameters

+ + + + + + + + + + + +
string$langcode

ISO 639-1 2-character language code (e.g. French is "fr")

string$lang_path

Path to the language file directory, with trailing separator (slash)

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

getTranslations()

+ +
getTranslations() : array
+

Get the array of strings for the current language.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

addrAppend()

+ +
addrAppend(string  $type, array  $addr) : string
+

Create recipient headers.

+ + +

Parameters

+ + + + + + + + + + + +
string$type
array$addr

An array of recipient, +where each recipient is a 2-element indexed array with element 0 containing an address +and element 1 containing a name, like: +array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

addrFormat()

+ +
addrFormat(array  $addr) : string
+

Format an address for use in a message header.

+ + +

Parameters

+ + + + + + +
array$addr

A 2-element indexed array, element 0 containing an address, element 1 containing a name +like array('joe@example.com', 'Joe User')

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

wrapText()

+ +
wrapText(string  $message, integer  $length, boolean  $qp_mode = false) : string
+

Word-wrap message.

+

For use with mailers that do not automatically perform wrapping +and for quoted-printable encoded messages. +Original written by philippe.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
string$message

The message to wrap

integer$length

The line length to wrap to

boolean$qp_mode

Whether to run in Quoted-Printable mode

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

utf8CharBoundary()

+ +
utf8CharBoundary(string  $encodedText, integer  $maxLength) : integer
+

Find the last character boundary prior to $maxLength in a utf-8 +quoted (printable) encoded string.

+

Original written by Colin Brown.

+ +

Parameters

+ + + + + + + + + + + +
string$encodedText

utf-8 QP text

integer$maxLength

find last character boundary prior to this length

+ + +

Returns

+ integer + +
+
+ +
+ +
+
+ +
+

setWordWrap()

+ +
setWordWrap() : void
+

Set the body wrapping.

+ + + + + +
+
+ +
+ +
+
+ +
+

createHeader()

+ +
createHeader() : string
+

Assemble message headers.

+ + + + +

Returns

+ string + —

The assembled headers

+ +
+
+ +
+ +
+
+ +
+

getMailMIME()

+ +
getMailMIME() : string
+

Get the message MIME type headers.

+ + + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

getSentMIMEMessage()

+ +
getSentMIMEMessage() : string
+

Returns the whole MIME message.

+

Includes complete headers and body. +Only valid post preSend().

+ + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

createBody()

+ +
createBody() : string
+

Assemble the message body.

+

Returns an empty string on failure.

+ + +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ string + —

The assembled message body

+ +
+
+ +
+ +
+
+ +
+

headerLine()

+ +
headerLine(string  $name, string  $value) : string
+

Format a header line.

+ + +

Parameters

+ + + + + + + + + + + +
string$name
string$value
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

textLine()

+ +
textLine(string  $value) : string
+

Return a formatted mail line.

+ + +

Parameters

+ + + + + + +
string$value
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

addAttachment()

+ +
addAttachment(string  $path, string  $name = '', string  $encoding = 'base64', string  $type = '', string  $disposition = 'attachment') : boolean
+

Add an attachment from a path on the filesystem.

+

Returns false if the file could not be found or read.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$path

Path to the attachment.

string$name

Overrides the attachment name.

string$encoding

File encoding (see $Encoding).

string$type

File extension (MIME) type.

string$disposition

Disposition to use

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

getAttachments()

+ +
getAttachments() : array
+

Return the array of attachments.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

encodeString()

+ +
encodeString(string  $str, string  $encoding = 'base64') : string
+

Encode a string in requested format.

+

Returns an empty string on failure.

+ +

Parameters

+ + + + + + + + + + + +
string$str

The text to encode

string$encoding

The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

encodeHeader()

+ +
encodeHeader(string  $str, string  $position = 'text') : string
+

Encode a header string optimally.

+

Picks shortest of Q, B, quoted-printable or none.

+ +

Parameters

+ + + + + + + + + + + +
string$str
string$position
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

hasMultiBytes()

+ +
hasMultiBytes(string  $str) : boolean
+

Check if a string contains multi-byte characters.

+ + +

Parameters

+ + + + + + +
string$str

multi-byte text to wrap encode

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

has8bitChars()

+ +
has8bitChars(string  $text) : boolean
+

Does a string contain any 8-bit chars (in any charset)?

+ + +

Parameters

+ + + + + + +
string$text
+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

base64EncodeWrapMB()

+ +
base64EncodeWrapMB(string  $str, string  $linebreak = null) : string
+

Encode and wrap long multibyte strings for mail headers +without breaking lines within a character.

+

Adapted from a function by paravoid

+ +

Parameters

+ + + + + + + + + + + +
string$str

multi-byte text to wrap encode

string$linebreak

string to use as linefeed/end-of-line

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

encodeQP()

+ +
encodeQP(string  $string, integer  $line_max = 76) : string
+

Encode a string in quoted-printable format.

+

According to RFC2045 section 6.7.

+ +

Parameters

+ + + + + + + + + + + +
string$string

The text to encode

integer$line_max

Number of chars allowed on a line before wrapping

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

encodeQPphp()

+ +
encodeQPphp(string  $string, integer  $line_max = 76, boolean  $space_conv = false) : string
+

Backward compatibility wrapper for an old QP encoding function that was removed.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$string
integer$line_max
boolean$space_conv
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

encodeQ()

+ +
encodeQ(string  $str, string  $position = 'text') : string
+

Encode a string using Q encoding.

+ + +

Parameters

+ + + + + + + + + + + +
string$str

the text to encode

string$position

Where the text is going to be used, see the RFC for what that means

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

addStringAttachment()

+ +
addStringAttachment(string  $string, string  $filename, string  $encoding = 'base64', string  $type = '', string  $disposition = 'attachment') : void
+

Add a string or binary attachment (non-filesystem).

+

This method can be used to attach ascii or binary data, +such as a BLOB record from a database.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$string

String attachment data.

string$filename

Name of the attachment.

string$encoding

File encoding (see $Encoding).

string$type

File extension (MIME) type.

string$disposition

Disposition to use

+ + + +
+
+ +
+ +
+
+ +
+

addEmbeddedImage()

+ +
addEmbeddedImage(string  $path, string  $cid, string  $name = '', string  $encoding = 'base64', string  $type = '', string  $disposition = 'inline') : boolean
+

Add an embedded (inline) attachment from a file.

+

This can include images, sounds, and just about any other document type. +These differ from 'regular' attachmants in that they are intended to be +displayed inline with the message, not just attached for download. +This is used in HTML messages that embed the images +the HTML refers to using the $cid value.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$path

Path to the attachment.

string$cid

Content ID of the attachment; Use this to reference +the content when using an embedded image in HTML.

string$name

Overrides the attachment name.

string$encoding

File encoding (see $Encoding).

string$type

File MIME type.

string$disposition

Disposition to use

+ + +

Returns

+ boolean + —

True on successfully adding an attachment

+ +
+
+ +
+ +
+
+ +
+

addStringEmbeddedImage()

+ +
addStringEmbeddedImage(string  $string, string  $cid, string  $name = '', string  $encoding = 'base64', string  $type = '', string  $disposition = 'inline') : boolean
+

Add an embedded stringified attachment.

+

This can include images, sounds, and just about any other document type. +Be sure to set the $type to an image type for images: +JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$string

The attachment binary data.

string$cid

Content ID of the attachment; Use this to reference +the content when using an embedded image in HTML.

string$name
string$encoding

File encoding (see $Encoding).

string$type

MIME type.

string$disposition

Disposition to use

+ + +

Returns

+ boolean + —

True on successfully adding an attachment

+ +
+
+ +
+ +
+
+ +
+

inlineImageExists()

+ +
inlineImageExists() : boolean
+

Check if an inline attachment is present.

+ + + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

attachmentExists()

+ +
attachmentExists() : boolean
+

Check if an attachment (non-inline) is present.

+ + + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

alternativeExists()

+ +
alternativeExists() : boolean
+

Check if this message has an alternative body set.

+ + + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

clearAddresses()

+ +
clearAddresses() : void
+

Clear all To recipients.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearCCs()

+ +
clearCCs() : void
+

Clear all CC recipients.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearBCCs()

+ +
clearBCCs() : void
+

Clear all BCC recipients.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearReplyTos()

+ +
clearReplyTos() : void
+

Clear all ReplyTo recipients.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearAllRecipients()

+ +
clearAllRecipients() : void
+

Clear all recipient types.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearAttachments()

+ +
clearAttachments() : void
+

Clear all filesystem, string, and binary attachments.

+ + + + + +
+
+ +
+ +
+
+ +
+

clearCustomHeaders()

+ +
clearCustomHeaders() : void
+

Clear all custom headers.

+ + + + + +
+
+ +
+ +
+
+ +
+

rfcDate()

+ +
rfcDate() : string
+

Return an RFC 822 formatted date.

+ + + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

isError()

+ +
isError() : boolean
+

Check if an error occurred.

+ + + + +

Returns

+ boolean + —

True if an error did occur.

+ +
+
+ +
+ +
+
+ +
+

fixEOL()

+ +
fixEOL(string  $str) : string
+

Ensure consistent line endings in a string.

+

Changes every end of line from CRLF, CR or LF to $this->LE.

+ +

Parameters

+ + + + + + +
string$str

String to fixEOL

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

addCustomHeader()

+ +
addCustomHeader(string  $name, string  $value = null) : void
+

Add a custom header.

+

$name value can be overloaded to contain +both header name and value (name:value)

+ +

Parameters

+ + + + + + + + + + + +
string$name

Custom header name

string$value

Header value

+ + + +
+
+ +
+ +
+
+ +
+

msgHTML()

+ +
msgHTML(string  $message, string  $basedir = '', boolean  $advanced = false) : string
+

Create a message from an HTML string.

+

Automatically makes modifications for inline images and backgrounds +and creates a plain-text version by converting the HTML. +Overwrites any existing values in $this->Body and $this->AltBody

+ +

Parameters

+ + + + + + + + + + + + + + + + +
string$message

HTML message string

string$basedir

baseline directory for path

boolean$advanced

Whether to use the advanced HTML to text converter

+ + +

Returns

+ string + —

$message

+ +
+
+ +
+ +
+
+ +
+

html2text()

+ +
html2text(string  $html, boolean  $advanced = false) : string
+

Convert an HTML string into plain text.

+ + +

Parameters

+ + + + + + + + + + + +
string$html

The HTML text to convert

boolean$advanced

Should this use the more complex html2text converter or just a simple one?

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

_mime_types()

+ +
_mime_types(string  $ext = '') : string
+

Get the MIME type for a file extension.

+ + +

Parameters

+ + + + + + +
string$ext

File extension

+ + +

Returns

+ string + —

MIME type of file.

+ +
+
+ +
+ +
+
+ +
+

filenameToType()

+ +
filenameToType(string  $filename) : string
+

Map a file name to a MIME type.

+

Defaults to 'application/octet-stream', i.e.. arbitrary binary data.

+ +

Parameters

+ + + + + + +
string$filename

A file name or full path, does not need to exist as a file

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

mb_pathinfo()

+ +
mb_pathinfo(string  $path, integer|string  $options = null) : string|array
+

Multi-byte-safe pathinfo replacement.

+

Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. +Works similarly to the one in PHP >= 5.2.0

+ +

Parameters

+ + + + + + + + + + + +
string$path

A filename or path, does not need to exist as a file

integer|string$options

Either a PATHINFO_* constant, +or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2

+ + +

Returns

+ string|array + +
+
+ +
+ +
+
+ +
+

set()

+ +
set(string  $name, mixed  $value = '') : boolean
+

Set or reset instance properties.

+

Usage Example: +$page->set('X-Priority', '3');

+ +

Parameters

+ + + + + + + + + + + +
string$name
mixed$value

NOTE: will not work with arrays, there are no arrays to set/reset

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

secureHeader()

+ +
secureHeader(string  $str) : string
+

Strip newlines to prevent header injection.

+ + +

Parameters

+ + + + + + +
string$str
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

normalizeBreaks()

+ +
normalizeBreaks(string  $text, string  $breaktype = "\r\n") : string
+

Normalize line breaks in a string.

+

Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. +Defaults to CRLF (for message bodies) and preserves consecutive breaks.

+ +

Parameters

+ + + + + + + + + + + +
string$text
string$breaktype

What kind of line break to use, defaults to CRLF

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

sign()

+ +
sign(string  $cert_filename, string  $key_filename, string  $key_pass) 
+

Set the public and private key files and password for S/MIME signing.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$cert_filename
string$key_filename
string$key_pass

Password for private key

+ + + +
+
+ +
+ +
+
+ +
+

DKIM_QP()

+ +
DKIM_QP(string  $txt) : string
+

Quoted-Printable-encode a DKIM header.

+ + +

Parameters

+ + + + + + +
string$txt
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

DKIM_Sign()

+ +
DKIM_Sign(string  $signheader) : string
+

Generate a DKIM signature.

+ + +

Parameters

+ + + + + + +
string$signheader

Header

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

DKIM_HeaderC()

+ +
DKIM_HeaderC(string  $signheader) : string
+

Generate a DKIM canonicalization header.

+ + +

Parameters

+ + + + + + +
string$signheader

Header

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

DKIM_BodyC()

+ +
DKIM_BodyC(string  $body) : string
+

Generate a DKIM canonicalization body.

+ + +

Parameters

+ + + + + + +
string$body

Message Body

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

DKIM_Add()

+ +
DKIM_Add(string  $headers_line, string  $subject, string  $body) : string
+

Create the DKIM header and body in a new message header.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$headers_line

Header lines

string$subject

Subject

string$body

Body

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

getToAddresses()

+ +
getToAddresses() : array
+

Allows for public read access to 'to' property.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

getCcAddresses()

+ +
getCcAddresses() : array
+

Allows for public read access to 'cc' property.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

getBccAddresses()

+ +
getBccAddresses() : array
+

Allows for public read access to 'bcc' property.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

getReplyToAddresses()

+ +
getReplyToAddresses() : array
+

Allows for public read access to 'ReplyTo' property.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

getAllRecipientAddresses()

+ +
getAllRecipientAddresses() : array
+

Allows for public read access to 'all_recipients' property.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

edebug()

+ +
edebug(string  $str) 
+

Output debugging info via user-defined method.

+

Only if debug output is enabled.

+ +

Parameters

+ + + + + + +
string$str
+ + + +
+
+ +
+ +
+
+ +
+

addAnAddress()

+ +
addAnAddress(string  $kind, string  $address, string  $name = '') : boolean
+

Add an address to one of the recipient arrays.

+

Addresses that have been added already return false, but do not throw exceptions

+ +

Parameters

+ + + + + + + + + + + + + + + + +
string$kind

One of 'to', 'cc', 'bcc', 'ReplyTo'

string$address

The email address to send to

string$name
+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + —

true on success, false if address already used or invalid in some way

+ +
+
+ +
+ +
+
+ +
+

sendmailSend()

+ +
sendmailSend(string  $header, string  $body) : boolean
+

Send mail using the $Sendmail program.

+ + +

Parameters

+ + + + + + + + + + + +
string$header

The message headers

string$body

The message body

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

mailSend()

+ +
mailSend(string  $header, string  $body) : boolean
+

Send mail using the PHP mail() function.

+ + +

Parameters

+ + + + + + + + + + + +
string$header

The message headers

string$body

The message body

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

smtpSend()

+ +
smtpSend(string  $header, string  $body) : boolean
+

Send mail via SMTP.

+

Returns false if there is a bad MAIL FROM, RCPT, or DATA input. +Uses the PHPMailerSMTP class by default.

+ +

Parameters

+ + + + + + + + + + + +
string$header

The message headers

string$body

The message body

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

getBoundary()

+ +
getBoundary(string  $boundary, string  $charSet, string  $contentType, string  $encoding) : string
+

Return the start of a message boundary.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$boundary
string$charSet
string$contentType
string$encoding
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

endBoundary()

+ +
endBoundary(string  $boundary) : string
+

Return the end of a message boundary.

+ + +

Parameters

+ + + + + + +
string$boundary
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

setMessageType()

+ +
setMessageType() : void
+

Set the message type.

+

PHPMailer only supports some preset message types, +not arbitrary MIME structures.

+ + + + +
+
+ +
+ +
+
+ +
+

attachAll()

+ +
attachAll(string  $disposition_type, string  $boundary) : string
+

Attach all file, string, and binary attachments to the message.

+

Returns an empty string on failure.

+ +

Parameters

+ + + + + + + + + + + +
string$disposition_type
string$boundary
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

encodeFile()

+ +
encodeFile(string  $path, string  $encoding = 'base64') : string
+

Encode a file attachment in requested format.

+

Returns an empty string on failure.

+ +

Parameters

+ + + + + + + + + + + +
string$path

The full path to the file

string$encoding

The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'

+ +

Throws

+
+
\phpmailerException
+
+
+ +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

setError()

+ +
setError(string  $msg) : void
+

Add an error message to the error container.

+ + +

Parameters

+ + + + + + +
string$msg
+ + + +
+
+ +
+ +
+
+ +
+

serverHostname()

+ +
serverHostname() : string
+

Get the server hostname.

+

Returns 'localhost.localdomain' if unknown.

+ + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

lang()

+ +
lang(string  $key) : string
+

Get an error message in the current language.

+ + +

Parameters

+ + + + + + +
string$key
+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

doCallback()

+ +
doCallback(boolean  $isSent, string  $to, string  $cc, string  $bcc, string  $subject, string  $body, string  $from = null) 
+

Perform a callback.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boolean$isSent
string$to
string$cc
string$bcc
string$subject
string$body
string$from
+ + + +
+
+ +
+ +
+
+ +
+

mailPassthru()

+ +
mailPassthru(string  $to, string  $subject, string  $body, string  $header, string  $params) : boolean
+

Call mail() in a safe_mode-aware fashion.

+

Also, unless sendmail_path points to sendmail (or something that +claims to be sendmail), don't pass params (not a perfect fix, +but it will do)

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$to

To

string$subject

Subject

string$body

Message Body

string$header

Additional Header(s)

string$params

Params

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/SMTP.html b/doc/classes/SMTP.html new file mode 100644 index 00000000..1f1811c9 --- /dev/null +++ b/doc/classes/SMTP.html @@ -0,0 +1,2653 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\SMTP

+

PHPMailer RFC821 SMTP email transport class.

+

Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.

+ + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ connect()
+ startTLS()
+ authenticate()
+ connected()
+ close()
+ data()
+ hello()
+ mail()
+ quit()
+ recipient()
+ reset()
+ sendAndMail()
+ verify()
+ noop()
+ turn()
+ client_send()
+ getError()
+ getLastReply()
+ setVerp()
+ getVerp()
+ setDebugOutput()
+ getDebugOutput()
+ setDebugLevel()
+ getDebugLevel()
+ setTimeout()
+ getTimeout()
+
+
+ $Version
+ $SMTP_PORT
+ $CRLF
+ $do_debug
+ $Debugoutput
+ $do_verp
+ $Timeout
+ $Timelimit
+
+
+ VERSION
+ CRLF
+ DEFAULT_SMTP_PORT
+ MAX_LINE_LENGTH
+
+
+
+
+ edebug()
+ hmac()
+ sendHello()
+ sendCommand()
+ get_lines()
+
+
+ $smtp_conn
+ $error
+ $helo_rply
+ $last_reply
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

VERSION

+
VERSION
+

The PHPMailer SMTP version number.

+ +
+
+ +
+ +
+
+ +
+

CRLF

+
CRLF
+

SMTP line break constant.

+ +
+
+ +
+ +
+
+ +
+

DEFAULT_SMTP_PORT

+
DEFAULT_SMTP_PORT
+

The SMTP port to use if one is not specified.

+ +
+
+ +
+ +
+
+ +
+

MAX_LINE_LENGTH

+
MAX_LINE_LENGTH
+

The maximum line length allowed by RFC 2822 section 2.1.1

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$Version

+
$Version : 
+

The PHPMailer SMTP Version number.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$SMTP_PORT

+
$SMTP_PORT : 
+

SMTP server port number.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$CRLF

+
$CRLF : 
+

SMTP reply line ending.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$do_debug

+
$do_debug : 
+

Debug output level.

+

Options:

+
    +
  • 0 No output
  • +
  • 1 Commands
  • +
  • 2 Data and commands
  • +
  • 3 As 2 plus connection status
  • +
  • 4 Low-level data output
  • +
+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Debugoutput

+
$Debugoutput : 
+

How to handle debug output.

+

Options:

+
    +
  • echo Output plain-text as-is, appropriate for CLI
  • +
  • html Output escaped, line breaks converted to
    , appropriate for browser output
  • +
  • error_log Output to error log as configured in php.ini
  • +
+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$do_verp

+
$do_verp : 
+

Whether to use VERP.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$Timeout

+
$Timeout : 
+

The timeout value for connection, in seconds.

+

Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 +This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.

+ +

Type

+ +
+
+ +
+ +
+
+ +
+

$Timelimit

+
$Timelimit : 
+

The SMTP timelimit value for reads, in seconds.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$smtp_conn

+
$smtp_conn : 
+

The socket for the server connection.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$error

+
$error : 
+

Error message, if any, for the last call.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$helo_rply

+
$helo_rply : 
+

The reply the server sent to us for HELO.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$last_reply

+
$last_reply : 
+

The most recent reply received from the server.

+ + +

Type

+ +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct() 
+

Constructor.

+ + + + + +
+
+ +
+ +
+
+ +
+

connect()

+ +
connect(string  $host, integer  $port = null, integer  $timeout = 30, array  $options = array()) : boolean
+

Connect to an SMTP server.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$host

SMTP server IP or host name

integer$port

The port number to connect to

integer$timeout

How long to wait for the connection to open

array$options

An array of options for stream_context_create()

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

startTLS()

+ +
startTLS() : boolean
+

Initiate a TLS (encrypted) session.

+ + + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

authenticate()

+ +
authenticate(string  $username, string  $password, string  $authtype = 'LOGIN', string  $realm = '', string  $workstation = '') : boolean
+

Perform SMTP authentication.

+

Must be run after hello().

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$username

The user name

string$password

The password

string$authtype

The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)

string$realm

The auth realm for NTLM

string$workstation

The auth workstation for NTLM

+ + +

Returns

+ boolean + —

True if successfully authenticated.

+ +
+
+ +
+ +
+
+ +
+

connected()

+ +
connected() : boolean
+

Check connection state.

+ + + + +

Returns

+ boolean + —

True if connected.

+ +
+
+ +
+ +
+
+ +
+

close()

+ +
close() : void
+

Close the socket and clean up the state of the class.

+

Don't use this function without first trying to use QUIT.

+ + + + +
+
+ +
+ +
+
+ +
+

data()

+ +
data(string  $msg_data) : boolean
+

Send an SMTP DATA command.

+

Issues a data command and sends the msg_data to the server, +finializing the mail transaction. $msg_data is the message +that is to be send with the headers. Each header needs to be +on a single line followed by a with the message headers +and the message body being separated by and additional . +Implements rfc 821: DATA

+ +

Parameters

+ + + + + + +
string$msg_data

Message data to send

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

hello()

+ +
hello(string  $host = '') : boolean
+

Send an SMTP HELO or EHLO command.

+

Used to identify the sending server to the receiving server. +This makes sure that client and server are in a known state. +Implements RFC 821: HELO +and RFC 2821 EHLO.

+ +

Parameters

+ + + + + + +
string$host

The host name or IP to connect to

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

mail()

+ +
mail(string  $from) : boolean
+

Send an SMTP MAIL command.

+

Starts a mail transaction from the email address specified in +$from. Returns true if successful or false otherwise. If True +the mail transaction is started and then one or more recipient +commands may be called followed by a data command. +Implements rfc 821: MAIL FROM:

+ +

Parameters

+ + + + + + +
string$from

Source address of this message

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

quit()

+ +
quit(boolean  $close_on_error = true) : boolean
+

Send an SMTP QUIT command.

+

Closes the socket if there is no error or the $close_on_error argument is true. +Implements from rfc 821: QUIT

+ +

Parameters

+ + + + + + +
boolean$close_on_error

Should the connection close if an error occurs?

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

recipient()

+ +
recipient(string  $toaddr) : boolean
+

Send an SMTP RCPT command.

+

Sets the TO argument to $toaddr. +Returns true if the recipient was accepted false if it was rejected. +Implements from rfc 821: RCPT TO:

+ +

Parameters

+ + + + + + +
string$toaddr

The address the message is being sent to

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

reset()

+ +
reset() : boolean
+

Send an SMTP RSET command.

+

Abort any transaction that is currently in progress. +Implements rfc 821: RSET

+ + + +

Returns

+ boolean + —

True on success.

+ +
+
+ +
+ +
+
+ +
+

sendAndMail()

+ +
sendAndMail(string  $from) : boolean
+

Send an SMTP SAML command.

+

Starts a mail transaction from the email address specified in $from. +Returns true if successful or false otherwise. If True +the mail transaction is started and then one or more recipient +commands may be called followed by a data command. This command +will send the message to the users terminal if they are logged +in and send them an email. +Implements rfc 821: SAML FROM:

+ +

Parameters

+ + + + + + +
string$from

The address the message is from

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

verify()

+ +
verify(string  $name) : boolean
+

Send an SMTP VRFY command.

+ + +

Parameters

+ + + + + + +
string$name

The name to verify

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

noop()

+ +
noop() : boolean
+

Send an SMTP NOOP command.

+

Used to keep keep-alives alive, doesn't actually do anything

+ + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

turn()

+ +
turn() : boolean
+

Send an SMTP TURN command.

+

This is an optional command for SMTP that this class does not support. +This method is here to make the RFC821 Definition complete for this class +and may be implemented in future +Implements from rfc 821: TURN

+ + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

client_send()

+ +
client_send(string  $data) : integer|boolean
+

Send raw data to the server.

+ + +

Parameters

+ + + + + + +
string$data

The data to send

+ + +

Returns

+ integer|boolean + —

The number of bytes sent to the server or false on error

+ +
+
+ +
+ +
+
+ +
+

getError()

+ +
getError() : array
+

Get the latest error.

+ + + + +

Returns

+ array + +
+
+ +
+ +
+
+ +
+

getLastReply()

+ +
getLastReply() : string
+

Get the last reply from the server.

+ + + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

setVerp()

+ +
setVerp(boolean  $enabled = false) 
+

Enable or disable VERP address generation.

+ + +

Parameters

+ + + + + + +
boolean$enabled
+ + + +
+
+ +
+ +
+
+ +
+

getVerp()

+ +
getVerp() : boolean
+

Get VERP address generation mode.

+ + + + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

setDebugOutput()

+ +
setDebugOutput(string  $method = 'echo') 
+

Set debug output method.

+ + +

Parameters

+ + + + + + +
string$method

The function/method to use for debugging output.

+ + + +
+
+ +
+ +
+
+ +
+

getDebugOutput()

+ +
getDebugOutput() : string
+

Get debug output method.

+ + + + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

setDebugLevel()

+ +
setDebugLevel(integer  $level) 
+

Set debug output level.

+ + +

Parameters

+ + + + + + +
integer$level
+ + + +
+
+ +
+ +
+
+ +
+

getDebugLevel()

+ +
getDebugLevel() : integer
+

Get debug output level.

+ + + + +

Returns

+ integer + +
+
+ +
+ +
+
+ +
+

setTimeout()

+ +
setTimeout(integer  $timeout) 
+

Set SMTP timeout.

+ + +

Parameters

+ + + + + + +
integer$timeout
+ + + +
+
+ +
+ +
+
+ +
+

getTimeout()

+ +
getTimeout() : integer
+

Get SMTP timeout.

+ + + + +

Returns

+ integer + +
+
+ +
+ +
+
+ +
+

edebug()

+ +
edebug(string  $str) : void
+

Output debugging info via a user-selected method.

+ + +

Parameters

+ + + + + + +
string$str

Debug string to output

+ + + +
+
+ +
+ +
+
+ +
+

hmac()

+ +
hmac(string  $data, string  $key) : string
+

Calculate an MD5 HMAC hash.

+

Works like hash_hmac('md5', $data, $key) +in case that function is not available

+ +

Parameters

+ + + + + + + + + + + +
string$data

The data to hash

string$key

The key to hash with

+ + +

Returns

+ string + +
+
+ +
+ +
+
+ +
+

sendHello()

+ +
sendHello(string  $hello, string  $host) : boolean
+

Send an SMTP HELO or EHLO command.

+

Low-level implementation used by hello()

+ +

Parameters

+ + + + + + + + + + + +
string$hello

The HELO string

string$host

The hostname to say we are

+ + +

Returns

+ boolean + +
+
+ +
+ +
+
+ +
+

sendCommand()

+ +
sendCommand(string  $command, string  $commandstring, integer|array  $expect) : boolean
+

Send a command to an SMTP server and check its return code.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$command

The command name - not sent to the server

string$commandstring

The actual command to send

integer|array$expect

One or more expected integer success codes

+ + +

Returns

+ boolean + —

True on success.

+ +
+
+ +
+ +
+
+ +
+

get_lines()

+ +
get_lines() : string
+

Read the SMTP server's response.

+

Either before eof or socket timeout occurs on the operation. +With SMTP we can tell if we have more lines to read if the +4th character is '-' symbol. If it is a space then we don't +need to read anything else.

+ + + +

Returns

+ string + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.Controller.html b/doc/classes/hhu.z.Controller.html new file mode 100644 index 00000000..10c09301 --- /dev/null +++ b/doc/classes/hhu.z.Controller.html @@ -0,0 +1,1870 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\zController

+

Abstract class for implementing an application Controller.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ __construct()
+ preFilter()
+ postFilter()
+ run()
+ render()
+
+
+ $components
+
+
+ No constants found +
+
+
+
+ set()
+ redirect()
+ checkModels()
+ getView()
+ loadModels()
+ loadView()
+ log()
+
+
+ $agent
+ $view
+ $viewData
+ $request
+ $response
+ $log
+ $linker
+
+
+ N/A +
+
+
+
+ getClassName()
+ loadComponents()
+
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$components

+
$components : array
+

Required components

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$agent

+
$agent : \nre\core\Agent
+

Corresponding Agent

+ + +

Type

+ \nre\core\Agent +
+
+ +
+ +
+
+ +
+

$view

+
$view : \nre\core\View
+

View of the Controller

+ + +

Type

+ \nre\core\View +
+
+ +
+ +
+
+ +
+

$viewData

+
$viewData : array
+

Data to pass to the View

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ +
+
+ +
+

$log

+
$log : \nre\core\Logger
+

Logger instance

+ + +

Type

+ \nre\core\Logger +
+
+ +
+ +
+
+ +
+

$linker

+
$linker : \nre\core\Linker
+

Linker instance

+ + +

Type

+ \nre\core\Linker +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $controllerName) 
+

Load the class of a Controller.

+ + +

Parameters

+ + + + + + +
string$controllerName

Name of the Controller to load

+ +

Throws

+
+
\nre\exceptions\ControllerNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $controllerName, string  $layoutName, string  $action, string  $agent) 
+

Instantiate a Controller (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$controllerName

Name of the Controller to instantiate

string$layoutName

Name of the current Layout

string$action

Current Action

string$agent

Corresponding Agent

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(string  $layoutName, string  $action, \nre\core\Agent  $agent) 
+

Construct a new application Controller.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$layoutName

Name of the current Layout

string$action

Current Action

\nre\core\Agent$agent

Corresponding Agent

+ +

Throws

+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

preFilter()

+ +
preFilter(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Prefilter that is executed before running the Controller.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

postFilter()

+ +
postFilter(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Postfilter that is executed after running the Controller.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Run the Controller.

+

This method executes the Action of the Controller defined by +the current Request.

+ +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $viewData = null) : string
+

Generate the output.

+ + +

Parameters

+ + + + + + +
array$viewData

Data to pass to the View

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

set()

+ +
set(string  $name, mixed  $data) 
+

Set data for the View.

+ + +

Parameters

+ + + + + + + + + + + +
string$name

Key

mixed$data

Value

+ + + +
+
+ +
+ +
+
+ +
+

redirect()

+ +
redirect(string  $url) 
+

Redirect to the given URL.

+ + +

Parameters

+ + + + + + +
string$url

Relative URL

+ + + +
+
+ +
+ +
+
+ +
+

checkModels()

+ +
checkModels(string  $modelName) : boolean
+

Check if Models of this Controller are loaded and available.

+ + +

Parameters

+ + + + + + +
string$modelName

Arbitrary number of Models to check

+ + +

Returns

+ boolean + —

All given Models are loaded and available

+ +
+
+ +
+ +
+
+ +
+

getView()

+ +
getView() : \nre\core\View
+

Get the View of the Controller

+ + + + +

Returns

+ \nre\core\View + —

View of the Controller

+ +
+
+ +
+ +
+
+ +
+

loadModels()

+ +
loadModels() 
+

Load the Models of this Controller.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

loadView()

+ +
loadView(string  $layoutName, string  $action) 
+

Load the View of this Controller.

+ + +

Parameters

+ + + + + + + + + + + +
string$layoutName

Name of the current Layout

string$action

Current Action

+ +

Throws

+
+
\nre\exceptions\ViewNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(string  $message, integer  $logMode = \nre\core\Logger::LOGMODE_AUTO) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
string$message

Error message to log

integer$logMode

Log mode (optional)

+ + + +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $controllerName) : string
+

Determine the classname for the given Controller name.

+ + +

Parameters

+ + + + + + +
string$controllerName

Controller name to get classname of

+ + +

Returns

+ string + —

Classname for the Controller name

+ +
+
+ +
+ +
+
+ +
+

loadComponents()

+ +
loadComponents() 
+

Load the Components of this Controller.

+ + + +

Throws

+
+
\nre\exceptions\ComponentNotValidException
+
+
\nre\exceptions\ComponentNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.Model.html b/doc/classes/hhu.z.Model.html new file mode 100644 index 00000000..666c68b6 --- /dev/null +++ b/doc/classes/hhu.z.Model.html @@ -0,0 +1,1292 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\zModel

+

Abstract class for implementing an application Model.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ load()
+ factory()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ $db
+
+
+ N/A +
+
+
+
+ loadDriver()
+ connect()
+ getClassName()
+ loadModels()
+
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$db

+
$db : \nre\models\DatabaseDriver
+

Database connection

+ + +

Type

+ \nre\models\DatabaseDriver +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct() 
+

Construct a new application Model.

+

TODO Catch exception

+ + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $modelName) 
+

Load the class of a Model.

+ + +

Parameters

+ + + + + + +
string$modelName

Name of the Model to load

+ +

Throws

+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $modelName) 
+

Instantiate a Model (Factory Pattern).

+ + +

Parameters

+ + + + + + +
string$modelName

Name of the Model to instantiate

+ + + +
+
+ +
+ +
+
+ +
+

loadDriver()

+ +
loadDriver(string  $driverName) 
+

Load the database driver.

+ + +

Parameters

+ + + + + + +
string$driverName

Name of the database driver

+ +

Throws

+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

connect()

+ +
connect(string  $driverName, array  $config) 
+

Establish a connection to the database.

+ + +

Parameters

+ + + + + + + + + + + +
string$driverName

Name of the database driver

array$config

Connection settings

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $modelName) : string
+

Determine the classname for the given Model name.

+ + +

Parameters

+ + + + + + +
string$modelName

Model name to get classname of

+ + +

Returns

+ string + —

Classname fore the Model name

+ +
+
+ +
+ +
+
+ +
+

loadModels()

+ +
loadModels() 
+

Load the Models of this Model.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.TextFormatter.html b/doc/classes/hhu.z.TextFormatter.html new file mode 100644 index 00000000..e5d900e1 --- /dev/null +++ b/doc/classes/hhu.z.TextFormatter.html @@ -0,0 +1,1117 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\zTextFormatter

+

Class to format text with different syntax tags.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ t()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ loadMediaModel()
+
+
+ $linker
+ $Media
+
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$linker

+
$linker : \nre\core\Linker
+

Linker to create links.

+ + +

Type

+ \nre\core\Linker +
+
+ +
+ +
+
+ +
+

$Media

+
$Media : \nre\core\Model
+

Media-Model to retrieve media data

+ + +

Type

+ \nre\core\Model +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Linker  $linker) 
+

Create a new text formatter.

+ + +

Parameters

+ + + + + + +
\nre\core\Linker$linker

Linker to create links with

+ + + +
+
+ +
+ +
+
+ +
+

t()

+ +
t(string  $string) : string
+

Format a string.

+ + +

Parameters

+ + + + + + +
string$string

String to format

+ + +

Returns

+ string + —

Formatted string

+ +
+
+ +
+ +
+
+ +
+

loadMediaModel()

+ +
loadMediaModel() : boolean
+

Load the Media-Model if it is not loaded

+ + + + +

Returns

+ boolean + —

Whether the Media-Model has been loaded or not

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.Utils.html b/doc/classes/hhu.z.Utils.html new file mode 100644 index 00000000..38a7b5a4 --- /dev/null +++ b/doc/classes/hhu.z.Utils.html @@ -0,0 +1,1204 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\zUtils

+

Class for implementing utility methods.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ t()
+ htmlspecialchars_utf8()
+ shortenString()
+ sendMail()
+ getMimetype()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + + +
+

Methods

+ +
+ +
+
+ +
+

t()

+ +
t(string  $string) : string
+

Mask HTML-chars for save output.

+ + +

Parameters

+ + + + + + +
string$string

String to be masked

+ + +

Returns

+ string + —

Masked string

+ +
+
+ +
+ +
+
+ +
+

htmlspecialchars_utf8()

+ +
htmlspecialchars_utf8(string  $string) : string
+

‚htmlspecialchars‘ with support for UTF-8.

+ + +

Parameters

+ + + + + + +
string$string

String to be masked

+ + +

Returns

+ string + —

Masked string

+ +
+
+ +
+ +
+
+ +
+

shortenString()

+ +
shortenString(string  $string, integer  $length, integer  $scope) : string
+

Cut a string to the given length but only word boundaries.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$string

String to cut

integer$length

Length to cut string

integer$scope

Maximum length to cut string regardless word boundaries

+ + +

Returns

+ string + —

Cutted string

+ +
+
+ +
+ +
+
+ +
+

sendMail()

+ +
sendMail(mixed  $to, string  $messageAction, boolean  $html = false, array  $params = null, \nre\core\Linker  $linker = null) 
+

Send an e‑mail.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
mixed$to

One (string) or many (array) receivers

string$messageAction

Message Action

boolean$html

Whether mail should be formatted as HTML or not

array$params

Parameters to pass

\nre\core\Linker$linker

Linker instance

+ +

Throws

+
+
\hhu\z\exceptions\MailingException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getMimetype()

+ +
getMimetype(string  $filename, string  $defaultMimetype = null) : string
+

Detect Mimetype of a file.

+ + +

Parameters

+ + + + + + + + + + + +
string$filename

Name of file to detect Mimetype of

string$defaultMimetype

Default Mimetype to use

+ + +

Returns

+ string + —

Detected Mimetype of file

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.QuesttypeAgent.html b/doc/classes/hhu.z.agents.QuesttypeAgent.html new file mode 100644 index 00000000..14dcbe21 --- /dev/null +++ b/doc/classes/hhu.z.agents.QuesttypeAgent.html @@ -0,0 +1,2142 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agentsQuesttypeAgent

+

Abstract class for implementing a QuesttypeAgent.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ checkClass()
+ saveAnswersOfCharacter()
+ matchAnswersOfCharacter()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+ loadClass()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $questtypeName) 
+

Load a QuesttypeAgent.

+ + +

Parameters

+ + + + + + +
string$questtypeName

Name of the QuesttypeAgent to load

+ +

Throws

+
+
\hhu\z\exceptions\QuesttypeAgentNotFoundException
+
+
\hhu\z\exceptions\QuesttypeAgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $questtypeName, \hhu\z\agents\Request  $request, \hhu\z\agents\Response  $response, \hhu\z\agents\Logger  $log = null) 
+

Instantiate a QuesttypeAgent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$questtypeName

Name of the QuesttypeAgent to instantiate

\hhu\z\agents\Request$request

Current request

\hhu\z\agents\Response$response

Current respone

\hhu\z\agents\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\hhu\z\exceptions\QuesttypeModelNotValidException
+
+
\hhu\z\exceptions\QuesttypeModelNotFoundException
+
+
\hhu\z\exceptions\QuesttypeControllerNotValidException
+
+
\hhu\z\exceptions\QuesttypeControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

checkClass()

+ +
checkClass(string  $className, string  $parentClassName) 
+

Check inheritance of the QuesttypeAgent-class.

+ + +

Parameters

+ + + + + + + + + + + +
string$className

Name of the class to check

string$parentClassName

Name of the parent class

+ +

Throws

+
+
\nre\exceptions\ClassNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

saveAnswersOfCharacter()

+ +
saveAnswersOfCharacter(array  $seminary, array  $questgroup, array  $quest, array  $character, array  $answers) 
+

Save the answers of a Character for a Quest.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
array$seminary

Current Seminary data

array$questgroup

Current Questgroup data

array$quest

Current Quest data

array$character

Current Character data

array$answers

Character answers for the Quest

+ + + +
+
+ +
+ +
+
+ +
+

matchAnswersOfCharacter()

+ +
matchAnswersOfCharacter(array  $seminary, array  $questgroup, array  $quest, array  $character, array  $answers) 
+

Check if answers of a Character for a Quest match the correct ones.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
array$seminary

Current Seminary data

array$questgroup

Current Questgroup data

array$quest

Current Quest data

array$character

Current Character data

array$answers

Character answers for the Quest

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new QuesttypeAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\hhu\z\exceptions\QuesttypeModelNotValidException
+
+
\hhu\z\exceptions\QuesttypeModelNotFoundException
+
+
\hhu\z\exceptions\QuesttypeControllerNotValidException
+
+
\hhu\z\exceptions\QuesttypeControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\hhu\z\exceptions\QuesttypeModelNotValidException
+
+
\hhu\z\exceptions\QuesttypeModelNotFoundException
+
+
\hhu\z\exceptions\QuesttypeControllerNotValidException
+
+
\hhu\z\exceptions\QuesttypeControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $questtypeName, string  $agentType = null) : string
+

Determine the Agent-classname for the given Questtype-name.

+ + +

Parameters

+ + + + + + + + + + + +
string$questtypeName

Questtype-name to get Agent-classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Questtype-name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ +
+

loadClass()

+ +
loadClass(string  $questtypeName, string  $fullClassName) 
+

Load the class of a QuesttypeAgent.

+ + +

Parameters

+ + + + + + + + + + + +
string$questtypeName

Name of the QuesttypeAgent to load

string$fullClassName

Name of the class to load

+ +

Throws

+
+
\nre\exceptions\ClassNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.ToplevelAgent.html b/doc/classes/hhu.z.agents.ToplevelAgent.html new file mode 100644 index 00000000..2ad9720a --- /dev/null +++ b/doc/classes/hhu.z.agents.ToplevelAgent.html @@ -0,0 +1,2264 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agentsToplevelAgent

+

Abstract class for implementing an application Controller.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ run()
+ render()
+ getIntermediateAgent()
+ load()
+ factory()
+
+
+ $controller
+
+
+ STAGE_LOAD
+ STAGE_RUN
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ addSubAgent()
+ actionConstruct()
+ loadController()
+ log()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ loadIntermediateAgent()
+ _loadIntermediateAgent()
+ _run()
+ runIntermediateAgent()
+ error()
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+ $layout
+ $intermediateAgent
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

STAGE_LOAD

+
STAGE_LOAD
+

Stage: Load

+ +
+
+ +
+ +
+
+ +
+

STAGE_RUN

+
STAGE_RUN
+

Stage: Run

+ +
+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ +
+
+ +
+

$layout

+
$layout : \nre\core\Layout
+

Layout instace

+ + +

Type

+ \nre\core\Layout +
+
+ +
+ +
+
+ +
+

$intermediateAgent

+
$intermediateAgent : \nre\agents\IntermediateAgent
+

IntermediateAgent instance

+ + +

Type

+ \nre\agents\IntermediateAgent +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

getIntermediateAgent()

+ +
getIntermediateAgent() : \nre\agents\IntermediateAgent
+

Return the IntermediateAgent.

+ + + + +

Returns

+ \nre\agents\IntermediateAgent + —

IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new ToplevlAgent

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

\nre\core\Logger$log

Logger instance

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

loadIntermediateAgent()

+ +
loadIntermediateAgent() 
+

Load IntermediateAgent defined by the current request.

+ + + +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_loadIntermediateAgent()

+ +
_loadIntermediateAgent() 
+

Load IntermediateAgent defined by the current request.

+ + + +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_run()

+ +
_run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\AccessDeniedException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

runIntermediateAgent()

+ +
runIntermediateAgent() 
+

Run IntermediateAgent.

+ + + +

Throws

+
+
\nre\exceptions\AccessDeniedException
+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
+ + +
+
+ +
+ +
+
+ +
+

error()

+ +
error(\Exception  $exception, integer  $httpStatusCode, string  $stage = self::STAGE_LOAD) 
+

Handle an error that occurred during +loading/cnostructing/running of the IntermediateAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$httpStatusCode

HTTP-statuscode

string$stage

Stage of execution

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.MailreceiverAgent.html b/doc/classes/hhu.z.agents.bottomlevel.MailreceiverAgent.html new file mode 100644 index 00000000..70ad0804 --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.MailreceiverAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelMailreceiverAgent

+

Agent to generate a mail receiver salutation.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.MenuAgent.html b/doc/classes/hhu.z.agents.bottomlevel.MenuAgent.html new file mode 100644 index 00000000..7bedee57 --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.MenuAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelMenuAgent

+

Agent to display a menu.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.QuestgroupshierarchypathAgent.html b/doc/classes/hhu.z.agents.bottomlevel.QuestgroupshierarchypathAgent.html new file mode 100644 index 00000000..0f8575a4 --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.QuestgroupshierarchypathAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelQuestgroupshierarchypathAgent

+

Agent to display the Questgroups hierarchy path.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.SeminarybarAgent.html b/doc/classes/hhu.z.agents.bottomlevel.SeminarybarAgent.html new file mode 100644 index 00000000..46cc35f9 --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.SeminarybarAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelSeminarybarAgent

+

Agent to display a sidebar with Seminary related information.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.SeminarymenuAgent.html b/doc/classes/hhu.z.agents.bottomlevel.SeminarymenuAgent.html new file mode 100644 index 00000000..4bd07065 --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.SeminarymenuAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelSeminarymenuAgent

+

Agent to display a menu with Seminary related links.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.bottomlevel.UserrolesAgent.html b/doc/classes/hhu.z.agents.bottomlevel.UserrolesAgent.html new file mode 100644 index 00000000..74030f3e --- /dev/null +++ b/doc/classes/hhu.z.agents.bottomlevel.UserrolesAgent.html @@ -0,0 +1,1971 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\bottomlevelUserrolesAgent

+

Agent to display and manage userroles.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ load()
+ factory()
+ run()
+ render()
+ user()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

user()

+ +
user(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: user.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.AchievementsAgent.html b/doc/classes/hhu.z.agents.intermediate.AchievementsAgent.html new file mode 100644 index 00000000..e3f78376 --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.AchievementsAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateAchievementsAgent

+

Agent to list Achievements.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.CharactergroupsAgent.html b/doc/classes/hhu.z.agents.intermediate.CharactergroupsAgent.html new file mode 100644 index 00000000..7c43eaec --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.CharactergroupsAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateCharactergroupsAgent

+

Agent to display Character groups.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.CharactergroupsquestsAgent.html b/doc/classes/hhu.z.agents.intermediate.CharactergroupsquestsAgent.html new file mode 100644 index 00000000..d42a9971 --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.CharactergroupsquestsAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateCharactergroupsquestsAgent

+

Agent to display Character groups Quests.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.CharactersAgent.html b/doc/classes/hhu.z.agents.intermediate.CharactersAgent.html new file mode 100644 index 00000000..2d3e3f9a --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.CharactersAgent.html @@ -0,0 +1,2052 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateCharactersAgent

+

Agent to list registered Characters and their data.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+ character()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

character()

+ +
character(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: character.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.CharactertypesAgent.html b/doc/classes/hhu.z.agents.intermediate.CharactertypesAgent.html new file mode 100644 index 00000000..c3b552ff --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.CharactertypesAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateCharactertypesAgent

+

Agent to handle Charactertyes of a Seminary.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.ErrorAgent.html b/doc/classes/hhu.z.agents.intermediate.ErrorAgent.html new file mode 100644 index 00000000..b63ed165 --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.ErrorAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateErrorAgent

+

Agent to show an error page.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.IntroductionAgent.html b/doc/classes/hhu.z.agents.intermediate.IntroductionAgent.html new file mode 100644 index 00000000..5fa8154d --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.IntroductionAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateIntroductionAgent

+

Agent to show an introduction page.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.LibraryAgent.html b/doc/classes/hhu.z.agents.intermediate.LibraryAgent.html new file mode 100644 index 00000000..5197a5b2 --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.LibraryAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateLibraryAgent

+

Agent to list Quest topics.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.MailAgent.html b/doc/classes/hhu.z.agents.intermediate.MailAgent.html new file mode 100644 index 00000000..475e1b34 --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.MailAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\hhu\z\agents\intermediateMailAgent

+

Agent to generate a mail-message.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getLayout()
+ load()
+ factory()
+ run()
+ render()
+ index()
+
+
+ $controller
+
+
+ INLINEERROR_AGENT
+
+
+
+
+ __construct()
+ actionConstruct()
+ loadController()
+ log()
+ addSubAgent()
+ _addSubAgent()
+
+
+ $log
+ $subAgents
+
+
+ N/A +
+
+
+
+ getAgentType()
+ getClassName()
+ newSubAgent()
+ renderSubAgent()
+ errorInline()
+ newInlineError()
+ newInlineErrorService()
+
+
+ $request
+ $response
+
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

INLINEERROR_AGENT

+
INLINEERROR_AGENT
+

Name of BottomlevelAgent for showing inline errors

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$controller

+
$controller : \nre\core\Controller
+

Controller of this Agent

+ + +

Type

+ \nre\core\Controller +
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

$subAgents

+
$subAgents : array
+

SubAgents

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$request

+
$request : \nre\core\Request
+

Current request

+ + +

Type

+ \nre\core\Request +
+
+ +
+ +
+
+ +
+

$response

+
$response : \nre\core\Response
+

Current response

+ + +

Type

+ \nre\core\Response +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getLayout()

+ +
getLayout(string  $agentName) : string
+

Get the layout if it was explicitly defined.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ + +

Returns

+ string + —

Layout of the IntermediateAgent

+ +
+
+ +
+ +
+
+ +
+

load()

+ +
load(string  $agentName) 
+

Load the class of an Agent.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

factory()

+ +
factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Instantiate an Agent (Factory Pattern).

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
string$agentName

Name of the Agent to instantiate

\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

run()

+ +
run(\nre\core\Request  $request, \nre\core\Response  $response) : \Exception
+

Run the Controller of this Agent and its SubAgents.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ +

Throws

+
+
\nre\exceptions\ParamsNotValidException
+
+
\nre\exceptions\IdNotFoundException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\ActionNotFoundException
+
+
+ +

Returns

+ \Exception + —

Last occurred exception of SubAgents

+ +
+
+ +
+ +
+
+ +
+

render()

+ +
render(array  $data = array()) : string
+

Generate output of the Controller of this Agent and its +SubAgents.

+ + +

Parameters

+ + + + + + +
array$data

View data

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

index()

+ +
index(\nre\core\Request  $request, \nre\core\Response  $response) 
+

Action: index.

+ + +

Parameters

+ + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response

Current response

+ + + +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 
+

Construct a new Agent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
\nre\core\Request$request

Current request

\nre\core\Response$response
\nre\core\Logger$log

Log-system

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

actionConstruct()

+ +
actionConstruct() 
+

Construct SubAgents (per Action).

+ + + + + +
+
+ +
+ +
+
+ +
+

loadController()

+ +
loadController() 
+

Load the Controller of this Agent.

+ + + +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\DriverNotValidException
+
+
\nre\exceptions\DriverNotFoundException
+
+
\nre\exceptions\ViewNotFoundException
+
+
\nre\exceptions\ModelNotValidException
+
+
\nre\exceptions\ModelNotFoundException
+
+
\nre\exceptions\ControllerNotValidException
+
+
\nre\exceptions\ControllerNotFoundException
+
+
+ + +
+
+ +
+ +
+
+ +
+

log()

+ +
log(\Exception  $exception, integer  $logMode) 
+

Log an error.

+ + +

Parameters

+ + + + + + + + + + + +
\Exception$exception

Occurred exception

integer$logMode

Log mode

+ + + +
+
+ +
+ +
+
+ +
+

addSubAgent()

+ +
addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

_addSubAgent()

+ +
_addSubAgent(string  $agentName) 
+

Load a SubAgent and add it.

+ + +

Parameters

+ + + + + + +
string$agentName

Name of the Agent to load

+ +

Throws

+
+
\nre\exceptions\ServiceUnavailableException
+
+
\nre\exceptions\DatamodelException
+
+
\nre\exceptions\AgentNotFoundException
+
+
\nre\exceptions\AgentNotValidException
+
+
+ + +
+
+ +
+ +
+
+ +
+

getAgentType()

+ +
getAgentType() : string
+

Determine the type of an Agent.

+ + + + +

Returns

+ string + —

Agent type

+ +
+
+ +
+ +
+
+ +
+

getClassName()

+ +
getClassName(string  $agentName, string  $agentType) : string
+

Determine the classname for the given Agent name.

+ + +

Parameters

+ + + + + + + + + + + +
string$agentName

Agent name to get classname of

string$agentType

Agent type of given Agent name

+ + +

Returns

+ string + —

Classname for the Agent name

+ +
+
+ +
+ +
+
+ +
+

newSubAgent()

+ +
newSubAgent(string  $agentName) : array
+

Create a new SubAgent.

+ + +

Parameters

+ + + + + + +
string$agentName

Agent name

+ +

Throws

+
+
\nre\exceptions\DatamodelException
+
+
+ +

Returns

+ array + —

SubAgent

+ +
+
+ +
+ +
+
+ +
+

renderSubAgent()

+ +
renderSubAgent(array  $subAgent) : string
+

Render a SubAgent.

+ + +

Parameters

+ + + + + + +
array$subAgent

SubAgent to render

+ + +

Returns

+ string + —

Generated output

+ +
+
+ +
+ +
+
+ +
+

errorInline()

+ +
errorInline(array  $subAgent, \nre\core\Request  $request, \nre\core\Excepiton  $exception) : array
+

Handle the exception of a SubAgent.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
array$subAgent

Original (Sub-) Agent

\nre\core\Request$request

Current request

\nre\core\Excepiton$exception

Occurred exception

+ + +

Returns

+ array + —

InlineError-SubAgent

+ +
+
+ +
+ +
+
+ +
+

newInlineError()

+ +
newInlineError(string  $label, \Exception  $exception) 
+

Create a new InlineError.

+ + +

Parameters

+ + + + + + + + + + + +
string$label

Name of the original Agent

\Exception$exception

Occurred exception

+ + + +
+
+ +
+ +
+
+ +
+

newInlineErrorService()

+ +
newInlineErrorService() 
+

Handle a hardcore error that could not be handled by the +system.

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/doc/classes/hhu.z.agents.intermediate.MediaAgent.html b/doc/classes/hhu.z.agents.intermediate.MediaAgent.html new file mode 100644 index 00000000..eb726f1f --- /dev/null +++ b/doc/classes/hhu.z.agents.intermediate.MediaAgent.html @@ -0,0 +1,2012 @@ + + + + + + Questlab + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+