ProcesEditor.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <?php
  2. Lib::loadClass('RouteBase');
  3. Lib::loadClass('ProcesHelper');
  4. Lib::loadClass('Config');
  5. Lib::loadClass('UI');
  6. Lib::loadClass('Request');
  7. class Route_UrlAction_ProcesEditor extends RouteBase {// TODO: UrlActionBase @see Route_UrlAction
  8. public function handleAuth() {
  9. if (!User::logged()) {
  10. //throw new HttpException('Unauthorized', 401);
  11. User::authByRequest();
  12. }
  13. // zapisać jsona w sesji
  14. }
  15. public function defaultAction() {
  16. UI::gora();
  17. UI::menu();
  18. try {
  19. $id = V::get('id', 0, $_REQUEST, 'int');
  20. if ($id <= 0) throw new Exception("Wrong ID");
  21. $this->showEditor($id);
  22. } catch (Exception $e) {
  23. UI::alert('danger', "Error: " . $e->getMessage());
  24. }
  25. UI::dol();
  26. }
  27. public function showEditor($id) {
  28. echo '<link rel="stylesheet" type="text/css" href="static/sweetalert2.min.css">';
  29. $this->showEditorCss();
  30. echo "<div id=wrapper class=toggled>";
  31. echo "<div id='sidebar-wrapper'><div id=side>";
  32. echo "WYSUWANY DIV Z BOKU";
  33. echo "</div></div>";
  34. echo "<div id='page-content-wrapper'><div id=main>";
  35. echo 'DIV GŁÓWNY';
  36. echo "</div></div>";
  37. echo "<div class=clearfix></div>";
  38. echo "</div>";
  39. echo "<script>var BASE_URL = '".Request::getPathUri()."';var mainProces_id = ".$id.";</script>";
  40. echo '<script src="static/sweetalert2.min.js"></script>';
  41. echo '<script src="static/procesEditor.js"></script>';
  42. }
  43. public function showEditorCss() {
  44. ?>
  45. <style type="text/css">
  46. .ico {
  47. float: right;
  48. margin-top: 10px;
  49. margin-left: 5px;
  50. cursor: pointer;
  51. }
  52. .options {
  53. min-width: 120px;
  54. width: auto !important;
  55. width: 120px;
  56. }
  57. #wrapper {
  58. padding-left: 0;
  59. -webkit-transition: all 0.5s ease;
  60. -moz-transition: all 0.5s ease;
  61. -o-transition: all 0.5s ease;
  62. transition: all 0.5s ease;
  63. }
  64. #wrapper.toggled {
  65. padding-left: 300px;
  66. }
  67. #side {
  68. padding: 15px;
  69. height: 100%;
  70. border-right-style: solid;
  71. border-color: #A61C2E;
  72. border-width: 2px;
  73. }
  74. ul {
  75. list-style: none;
  76. }
  77. #side #ulcon {
  78. background-color: white;
  79. overflow-y: scroll;
  80. height: 70% !important;
  81. margin-top: 10px;
  82. border-radius: 5px;
  83. padding-top: 10px;
  84. padding-bottom: 10px;
  85. border-style: solid;
  86. border-width: 1px;
  87. border-color: #e5e5e5;
  88. color: black;
  89. padding-left: 0px;
  90. font-family: tahoma;
  91. font-size: 13px;
  92. }
  93. #side .drag {
  94. padding-left: 8px;
  95. padding-top: 4px;
  96. padding-bottom: 4px;
  97. border-bottom-style: dotted;
  98. border-width: 1px;
  99. cursor: pointer;
  100. border-color: #e5e5e5;
  101. background-color: white;
  102. display: block;
  103. }
  104. #side .showMore {
  105. padding-left: 2px;
  106. padding-top: 4px;
  107. padding-bottom: 4px;
  108. border-width: 1px;
  109. border-color: #e5e5e5;
  110. }
  111. #side .gIco {
  112. padding-left: 2px;
  113. padding-top: 4px;
  114. padding-bottom: 4px;
  115. border-width: 1px;
  116. border-color: #e5e5e5;
  117. cursor: pointer;
  118. }
  119. #side .hov,
  120. #side .grad {
  121. cursor: pointer;
  122. }
  123. #side .click {
  124. float: left;
  125. color: grey;
  126. font-size: 10px;
  127. cursor: pointer;
  128. }
  129. .delRes,
  130. .btnEdit,
  131. .hdesc,
  132. .sdesc {
  133. cursor: pointer;
  134. }
  135. #side .tabelaName {
  136. white-space: nowrap;
  137. margin-right: 10px;
  138. overflow: hidden;
  139. width: 150px;
  140. float: left;
  141. text-overflow: ellipsis;
  142. display: block;
  143. cursor: pointer;
  144. }
  145. #side .hov:hover {
  146. background-color: #e5e5e5;
  147. }
  148. #sidebar-wrapper {
  149. position: fixed;
  150. left: 300px;
  151. width: 0;
  152. height: 100%;
  153. color: white;
  154. margin-left: -300px;
  155. overflow-y: auto;
  156. background: #222;
  157. -webkit-transition: all 0.5s ease;
  158. -moz-transition: all 0.5s ease;
  159. -o-transition: all 0.5s ease;
  160. transition: all 0.5s ease;
  161. }
  162. #wrapper.toggled #sidebar-wrapper {
  163. width: 300px;
  164. }
  165. #page-content-wrapper {
  166. width: 100%;
  167. position: absolute;
  168. padding: 15px;
  169. }
  170. #wrapper.toggled #page-content-wrapper {
  171. position: absolute;
  172. margin-right: -300px;
  173. }
  174. @media(min-width:1px) {
  175. #wrapper {
  176. padding-left: 300px;
  177. }
  178. #wrapper.toggled {
  179. padding-left: 0;
  180. }
  181. #sidebar-wrapper {
  182. width: 300px;
  183. }
  184. #wrapper.toggled #sidebar-wrapper {
  185. width: 0;
  186. }
  187. #page-content-wrapper {
  188. padding: 20px;
  189. position: relative;
  190. }
  191. #wrapper.toggled #page-content-wrapper {
  192. position: relative;
  193. margin-right: 0;
  194. }
  195. .drop {
  196. margin-top: 10px;
  197. }
  198. .hdesc textarea,
  199. .sdesc textarea {
  200. min-width: 100%;
  201. padding: 10px;
  202. }
  203. .step,
  204. .sDescAdd {
  205. color: grey;
  206. cursor: pointer;
  207. }
  208. .sdesc {
  209. display: block;
  210. }
  211. .hDescAdd {
  212. cursor: pointer;
  213. color: grey;
  214. }
  215. #saveBtn {} .changable {
  216. padding-left: 10px;
  217. }
  218. .changed {
  219. border-left-style: solid;
  220. border-width: 3px;
  221. border-color: #ffc107;
  222. padding-left: 7px;
  223. }
  224. .del {
  225. color: red;
  226. }
  227. .ids {
  228. color: grey;
  229. font-size: 12px;
  230. }
  231. .more {
  232. margin-left: 15px;
  233. }
  234. .resSelected {
  235. background-color: #d3d3d3;
  236. }
  237. </style>
  238. <?php
  239. }
  240. }