index.php 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <?php
  2. $pageTitle = 'Site Settings - Admin Panel';
  3. $headerTitle = 'Site Settings';
  4. $activeTab = 'content';
  5. $tabs = [
  6. 'content' => [
  7. 'label' => 'Content',
  8. 'icon' => 'M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z'
  9. ],
  10. 'options' => [
  11. 'label' => 'Options',
  12. 'icon' => 'M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z'
  13. ],
  14. 'styles' => [
  15. 'label' => 'Styles',
  16. 'icon' => 'M4 2a2 2 0 00-2 2v11a3 3 0 106 0V4a2 2 0 00-2-2H4z'
  17. ],
  18. 'seo' => [
  19. 'label' => 'SEO & Meta',
  20. 'icon' => 'M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z'
  21. ],
  22. 'jsonld' => [
  23. 'label' => 'JSON-LD',
  24. 'icon' => 'M8 4a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z'
  25. ]
  26. ];
  27. ob_start();
  28. ?>
  29. <?php include __DIR__ . '/partials/tabs.php'; ?>
  30. <!-- Form -->
  31. <form method="POST" action="" enctype="multipart/form-data">
  32. <input type="hidden" name="form_submitted" value="1">
  33. <!-- Content Tab -->
  34. <div x-show="activeTab === 'content'" class="bg-white rounded-lg shadow-sm">
  35. <div class="p-6 space-y-8">
  36. <!-- Button Settings -->
  37. <div>
  38. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  39. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  40. <path fill-rule="evenodd" d="M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
  41. </svg>
  42. Header Button Settings
  43. </h3>
  44. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  45. <div>
  46. <label class="block text-sm font-medium text-gray-700 mb-2">Header Button Text 1</label>
  47. <input type="text" name='content[header_btn_1]' value="<?= htmlspecialchars($content['header_btn_1'] ?? '') ?>"
  48. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  49. </div>
  50. <div>
  51. <label class="block text-sm font-medium text-gray-700 mb-2">Header Button Text 2</label>
  52. <input type="text" name='content[header_btn_2]' value="<?= htmlspecialchars($content['header_btn_2'] ?? '') ?>"
  53. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  54. </div>
  55. <div class="flex items-center lg:col-span-2">
  56. <input type="hidden" name="content[hide-btns]" value="0">
  57. <input type="checkbox" name="content[hide-btns]" value="1" <?= !empty($content['hide-btns']) ? 'checked' : '' ?>
  58. class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
  59. <label class="ml-2 block text-sm text-gray-900">Hide header buttons</label>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- Images & Media Section -->
  64. <div>
  65. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  66. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  67. <path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd"/>
  68. </svg>
  69. Images & Media
  70. </h3>
  71. <!-- Header Logo -->
  72. <div class="bg-gray-50 p-4 rounded-lg mb-6">
  73. <h4 class="text-md font-medium text-gray-800 mb-4">Header Logo</h4>
  74. <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
  75. <div>
  76. <?php
  77. $headerLogo = [];
  78. if (isset($content['header-logo']) && !empty($content['header-logo'])) {
  79. $headerLogo = json_decode($content['header-logo'], true) ?: [];
  80. }
  81. ?>
  82. <?php if (!empty($headerLogo['src'])): ?>
  83. <img class="w-24 h-24 object-cover rounded-lg border mb-2" src="../<?= $headerLogo['src'] ?>" alt="Header Logo">
  84. <?php endif; ?>
  85. <label class="block text-sm font-medium text-gray-700 mb-2">Upload Header Logo</label>
  86. <input type="file" name="content[header-logo]" accept="image/*"
  87. class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
  88. </div>
  89. <div>
  90. <label class="block text-sm font-medium text-gray-700 mb-2">Title</label>
  91. <input type="text" name='content[header-logo][title]' value="<?= htmlspecialchars($headerLogo['title'] ?? '') ?>"
  92. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  93. </div>
  94. <div>
  95. <label class="block text-sm font-medium text-gray-700 mb-2">Alt Text</label>
  96. <input type="text" name='content[header-logo][alt]' value="<?= htmlspecialchars($headerLogo['alt'] ?? '') ?>"
  97. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  98. </div>
  99. </div>
  100. </div>
  101. <!-- Banner Logo -->
  102. <div class="bg-gray-50 p-4 rounded-lg mb-6">
  103. <h4 class="text-md font-medium text-gray-800 mb-4">Banner Image</h4>
  104. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  105. <div>
  106. <?php
  107. $bannerLogo = [];
  108. if (isset($content['banner-logo']) && !empty($content['banner-logo'])) {
  109. $bannerLogo = json_decode($content['banner-logo'], true) ?: [];
  110. }
  111. ?>
  112. <?php if (!empty($bannerLogo['src'])): ?>
  113. <img class="w-full h-24 object-cover rounded-lg border mb-2" src="../<?= $bannerLogo['src'] ?>" alt="Banner Image">
  114. <?php endif; ?>
  115. <label class="block text-sm font-medium text-gray-700 mb-2">Upload Banner Image</label>
  116. <input type="file" name="content[banner-logo]" accept="image/*"
  117. class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
  118. </div>
  119. <div class="space-y-4">
  120. <div>
  121. <label class="block text-sm font-medium text-gray-700 mb-2">Title</label>
  122. <input type="text" name='content[banner-logo][title]' value="<?= htmlspecialchars($bannerLogo['title'] ?? '') ?>"
  123. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  124. </div>
  125. <div>
  126. <label class="block text-sm font-medium text-gray-700 mb-2">Alt Text</label>
  127. <input type="text" name='content[banner-logo][alt]' value="<?= htmlspecialchars($bannerLogo['alt'] ?? '') ?>"
  128. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  129. </div>
  130. <div class="grid grid-cols-2 gap-4">
  131. <div>
  132. <label class="block text-sm font-medium text-gray-700 mb-2">Width</label>
  133. <input type="text" name='content[banner-logo][width]' value="<?= htmlspecialchars($bannerLogo['width'] ?? '') ?>"
  134. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  135. </div>
  136. <div>
  137. <label class="block text-sm font-medium text-gray-700 mb-2">Height</label>
  138. <input type="text" name='content[banner-logo][height]' value="<?= htmlspecialchars($bannerLogo['height'] ?? '') ?>"
  139. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- Footer Logo -->
  146. <div class="bg-gray-50 p-4 rounded-lg mb-6">
  147. <h4 class="text-md font-medium text-gray-800 mb-4">Footer Logo</h4>
  148. <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
  149. <div>
  150. <?php
  151. $footerLogo = [];
  152. if (isset($content['footer-logo']) && !empty($content['footer-logo'])) {
  153. $footerLogo = json_decode($content['footer-logo'], true) ?: [];
  154. }
  155. ?>
  156. <?php if (!empty($footerLogo['src'])): ?>
  157. <img class="w-24 h-24 object-cover rounded-lg border mb-2" src="../<?= $footerLogo['src'] ?>" alt="Footer Logo">
  158. <?php endif; ?>
  159. <label class="block text-sm font-medium text-gray-700 mb-2">Upload Footer Logo</label>
  160. <input type="file" name="content[footer-logo]" accept="image/*"
  161. class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
  162. </div>
  163. <div>
  164. <label class="block text-sm font-medium text-gray-700 mb-2">Title</label>
  165. <input type="text" name='content[footer-logo][title]' value="<?= htmlspecialchars($footerLogo['title'] ?? '') ?>"
  166. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  167. </div>
  168. <div>
  169. <label class="block text-sm font-medium text-gray-700 mb-2">Alt Text</label>
  170. <input type="text" name='content[footer-logo][alt]' value="<?= htmlspecialchars($footerLogo['alt'] ?? '') ?>"
  171. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  172. </div>
  173. </div>
  174. </div>
  175. <!-- Other Images -->
  176. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  177. <div class="bg-gray-50 p-4 rounded-lg">
  178. <h4 class="text-md font-medium text-gray-800 mb-4">Favicon</h4>
  179. <?php if (!empty($content['favicon'])): ?>
  180. <img class="w-16 h-16 object-cover rounded border mb-2" src="../<?= $content['favicon'] ?>" alt="Favicon">
  181. <?php endif; ?>
  182. <label class="block text-sm font-medium text-gray-700 mb-2">Upload Favicon</label>
  183. <input type="file" name="content[favicon]" accept="image/*"
  184. class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
  185. </div>
  186. </div>
  187. </div>
  188. <!-- Footer Settings -->
  189. <div>
  190. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  191. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  192. <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
  193. </svg>
  194. Footer Content
  195. </h3>
  196. <div class="grid grid-cols-1 gap-6">
  197. <div>
  198. <label class="block text-sm font-medium text-gray-700 mb-2">Footer Text</label>
  199. <textarea name='content[footer__text]' rows="4"
  200. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"><?= htmlspecialchars($content['footer__text'] ?? '') ?></textarea>
  201. </div>
  202. <div>
  203. <label class="block text-sm font-medium text-gray-700 mb-2">Copyright</label>
  204. <textarea name='content[copyright]' rows="2"
  205. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"><?= htmlspecialchars($content['copyright'] ?? '') ?></textarea>
  206. </div>
  207. </div>
  208. </div>
  209. <!-- Save Button -->
  210. <div class="pt-6 border-t border-gray-200">
  211. <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors">
  212. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  213. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  214. </svg>
  215. Save Changes
  216. </button>
  217. </div>
  218. </div>
  219. </div>
  220. <!-- Options Tab -->
  221. <div x-show="activeTab === 'options'" class="bg-white rounded-lg shadow-sm">
  222. <div class="p-6 space-y-8">
  223. <!-- Hash Fields Section -->
  224. <div>
  225. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  226. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  227. <path fill-rule="evenodd" d="M3 6a3 3 0 013-3h10a1 1 0 01.8 1.6L14.25 8l2.55 3.4A1 1 0 0116 13H6a1 1 0 00-1 1v3a1 1 0 11-2 0V6z" clip-rule="evenodd"/>
  228. </svg>
  229. Hash Fields
  230. </h3>
  231. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  232. <div>
  233. <label class="block text-sm font-medium text-gray-700 mb-2">Hash</label>
  234. <input type="text" name='content[hash]' value="<?= htmlspecialchars($content['hash'] ?? '') ?>"
  235. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  236. </div>
  237. <div>
  238. <label class="block text-sm font-medium text-gray-700 mb-2">Hash 1</label>
  239. <input type="text" name='content[hash-1]' value="<?= htmlspecialchars($content['hash-1'] ?? '') ?>"
  240. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  241. </div>
  242. <div>
  243. <label class="block text-sm font-medium text-gray-700 mb-2">Hash 2</label>
  244. <input type="text" name='content[hash-2]' value="<?= htmlspecialchars($content['hash-2'] ?? '') ?>"
  245. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  246. </div>
  247. <div>
  248. <label class="block text-sm font-medium text-gray-700 mb-2">Hash 3</label>
  249. <input type="text" name='content[hash-3]' value="<?= htmlspecialchars($content['hash-3'] ?? '') ?>"
  250. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  251. </div>
  252. <div>
  253. <label class="block text-sm font-medium text-gray-700 mb-2">Hash 4</label>
  254. <input type="text" name='content[hash-4]' value="<?= htmlspecialchars($content['hash-4'] ?? '') ?>"
  255. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  256. </div>
  257. <div>
  258. <label class="block text-sm font-medium text-gray-700 mb-2">Hash 5</label>
  259. <input type="text" name='content[hash-5]' value="<?= htmlspecialchars($content['hash-5'] ?? '') ?>"
  260. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  261. </div>
  262. </div>
  263. </div>
  264. <!-- Save Button -->
  265. <div class="pt-6 border-t border-gray-200">
  266. <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors">
  267. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  268. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  269. </svg>
  270. Save Changes
  271. </button>
  272. </div>
  273. </div>
  274. </div>
  275. <!-- Styles Tab -->
  276. <div x-show="activeTab === 'styles'" class="bg-white rounded-lg shadow-sm">
  277. <div class="p-6 space-y-8">
  278. <!-- Color Settings Section -->
  279. <div>
  280. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  281. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  282. <path fill-rule="evenodd" d="M4 2a2 2 0 00-2 2v11a3 3 0 106 0V4a2 2 0 00-2-2H4z" clip-rule="evenodd"/>
  283. </svg>
  284. Цветовые настройки
  285. </h3>
  286. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  287. <!-- Цвет хедера -->
  288. <div>
  289. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет хедера (шапки сайта)</label>
  290. <div class="flex gap-3">
  291. <input type="color" value="<?= $styles['header_color'] ?? '#1E1E1E' ?>"
  292. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  293. onchange="this.nextElementSibling.value = this.value">
  294. <input type="text" name='styles[header_color]' value="<?= htmlspecialchars($styles['header_color'] ?? '') ?>"
  295. placeholder="#1E1E1E"
  296. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  297. </div>
  298. </div>
  299. <!-- Цвет body (фон) -->
  300. <div>
  301. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет body (фон сайта)</label>
  302. <div class="flex gap-3">
  303. <input type="color" value="<?= $styles['body_bg_color'] ?? '#0A0A0A' ?>"
  304. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  305. onchange="this.nextElementSibling.value = this.value">
  306. <input type="text" name='styles[body_bg_color]' value="<?= htmlspecialchars($styles['body_bg_color'] ?? '') ?>"
  307. placeholder="#0A0A0A"
  308. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  309. </div>
  310. </div>
  311. <!-- Цвет контентной части -->
  312. <div>
  313. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет контентной части</label>
  314. <div class="flex gap-3">
  315. <input type="color" value="<?= $styles['content_bg_color'] ?? '#1A1A1A' ?>"
  316. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  317. onchange="this.nextElementSibling.value = this.value">
  318. <input type="text" name='styles[content_bg_color]' value="<?= htmlspecialchars($styles['content_bg_color'] ?? '') ?>"
  319. placeholder="#1A1A1A"
  320. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  321. </div>
  322. </div>
  323. <!-- Цвет текста основного -->
  324. <div>
  325. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет текста основного</label>
  326. <div class="flex gap-3">
  327. <input type="color" value="<?= $styles['text_color'] ?? '#FFFFFF' ?>"
  328. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  329. onchange="this.nextElementSibling.value = this.value">
  330. <input type="text" name='styles[text_color]' value="<?= htmlspecialchars($styles['text_color'] ?? '') ?>"
  331. placeholder="#FFFFFF"
  332. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  333. </div>
  334. </div>
  335. <!-- Цвет текста ссылок в контенте -->
  336. <div>
  337. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет текста ссылок в контенте</label>
  338. <div class="flex gap-3">
  339. <input type="color" value="<?= $styles['link_color'] ?? '#4A9EFF' ?>"
  340. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  341. onchange="this.nextElementSibling.value = this.value">
  342. <input type="text" name='styles[link_color]' value="<?= htmlspecialchars($styles['link_color'] ?? '') ?>"
  343. placeholder="#4A9EFF"
  344. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  345. </div>
  346. </div>
  347. <!-- Акцентный цвет -->
  348. <div>
  349. <label class="block text-sm font-medium text-gray-700 mb-2">Акцентный цвет</label>
  350. <div class="flex gap-3">
  351. <input type="color" value="<?= $styles['accent_color'] ?? '#FF6B35' ?>"
  352. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  353. onchange="this.nextElementSibling.value = this.value">
  354. <input type="text" name='styles[accent_color]' value="<?= htmlspecialchars($styles['accent_color'] ?? '') ?>"
  355. placeholder="#FF6B35"
  356. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  357. </div>
  358. </div>
  359. <!-- Цвет границы контента -->
  360. <div>
  361. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет границы контента</label>
  362. <div class="flex gap-3">
  363. <input type="color" value="<?= $styles['content_border_color'] ?? '#E4E4E4' ?>"
  364. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  365. onchange="this.nextElementSibling.value = this.value">
  366. <input type="text" name='styles[content_border_color]' value="<?= htmlspecialchars($styles['content_border_color'] ?? '') ?>"
  367. placeholder="#E4E4E4"
  368. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  369. </div>
  370. </div>
  371. <!-- Цвет таблицы -->
  372. <div>
  373. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет таблицы (фон)</label>
  374. <div class="flex gap-3">
  375. <input type="color" value="<?= $styles['table_bg_color'] ?? '#1A1A1A' ?>"
  376. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  377. onchange="this.nextElementSibling.value = this.value">
  378. <input type="text" name='styles[table_bg_color]' value="<?= htmlspecialchars($styles['table_bg_color'] ?? '') ?>"
  379. placeholder="#1A1A1A"
  380. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  381. </div>
  382. </div>
  383. <!-- Цвет шапки таблицы -->
  384. <div>
  385. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет шапки таблицы (thead)</label>
  386. <div class="flex gap-3">
  387. <input type="color" value="<?= $styles['table_header_color'] ?? '#2A2A2A' ?>"
  388. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  389. onchange="this.nextElementSibling.value = this.value">
  390. <input type="text" name='styles[table_header_color]' value="<?= htmlspecialchars($styles['table_header_color'] ?? '') ?>"
  391. placeholder="#2A2A2A"
  392. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  393. </div>
  394. </div>
  395. <!-- Цвет фона футера -->
  396. <div>
  397. <label class="block text-sm font-medium text-gray-700 mb-2">Цвет фона футера</label>
  398. <div class="flex gap-3">
  399. <input type="color" value="<?= $styles['footer_bg_color'] ?? '#1E1E1E' ?>"
  400. class="w-12 h-10 rounded border border-gray-300 cursor-pointer"
  401. onchange="this.nextElementSibling.value = this.value">
  402. <input type="text" name='styles[footer_bg_color]' value="<?= htmlspecialchars($styles['footer_bg_color'] ?? '') ?>"
  403. placeholder="#1E1E1E"
  404. class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. <!-- Save Button -->
  410. <div class="pt-6 border-t border-gray-200">
  411. <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors">
  412. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  413. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  414. </svg>
  415. Сохранить изменения
  416. </button>
  417. </div>
  418. </div>
  419. </div>
  420. <!-- SEO Tab -->
  421. <div x-show="activeTab === 'seo'" class="bg-white rounded-lg shadow-sm">
  422. <div class="p-6 space-y-8">
  423. <!-- Hreflang Settings -->
  424. <div x-data="{
  425. hreflangs: <?= htmlspecialchars(json_encode(isset($seo['hreflang']) ? json_decode($seo['hreflang'], true) ?: [] : []), ENT_QUOTES, 'UTF-8') ?>,
  426. addHreflang() {
  427. this.hreflangs.push({hreflang: '', href: ''});
  428. },
  429. removeHreflang(index) {
  430. this.hreflangs.splice(index, 1);
  431. }
  432. }">
  433. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  434. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  435. <path fill-rule="evenodd" d="M7 2a1 1 0 011 1v1h3a1 1 0 110 2H9.578a18.87 18.87 0 01-1.724 4.78c.29.354.596.696.914 1.026a1 1 0 11-1.44 1.389c-.188-.196-.373-.396-.554-.6a18.9 18.9 0 01-2.62 3.624 1 1 0 11-1.44-1.389A16.9 16.9 0 003.578 8H2a1 1 0 110-2h2.578c.15-.667.34-1.32.578-1.96A1 1 0 015.5 4c.76 0 1.5.11 2.5.342V3a1 1 0 011-1zm1.578 6H7.422c.12.456.264.903.428 1.34.164-.437.308-.884.428-1.34zM17 6a3 3 0 11-6 0 3 3 0 016 0z" clip-rule="evenodd"/>
  436. </svg>
  437. Hreflang Settings
  438. </h3>
  439. <!-- Hidden input to store JSON data -->
  440. <input type="hidden" name="seo[hreflang]" x-bind:value="JSON.stringify(hreflangs)">
  441. <div class="space-y-4">
  442. <template x-for="(item, index) in hreflangs" :key="index">
  443. <div class="flex gap-4 items-end">
  444. <div class="flex-1">
  445. <label class="block text-sm font-medium text-gray-700 mb-2">Language Code</label>
  446. <input type="text" x-model="item.hreflang" placeholder="en, ru, de, x-default"
  447. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  448. </div>
  449. <div class="flex-2">
  450. <label class="block text-sm font-medium text-gray-700 mb-2">URL</label>
  451. <input type="url" x-model="item.href" placeholder="https://example.com/en/"
  452. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  453. </div>
  454. <button type="button" @click="removeHreflang(index)"
  455. class="px-3 py-2 text-red-600 hover:text-red-800 border border-red-300 hover:border-red-500 rounded-md transition-colors">
  456. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  457. <path fill-rule="evenodd" d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" clip-rule="evenodd"/>
  458. <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
  459. </svg>
  460. </button>
  461. </div>
  462. </template>
  463. <button type="button" @click="addHreflang()"
  464. class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
  465. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  466. <path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd"/>
  467. </svg>
  468. Add Hreflang
  469. </button>
  470. </div>
  471. </div>
  472. <!-- Save Button -->
  473. <div class="pt-6 border-t border-gray-200">
  474. <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors">
  475. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  476. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  477. </svg>
  478. Save Settings
  479. </button>
  480. </div>
  481. </div>
  482. </div>
  483. <!-- JSON-LD Tab -->
  484. <div x-show="activeTab === 'jsonld'" class="bg-white rounded-lg shadow-sm">
  485. <div class="p-6 space-y-8">
  486. <!-- Organization Settings -->
  487. <div>
  488. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  489. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  490. <path fill-rule="evenodd" d="M4 4a2 2 0 012-2h8a2 2 0 012 2v12a1 1 0 110 2h-3a1 1 0 01-1-1v-2a1 1 0 00-1-1H9a1 1 0 00-1 1v2a1 1 0 01-1 1H4a1 1 0 110-2V4z" clip-rule="evenodd"/>
  491. </svg>
  492. Organization
  493. </h3>
  494. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  495. <div>
  496. <label class="block text-sm font-medium text-gray-700 mb-2">Organization Name</label>
  497. <input type="text" name='jsonld[organization_name]' value="<?= htmlspecialchars($jsonld['organization_name'] ?? '') ?>"
  498. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  499. </div>
  500. <div>
  501. <label class="block text-sm font-medium text-gray-700 mb-2">Organization URL</label>
  502. <input type="url" name='jsonld[organization_url]' value="<?= htmlspecialchars($jsonld['organization_url'] ?? '') ?>"
  503. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  504. </div>
  505. <div>
  506. <label class="block text-sm font-medium text-gray-700 mb-2">Same As URLs (one per line)</label>
  507. <textarea name='jsonld[organization_same_as]' rows="4"
  508. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"><?= htmlspecialchars($jsonld['organization_same_as'] ?? '') ?></textarea>
  509. </div>
  510. <div>
  511. <label class="block text-sm font-medium text-gray-700 mb-2">License URL</label>
  512. <input type="url" name='jsonld[license_url]' value="<?= htmlspecialchars($jsonld['license_url'] ?? '') ?>"
  513. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  514. </div>
  515. </div>
  516. </div>
  517. <!-- Breadcrumb Settings -->
  518. <div>
  519. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  520. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  521. <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
  522. </svg>
  523. Breadcrumbs
  524. </h3>
  525. <div class="grid grid-cols-1 gap-6">
  526. <div>
  527. <label class="block text-sm font-medium text-gray-700 mb-2">Breadcrumb Home Name</label>
  528. <input type="text" name='jsonld[breadcrumb_home_name]' value="<?= htmlspecialchars($jsonld['breadcrumb_home_name'] ?? '') ?>"
  529. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  530. </div>
  531. </div>
  532. </div>
  533. <!-- Rating & Review Settings -->
  534. <div>
  535. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  536. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  537. <path fill-rule="evenodd" d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" clip-rule="evenodd"/>
  538. </svg>
  539. Reviews & Ratings
  540. </h3>
  541. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  542. <div>
  543. <label class="block text-sm font-medium text-gray-700 mb-2">Rating Value</label>
  544. <input type="number" step="0.1" min="1" max="5" name='jsonld[rating_value]' value="<?= htmlspecialchars($jsonld['rating_value'] ?? '') ?>"
  545. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  546. </div>
  547. <div>
  548. <label class="block text-sm font-medium text-gray-700 mb-2">Best Rating</label>
  549. <input type="number" name='jsonld[best_rating]' value="<?= htmlspecialchars($jsonld['best_rating'] ?? '5') ?>"
  550. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  551. </div>
  552. <div>
  553. <label class="block text-sm font-medium text-gray-700 mb-2">Worst Rating</label>
  554. <input type="number" name='jsonld[worst_rating]' value="<?= htmlspecialchars($jsonld['worst_rating'] ?? '1') ?>"
  555. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  556. </div>
  557. <div>
  558. <label class="block text-sm font-medium text-gray-700 mb-2">Review Count</label>
  559. <input type="number" name='jsonld[review_count]' value="<?= htmlspecialchars($jsonld['review_count'] ?? '') ?>"
  560. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  561. </div>
  562. </div>
  563. </div>
  564. <!-- Software Application Settings -->
  565. <div>
  566. <h3 class="text-lg font-medium text-gray-900 mb-6 flex items-center">
  567. <svg class="w-5 h-5 mr-2 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
  568. <path fill-rule="evenodd" d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z" clip-rule="evenodd"/>
  569. </svg>
  570. Software Application
  571. </h3>
  572. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  573. <div>
  574. <label class="block text-sm font-medium text-gray-700 mb-2">App Name</label>
  575. <input type="text" name='jsonld[app_name]' value="<?= htmlspecialchars($jsonld['app_name'] ?? '') ?>"
  576. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  577. </div>
  578. <div>
  579. <label class="block text-sm font-medium text-gray-700 mb-2">Operating System</label>
  580. <input type="text" name='jsonld[operating_system]' value="<?= htmlspecialchars($jsonld['operating_system'] ?? '') ?>"
  581. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  582. </div>
  583. <div>
  584. <label class="block text-sm font-medium text-gray-700 mb-2">Application Category</label>
  585. <input type="text" name='jsonld[application_category]' value="<?= htmlspecialchars($jsonld['application_category'] ?? '') ?>"
  586. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  587. </div>
  588. <div>
  589. <label class="block text-sm font-medium text-gray-700 mb-2">Download URL</label>
  590. <input type="url" name='jsonld[download_url]' value="<?= htmlspecialchars($jsonld['download_url'] ?? '') ?>"
  591. class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  592. </div>
  593. </div>
  594. </div>
  595. <!-- Save Button -->
  596. <div class="pt-6 border-t border-gray-200">
  597. <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors">
  598. <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
  599. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  600. </svg>
  601. Save JSON-LD Settings
  602. </button>
  603. </div>
  604. </div>
  605. </div>
  606. </form>
  607. <?php
  608. $content = ob_get_clean();
  609. include __DIR__ . '/partials/layout.php';
  610. ?>